mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
kcm: return immediately after copy_from_user() failure
[ Upstream commita80db69e47] There is no reason to continue after a copy_from_user() failure. Fixes:ab7ac4eb98("kcm: Kernel Connection Multiplexor module") Cc: Tom Herbert <tom@herbertland.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c63d618007
commit
d60d4e8c1b
@@ -1685,7 +1685,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
struct kcm_attach info;
|
||||
|
||||
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
||||
err = -EFAULT;
|
||||
return -EFAULT;
|
||||
|
||||
err = kcm_attach_ioctl(sock, &info);
|
||||
|
||||
@@ -1695,7 +1695,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
struct kcm_unattach info;
|
||||
|
||||
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
||||
err = -EFAULT;
|
||||
return -EFAULT;
|
||||
|
||||
err = kcm_unattach_ioctl(sock, &info);
|
||||
|
||||
@@ -1706,7 +1706,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
struct socket *newsock = NULL;
|
||||
|
||||
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
||||
err = -EFAULT;
|
||||
return -EFAULT;
|
||||
|
||||
err = kcm_clone(sock, &info, &newsock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user