Commit 55c0dd8a authored by Fuqian Huang's avatar Fuqian Huang Committed by David S. Miller
Browse files

atm: iphase: Avoid copying pointers to user space.



Remove the MEMDUMP_DEV case in ia_ioctl to avoid copy
pointers to user space.

Signed-off-by: default avatarFuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fecf0a1
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -2767,12 +2767,6 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
   case MEMDUMP:
   case MEMDUMP:
   {
   {
	switch (ia_cmds.sub_cmd) {
	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:
          case MEMDUMP_SEGREG:
	     if (!capable(CAP_NET_ADMIN)) return -EPERM;
	     if (!capable(CAP_NET_ADMIN)) return -EPERM;
             tmps = (u16 __user *)ia_cmds.buf;
             tmps = (u16 __user *)ia_cmds.buf;