mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
ipvs: Fix uninit-value in do_ip_vs_set_ctl()
do_ip_vs_set_ctl() is referencing uninitialized stack value when `len` is zero. Fix it. Reported-by: syzbot+23b5f9e7caf61d9a3898@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=46ebfb92a8a812621a001ef04d90dfa459520fe2 Suggested-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Acked-by: Julian Anastasov <ja@ssi.bg> Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
d5608a0578
commit
c5a8a8498e
@ -2508,6 +2508,10 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, sockptr_t ptr, unsigned int len)
|
|||||||
/* Set timeout values for (tcp tcpfin udp) */
|
/* Set timeout values for (tcp tcpfin udp) */
|
||||||
ret = ip_vs_set_timeout(ipvs, (struct ip_vs_timeout_user *)arg);
|
ret = ip_vs_set_timeout(ipvs, (struct ip_vs_timeout_user *)arg);
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
} else if (!len) {
|
||||||
|
/* No more commands with len == 0 below */
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
usvc_compat = (struct ip_vs_service_user *)arg;
|
usvc_compat = (struct ip_vs_service_user *)arg;
|
||||||
@ -2584,9 +2588,6 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, sockptr_t ptr, unsigned int len)
|
|||||||
break;
|
break;
|
||||||
case IP_VS_SO_SET_DELDEST:
|
case IP_VS_SO_SET_DELDEST:
|
||||||
ret = ip_vs_del_dest(svc, &udest);
|
ret = ip_vs_del_dest(svc, &udest);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user