atm: iphase: Avoid copying pointers to user space.
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 15 May 2019 00:42:48 +0000 (08:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 May 2019 19:08:28 +0000 (12:08 -0700)
Remove the MEMDUMP_DEV case in ia_ioctl to avoid copy
pointers to user space.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/atm/iphase.c

index 5278c57dce739f9666ba684191d7c5717be7cd89..302cf0ba16008740d8f0ecd231b6f27c73f0f97e 100644 (file)
@@ -2767,12 +2767,6 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
    case MEMDUMP:
    {
        switch (ia_cmds.sub_cmd) {
-                 case MEMDUMP_DEV:     
-            if (!capable(CAP_NET_ADMIN)) return -EPERM;
-            if (copy_to_user(ia_cmds.buf, iadev, sizeof(IADEV)))
-                return -EFAULT;
-             ia_cmds.status = 0;
-             break;
           case MEMDUMP_SEGREG:
             if (!capable(CAP_NET_ADMIN)) return -EPERM;
              tmps = (u16 __user *)ia_cmds.buf;