linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH net] ipvs: Fix uninit-value in do_ip_vs_set_ctl()
@ 2020-08-10 22:07 Peilin Ye
  2020-08-11  3:57 ` Cong Wang
  2020-08-11  7:46 ` [Linux-kernel-mentees] [PATCH net-next v2] " Peilin Ye
  0 siblings, 2 replies; 10+ messages in thread
From: Peilin Ye @ 2020-08-10 22:07 UTC (permalink / raw)
  To: Wensong Zhang, Simon Horman, Julian Anastasov
  Cc: Florian Westphal, linux-kernel, Peilin Ye, lvs-devel, coreteam,
	netfilter-devel, netdev, Jakub Kicinski, syzkaller-bugs,
	Jozsef Kadlecsik, linux-kernel-mentees, David S. Miller,
	Pablo Neira Ayuso

do_ip_vs_set_ctl() is referencing uninitialized stack value when `len` is
zero. Fix it.

Reported-and-tested-by: syzbot+23b5f9e7caf61d9a3898@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=46ebfb92a8a812621a001ef04d90dfa459520fe2
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
---
 net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 412656c34f20..c050b6a42786 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2418,7 +2418,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
 {
 	struct net *net = sock_net(sk);
 	int ret;
-	unsigned char arg[MAX_SET_ARGLEN];
+	unsigned char arg[MAX_SET_ARGLEN] = {};
 	struct ip_vs_service_user *usvc_compat;
 	struct ip_vs_service_user_kern usvc;
 	struct ip_vs_service *svc;
-- 
2.25.1

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-28 17:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 22:07 [Linux-kernel-mentees] [PATCH net] ipvs: Fix uninit-value in do_ip_vs_set_ctl() Peilin Ye
2020-08-11  3:57 ` Cong Wang
2020-08-11  5:09   ` Peilin Ye
2020-08-11  6:58     ` Julian Anastasov
2020-08-11  7:19       ` Peilin Ye
2020-08-11  7:46 ` [Linux-kernel-mentees] [PATCH net-next v2] " Peilin Ye
2020-08-11 10:29   ` Julian Anastasov
2020-08-11 12:59     ` Simon Horman
2020-08-13  1:28       ` Pablo Neira Ayuso
2020-08-28 17:21   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).