mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
kcm: return immediately after copy_from_user() failure
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>
This commit is contained in:
parent
a5af839253
commit
a80db69e47
1 changed files with 3 additions and 3 deletions
|
@ -1687,7 +1687,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||||
struct kcm_attach info;
|
struct kcm_attach info;
|
||||||
|
|
||||||
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
||||||
err = -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
err = kcm_attach_ioctl(sock, &info);
|
err = kcm_attach_ioctl(sock, &info);
|
||||||
|
|
||||||
|
@ -1697,7 +1697,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||||
struct kcm_unattach info;
|
struct kcm_unattach info;
|
||||||
|
|
||||||
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
||||||
err = -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
err = kcm_unattach_ioctl(sock, &info);
|
err = kcm_unattach_ioctl(sock, &info);
|
||||||
|
|
||||||
|
@ -1708,7 +1708,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||||
struct socket *newsock = NULL;
|
struct socket *newsock = NULL;
|
||||||
|
|
||||||
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
|
||||||
err = -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
err = kcm_clone(sock, &info, &newsock);
|
err = kcm_clone(sock, &info, &newsock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue