LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[Linux-kernel-mentees] [PATCH net] ipvs: Fix uninit-value in do_ip_vs_se

To: Wensong Zhang <wensong@xxxxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>
Subject: [Linux-kernel-mentees] [PATCH net] ipvs: Fix uninit-value in do_ip_vs_set_ctl()
Cc: Peilin Ye <yepeilin.cs@xxxxxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxx>, Florian Westphal <fw@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, coreteam@xxxxxxxxxxxxx, linux-kernel-mentees@xxxxxxxxxxxxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
From: Peilin Ye <yepeilin.cs@xxxxxxxxx>
Date: Mon, 10 Aug 2020 18:07:03 -0400
do_ip_vs_set_ctl() is referencing uninitialized stack value when `len` is
zero. Fix it.

Reported-and-tested-by: syzbot+23b5f9e7caf61d9a3898@xxxxxxxxxxxxxxxxxxxxxxxxx
Link: 
https://syzkaller.appspot.com/bug?id=46ebfb92a8a812621a001ef04d90dfa459520fe2
Signed-off-by: Peilin Ye <yepeilin.cs@xxxxxxxxx>
---
 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


<Prev in Thread] Current Thread [Next in Thread>