瀏覽代碼

netfilter: nf_tables: skip transaction if no update flags in tables

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>
Pablo Neira Ayuso 11 年之前
父節點
當前提交
63283dd21e
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/netfilter/nf_tables_api.c

+ 3 - 0
net/netfilter/nf_tables_api.c

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