Commit 5b7958df authored by andrew hendry's avatar andrew hendry Committed by David S. Miller

X25 remove bkl from calluserdata ioctls

Signed-off-by: default avatarAndrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f90de660
...@@ -1512,11 +1512,11 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1512,11 +1512,11 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} }
case SIOCX25GCALLUSERDATA: { case SIOCX25GCALLUSERDATA: {
struct x25_calluserdata cud = x25->calluserdata; lock_sock(sk);
lock_kernel(); rc = copy_to_user(argp, &x25->calluserdata,
rc = copy_to_user(argp, &cud, sizeof(x25->calluserdata))
sizeof(cud)) ? -EFAULT : 0; ? -EFAULT : 0;
unlock_kernel(); release_sock(sk);
break; break;
} }
...@@ -1524,15 +1524,15 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1524,15 +1524,15 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct x25_calluserdata calluserdata; struct x25_calluserdata calluserdata;
rc = -EFAULT; rc = -EFAULT;
lock_kernel();
if (copy_from_user(&calluserdata, argp, if (copy_from_user(&calluserdata, argp,
sizeof(calluserdata))) sizeof(calluserdata)))
break; break;
rc = -EINVAL; rc = -EINVAL;
if (calluserdata.cudlength > X25_MAX_CUD_LEN) if (calluserdata.cudlength > X25_MAX_CUD_LEN)
break; break;
lock_sock(sk);
x25->calluserdata = calluserdata; x25->calluserdata = calluserdata;
unlock_kernel(); release_sock(sk);
rc = 0; rc = 0;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment