[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220301081824.2053310-1-chi.minghao@zte.com.cn>
Date: Tue, 1 Mar 2022 08:18:24 +0000
From: cgel.zte@...il.com
To: pablo@...filter.org
Cc: kadlec@...filter.org, fw@...len.de, davem@...emloft.net,
kuba@...nel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org,
netfilter-devel@...r.kernel.org, coreteam@...filter.org,
netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] net/netfilter: use memset avoid infoleaks
From: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn>
Use memset to initialize structs to preventing infoleaks
in __bpf_mt_check_bytecode
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn>
---
net/netfilter/xt_bpf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/netfilter/xt_bpf.c b/net/netfilter/xt_bpf.c
index 849ac552a154..5750a68a2a3f 100644
--- a/net/netfilter/xt_bpf.c
+++ b/net/netfilter/xt_bpf.c
@@ -29,6 +29,7 @@ static int __bpf_mt_check_bytecode(struct sock_filter *insns, __u16 len,
if (len > XT_BPF_MAX_NUM_INSTR)
return -EINVAL;
+ memset(&program, 0x0, sizeof(program));
program.len = len;
program.filter = insns;
--
2.25.1
Powered by blists - more mailing lists