提交 a80db69e 编写于 作者: W WANG Cong 提交者: David S. Miller

kcm: return immediately after copy_from_user() failure

There is no reason to continue after a copy_from_user()
failure.

Fixes: ab7ac4eb ("kcm: Kernel Connection Multiplexor module")
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a5af8392
......@@ -1687,7 +1687,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);
......@@ -1697,7 +1697,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);
......@@ -1708,7 +1708,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册