diff mbox series

[SRU,Xenial,1/1] netfilter: nf_tables: initialize registers in nft_do_chain()

Message ID 20230223230040.50880-2-yuxuan.luo@canonical.com
State New
Headers show
Series CVE-2022-1016 | expand

Commit Message

Yuxuan Luo Feb. 23, 2023, 11 p.m. UTC
From: Pablo Neira Ayuso <pablo@netfilter.org>

Initialize registers to avoid stack leak into userspace.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 4c905f6740a365464e91467aa50916555b28213d)
CVE-2022-1016
Signed-off-by: Yuxuan Luo <yuxuan.luo@canonical.com>
---
 net/netfilter/nf_tables_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thadeu Lima de Souza Cascardo March 8, 2023, 5:32 p.m. UTC | #1
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
diff mbox series

Patch

diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c
index 204be93746578..00635ce1a3a25 100644
--- a/net/netfilter/nf_tables_core.c
+++ b/net/netfilter/nf_tables_core.c
@@ -115,7 +115,7 @@  nft_do_chain(struct nft_pktinfo *pkt, void *priv)
 	const struct net *net = pkt->net;
 	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];
 	struct nft_stats *stats;