aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/i4l/isdn_common.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-08-15 15:14:05 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-16 15:26:24 -0400
commit5e22002aa8809e2efab2da95855f73f63e14a36c (patch)
tree24061c231a0719289e9613c3654132faafbf54b1 /drivers/isdn/i4l/isdn_common.c
parent45316818371d1fb3ecbffa4d4a2d0550e1822e92 (diff)
isdn: Disable IIOCDBGVAR
It was possible to directly leak the kernel address where the isdn_dev structure pointer was stored. This is a kernel ASLR bypass for anyone with access to the ioctl. The code had been present since the beginning of git history, though this shouldn't ever be needed for normal operation, therefore remove it. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/i4l/isdn_common.c')
-rw-r--r--drivers/isdn/i4l/isdn_common.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 7a501dbe7123..6a5b3f00f9ad 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1640,13 +1640,7 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
1640 } else 1640 } else
1641 return -EINVAL; 1641 return -EINVAL;
1642 case IIOCDBGVAR: 1642 case IIOCDBGVAR:
1643 if (arg) { 1643 return -EINVAL;
1644 if (copy_to_user(argp, &dev, sizeof(ulong)))
1645 return -EFAULT;
1646 return 0;
1647 } else
1648 return -EINVAL;
1649 break;
1650 default: 1644 default:
1651 if ((cmd & IIOCDRVCTL) == IIOCDRVCTL) 1645 if ((cmd & IIOCDRVCTL) == IIOCDRVCTL)
1652 cmd = ((cmd >> _IOC_NRSHIFT) & _IOC_NRMASK) & ISDN_DRVIOCTL_MASK; 1646 cmd = ((cmd >> _IOC_NRSHIFT) & _IOC_NRMASK) & ISDN_DRVIOCTL_MASK;