From: Xi Wang Date: Sun, 11 Nov 2012 11:20:01 +0000 (+0000) Subject: ipv4: avoid undefined behavior in do_ip_setsockopt() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c9f79be295c99ac7e4b569ca493d75fdcc19e4e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ipv4: avoid undefined behavior in do_ip_setsockopt() (1< Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 5eea4a811042..14bbfcf717ac 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -457,19 +457,28 @@ static int do_ip_setsockopt(struct sock *sk, int level, struct inet_sock *inet = inet_sk(sk); int val = 0, err; - if (((1<= sizeof(int)) { if (get_user(val, (int __user *) optval)) return -EFAULT;