Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac0107ed authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

net/smc: add error handling for get_user()



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

Fixes: 01d2f7e2 ("net/smc: sockopts TCP_NODELAY and TCP_CORK")
Reported-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99be51f1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1456,7 +1456,8 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,

	if (optlen < sizeof(int))
		return -EINVAL;
	get_user(val, (int __user *)optval);
	if (get_user(val, (int __user *)optval))
		return -EFAULT;

	lock_sock(sk);
	switch (optname) {