Skip to content

Commit

Permalink
netfilter: nf_tables: disallow updates of implicit chain
Browse files Browse the repository at this point in the history
Updates on existing implicit chain make no sense, disallow this.

Fixes: d0e2c7d ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Pablo Neira Ayuso committed Aug 24, 2022
1 parent 18bbc32 commit 5dc52d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,9 @@ static int nf_tables_newchain(struct sk_buff *skb, const struct nfnl_info *info,
nft_ctx_init(&ctx, net, skb, info->nlh, family, table, chain, nla);

if (chain != NULL) {
if (chain->flags & NFT_CHAIN_BINDING)
return -EINVAL;

if (info->nlh->nlmsg_flags & NLM_F_EXCL) {
NL_SET_BAD_ATTR(extack, attr);
return -EEXIST;
Expand Down

0 comments on commit 5dc52d8

Please sign in to comment.