diff options
author | Liping Zhang <liping.zhang@spreadtrum.com> | 2016-09-22 10:28:52 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-09-25 08:54:04 -0400 |
commit | 7bfdde7045ad54d9fdccac70baffd094d9de73f8 (patch) | |
tree | 299515d8e6cfd77a65dba12479cf1337841c1a90 /net | |
parent | d767ff2c84f19be1aa403762f34eebbb403caf6d (diff) |
netfilter: nft_ct: report error if mark and dir specified simultaneously
NFT_CT_MARK is unrelated to direction, so if NFTA_CT_DIRECTION attr is
specified, report EINVAL to the userspace. This validation check was
already done at nft_ct_get_init, but we missed it in nft_ct_set_init.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nft_ct.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index 825fbbc62f48..d7b0d171172a 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c | |||
@@ -364,6 +364,8 @@ static int nft_ct_set_init(const struct nft_ctx *ctx, | |||
364 | switch (priv->key) { | 364 | switch (priv->key) { |
365 | #ifdef CONFIG_NF_CONNTRACK_MARK | 365 | #ifdef CONFIG_NF_CONNTRACK_MARK |
366 | case NFT_CT_MARK: | 366 | case NFT_CT_MARK: |
367 | if (tb[NFTA_CT_DIRECTION]) | ||
368 | return -EINVAL; | ||
367 | len = FIELD_SIZEOF(struct nf_conn, mark); | 369 | len = FIELD_SIZEOF(struct nf_conn, mark); |
368 | break; | 370 | break; |
369 | #endif | 371 | #endif |