Skip to content

Commit

Permalink
netfilter: nf_tables: initialize registers in nft_do_chain()
Browse files Browse the repository at this point in the history
ANBZ: torvalds#740

commit 4c905f6 upstream.

Initialize registers to avoid stack leak into userspace.

Fixes: 9651851 ("netfilter: add nftables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Fixes: CVE-2022-1016
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Dust Li <dust.li@linux.alibaba.com>
  • Loading branch information
ummakynes authored and fengidri committed Apr 2, 2022
1 parent 7a48fbf commit 144056c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
struct nft_rule *const *rules;
const struct nft_rule *rule;
const struct nft_expr *expr, *last;
struct nft_regs regs;
struct nft_regs regs = {};
unsigned int stackptr = 0;
struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE];
bool genbit = READ_ONCE(net->nft.gencursor);
Expand Down

0 comments on commit 144056c

Please sign in to comment.