]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
netfilter: nf_tables: skip transaction if no update flags in tables
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 27 Jun 2014 16:51:39 +0000 (18:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Jun 2014 09:44:24 +0000 (11:44 +0200)
Skip transaction handling for table updates with no changes in
the flags. This fixes a crash when passing the table flag with all
bits unset.

Reported-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index ab4566cfcbe497beea641dff934e24dc3341096b..da5dc37a7402b598d1ea6b8a7cd523f25e24d122 100644 (file)
@@ -407,6 +407,9 @@ static int nf_tables_updtable(struct nft_ctx *ctx)
        if (flags & ~NFT_TABLE_F_DORMANT)
                return -EINVAL;
 
+       if (flags == ctx->table->flags)
+               return 0;
+
        trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE,
                                sizeof(struct nft_trans_table));
        if (trans == NULL)