From: Pablo Neira Ayuso Date: Thu, 17 Mar 2022 11:04:42 +0000 (+0100) Subject: netfilter: nf_tables: initialize registers in nft_do_chain() X-Git-Tag: v4.14.274~7 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=a3cc32863b175168283cb0a5fde08de6a1e27df9;p=wrapfs-5.3.y.git netfilter: nf_tables: initialize registers in nft_do_chain() commit 4c905f6740a365464e91467aa50916555b28213d upstream. Initialize registers to avoid stack leak into userspace. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c index 32b7896929f3..7d60fa57bf80 100644 --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c @@ -150,7 +150,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv) const struct net *net = nft_net(pkt); 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]; int rulenum;