Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/smc: add error handling for get_user()

For security reasons the return code of get_user() should always be
checked.

Fixes: 01d2f7e2cdd31 ("net/smc: sockopts TCP_NODELAY and TCP_CORK")
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ursula Braun and committed by
David S. Miller
ac0107ed 99be51f1

+2 -1
+2 -1
net/smc/af_smc.c
··· 1456 1456 1457 1457 if (optlen < sizeof(int)) 1458 1458 return -EINVAL; 1459 - get_user(val, (int __user *)optval); 1459 + if (get_user(val, (int __user *)optval)) 1460 + return -EFAULT; 1460 1461 1461 1462 lock_sock(sk); 1462 1463 switch (optname) {