X25 remove bkl from calluserdata ioctls
authorandrew hendry <andrew.hendry@gmail.com>
Thu, 25 Nov 2010 02:18:40 +0000 (02:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Nov 2010 19:12:21 +0000 (11:12 -0800)
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/x25/af_x25.c

index 2518efae8ec94645314c2af15a4850a27438d7a6..e2eea0aec466fa2d17c70db8fdfcddd9962d1a4d 100644 (file)
@@ -1512,11 +1512,11 @@ out_dtefac_release:
                }
 
                case SIOCX25GCALLUSERDATA: {
-                       struct x25_calluserdata cud = x25->calluserdata;
-                       lock_kernel();
-                       rc = copy_to_user(argp, &cud,
-                                         sizeof(cud)) ? -EFAULT : 0;
-                       unlock_kernel();
+                       lock_sock(sk);
+                       rc = copy_to_user(argp, &x25->calluserdata,
+                                       sizeof(x25->calluserdata))
+                                       ? -EFAULT : 0;
+                       release_sock(sk);
                        break;
                }
 
@@ -1524,15 +1524,15 @@ out_dtefac_release:
                        struct x25_calluserdata calluserdata;
 
                        rc = -EFAULT;
-                       lock_kernel();
                        if (copy_from_user(&calluserdata, argp,
                                           sizeof(calluserdata)))
                                break;
                        rc = -EINVAL;
                        if (calluserdata.cudlength > X25_MAX_CUD_LEN)
                                break;
+                       lock_sock(sk);
                        x25->calluserdata = calluserdata;
-                       unlock_kernel();
+                       release_sock(sk);
                        rc = 0;
                        break;
                }