mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
netfilter: nf_tables: reject unsupported chain flags
Bail out if userspace sends unsupported chain flags. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
d0e2c7de92
commit
c1f79a2eef
@ -189,6 +189,9 @@ enum nft_chain_flags {
|
|||||||
NFT_CHAIN_HW_OFFLOAD = (1 << 1),
|
NFT_CHAIN_HW_OFFLOAD = (1 << 1),
|
||||||
NFT_CHAIN_BINDING = (1 << 2),
|
NFT_CHAIN_BINDING = (1 << 2),
|
||||||
};
|
};
|
||||||
|
#define NFT_CHAIN_FLAGS (NFT_CHAIN_BASE | \
|
||||||
|
NFT_CHAIN_HW_OFFLOAD | \
|
||||||
|
NFT_CHAIN_BINDING)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum nft_chain_attributes - nf_tables chain netlink attributes
|
* enum nft_chain_attributes - nf_tables chain netlink attributes
|
||||||
|
@ -2285,6 +2285,9 @@ static int nf_tables_newchain(struct net *net, struct sock *nlsk,
|
|||||||
else if (chain)
|
else if (chain)
|
||||||
flags = chain->flags;
|
flags = chain->flags;
|
||||||
|
|
||||||
|
if (flags & ~NFT_CHAIN_FLAGS)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
nft_ctx_init(&ctx, net, skb, nlh, family, table, chain, nla);
|
nft_ctx_init(&ctx, net, skb, nlh, family, table, chain, nla);
|
||||||
|
|
||||||
if (chain != NULL) {
|
if (chain != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user