]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netfilter: nf_tables: disallow updates of implicit chain
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 21 Aug 2022 08:28:25 +0000 (10:28 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 24 Aug 2022 05:43:20 +0000 (07:43 +0200)
Updates on existing implicit chain make no sense, disallow this.

Fixes: 2afcd17bdf11 ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index 62cfb0e31c40e023f53b657cbfd4433bfaae4c74..dff2b5851bbb0649227f943a6e616a8766d0f4af 100644 (file)
@@ -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;