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
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Pablo Neira Ayuso authored and Greg Kroah-Hartman committed Mar 28, 2022
1 parent 8e8f668 commit dd03640
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 @@ -201,7 +201,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
const struct nft_rule_dp *rule, *last_rule;
const struct net *net = nft_net(pkt);
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 dd03640

Please sign in to comment.