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

Commit d60d4e8c authored by WANG Cong's avatar WANG Cong Committed by Greg Kroah-Hartman
Browse files

kcm: return immediately after copy_from_user() failure



[ Upstream commit a80db69e47d764bbcaf2fec54b1f308925e7c490 ]

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: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c63d6180
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);