diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-06-03 21:44:11 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-06-04 13:57:24 -0400 |
commit | 31acd2665b8f45548e1acfb9131657646333f91c (patch) | |
tree | 3050136ab3991dd74e0544a29dca176e5ef4a24c | |
parent | ae2a9762d6f54331f683464f07498cf66e7c125c (diff) |
isdn: get rid of pointless access_ok()
copy_to_user()/copy_from_user()/get_user() check themselves
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 18 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_ppp.c | 6 | ||||
-rw-r--r-- | drivers/isdn/isdnloop/isdnloop.c | 2 |
3 files changed, 0 insertions, 26 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 9b856e1890d1..89b09c51ab7c 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
@@ -1304,9 +1304,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) | |||
1304 | if (arg) { | 1304 | if (arg) { |
1305 | ulong __user *p = argp; | 1305 | ulong __user *p = argp; |
1306 | int i; | 1306 | int i; |
1307 | if (!access_ok(VERIFY_WRITE, p, | ||
1308 | sizeof(ulong) * ISDN_MAX_CHANNELS * 2)) | ||
1309 | return -EFAULT; | ||
1310 | for (i = 0; i < ISDN_MAX_CHANNELS; i++) { | 1307 | for (i = 0; i < ISDN_MAX_CHANNELS; i++) { |
1311 | put_user(dev->ibytes[i], p++); | 1308 | put_user(dev->ibytes[i], p++); |
1312 | put_user(dev->obytes[i], p++); | 1309 | put_user(dev->obytes[i], p++); |
@@ -1540,11 +1537,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) | |||
1540 | char __user *p = argp; | 1537 | char __user *p = argp; |
1541 | int i; | 1538 | int i; |
1542 | 1539 | ||
1543 | if (!access_ok(VERIFY_WRITE, argp, | ||
1544 | (ISDN_MODEM_NUMREG + ISDN_MSNLEN + ISDN_LMSNLEN) | ||
1545 | * ISDN_MAX_CHANNELS)) | ||
1546 | return -EFAULT; | ||
1547 | |||
1548 | for (i = 0; i < ISDN_MAX_CHANNELS; i++) { | 1540 | for (i = 0; i < ISDN_MAX_CHANNELS; i++) { |
1549 | if (copy_to_user(p, dev->mdm.info[i].emu.profile, | 1541 | if (copy_to_user(p, dev->mdm.info[i].emu.profile, |
1550 | ISDN_MODEM_NUMREG)) | 1542 | ISDN_MODEM_NUMREG)) |
@@ -1567,11 +1559,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) | |||
1567 | char __user *p = argp; | 1559 | char __user *p = argp; |
1568 | int i; | 1560 | int i; |
1569 | 1561 | ||
1570 | if (!access_ok(VERIFY_READ, argp, | ||
1571 | (ISDN_MODEM_NUMREG + ISDN_MSNLEN + ISDN_LMSNLEN) | ||
1572 | * ISDN_MAX_CHANNELS)) | ||
1573 | return -EFAULT; | ||
1574 | |||
1575 | for (i = 0; i < ISDN_MAX_CHANNELS; i++) { | 1562 | for (i = 0; i < ISDN_MAX_CHANNELS; i++) { |
1576 | if (copy_from_user(dev->mdm.info[i].emu.profile, p, | 1563 | if (copy_from_user(dev->mdm.info[i].emu.profile, p, |
1577 | ISDN_MODEM_NUMREG)) | 1564 | ISDN_MODEM_NUMREG)) |
@@ -1617,8 +1604,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) | |||
1617 | int j = 0; | 1604 | int j = 0; |
1618 | 1605 | ||
1619 | while (1) { | 1606 | while (1) { |
1620 | if (!access_ok(VERIFY_READ, p, 1)) | ||
1621 | return -EFAULT; | ||
1622 | get_user(bname[j], p++); | 1607 | get_user(bname[j], p++); |
1623 | switch (bname[j]) { | 1608 | switch (bname[j]) { |
1624 | case '\0': | 1609 | case '\0': |
@@ -1685,9 +1670,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) | |||
1685 | drvidx = 0; | 1670 | drvidx = 0; |
1686 | if (drvidx == -1) | 1671 | if (drvidx == -1) |
1687 | return -ENODEV; | 1672 | return -ENODEV; |
1688 | if (!access_ok(VERIFY_WRITE, argp, | ||
1689 | sizeof(isdn_ioctl_struct))) | ||
1690 | return -EFAULT; | ||
1691 | c.driver = drvidx; | 1673 | c.driver = drvidx; |
1692 | c.command = ISDN_CMD_IOCTL; | 1674 | c.command = ISDN_CMD_IOCTL; |
1693 | c.arg = cmd; | 1675 | c.arg = cmd; |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index d07dd5196ffc..487478bafaf5 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -795,9 +795,6 @@ isdn_ppp_read(int min, struct file *file, char __user *buf, int count) | |||
795 | if (!(is->state & IPPP_OPEN)) | 795 | if (!(is->state & IPPP_OPEN)) |
796 | return 0; | 796 | return 0; |
797 | 797 | ||
798 | if (!access_ok(VERIFY_WRITE, buf, count)) | ||
799 | return -EFAULT; | ||
800 | |||
801 | spin_lock_irqsave(&is->buflock, flags); | 798 | spin_lock_irqsave(&is->buflock, flags); |
802 | b = is->first->next; | 799 | b = is->first->next; |
803 | save_buf = b->buf; | 800 | save_buf = b->buf; |
@@ -2014,9 +2011,6 @@ isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev) | |||
2014 | struct ppp_stats t; | 2011 | struct ppp_stats t; |
2015 | isdn_net_local *lp = netdev_priv(dev); | 2012 | isdn_net_local *lp = netdev_priv(dev); |
2016 | 2013 | ||
2017 | if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats))) | ||
2018 | return -EFAULT; | ||
2019 | |||
2020 | /* build a temporary stat struct and copy it to user space */ | 2014 | /* build a temporary stat struct and copy it to user space */ |
2021 | 2015 | ||
2022 | memset(&t, 0, sizeof(struct ppp_stats)); | 2016 | memset(&t, 0, sizeof(struct ppp_stats)); |
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index ef9c8e4f1fa2..32cb0cbd7217 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c | |||
@@ -1142,8 +1142,6 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card) | |||
1142 | case ISDNLOOP_IOCTL_DEBUGVAR: | 1142 | case ISDNLOOP_IOCTL_DEBUGVAR: |
1143 | return (ulong) card; | 1143 | return (ulong) card; |
1144 | case ISDNLOOP_IOCTL_STARTUP: | 1144 | case ISDNLOOP_IOCTL_STARTUP: |
1145 | if (!access_ok(VERIFY_READ, (void *) a, sizeof(isdnloop_sdef))) | ||
1146 | return -EFAULT; | ||
1147 | return isdnloop_start(card, (isdnloop_sdef *) a); | 1145 | return isdnloop_start(card, (isdnloop_sdef *) a); |
1148 | break; | 1146 | break; |
1149 | case ISDNLOOP_IOCTL_ADDCARD: | 1147 | case ISDNLOOP_IOCTL_ADDCARD: |