diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-10 23:53:35 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-21 02:31:35 +0200 |
commit | 8cacb4165985444c275a6f813f91f08479bdbfad (patch) | |
tree | 00cd065ec52d8e90081edbef1fa7380557eea0e3 /net/atm/ioctl.c | |
parent | atm: switch do_atm_iobuf() to direct use of atm_getnames() (diff) | |
download | linux-8cacb4165985444c275a6f813f91f08479bdbfad.tar.xz linux-8cacb4165985444c275a6f813f91f08479bdbfad.zip |
atm: lift copyin from atm_dev_ioctl()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/atm/ioctl.c')
-rw-r--r-- | net/atm/ioctl.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c index fdd0e3434523..52f2c77e656f 100644 --- a/net/atm/ioctl.c +++ b/net/atm/ioctl.c @@ -182,7 +182,30 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd, } error = atm_getnames(buf, len); } else { - error = atm_dev_ioctl(cmd, argp, compat); + int number; + + if (IS_ENABLED(CONFIG_COMPAT) && compat) { +#ifdef CONFIG_COMPAT + struct compat_atmif_sioc __user *csioc = argp; + compat_uptr_t carg; + + len = &csioc->length; + if (get_user(carg, &csioc->arg)) + return -EFAULT; + buf = compat_ptr(carg); + if (get_user(number, &csioc->number)) + return -EFAULT; +#endif + } else { + struct atmif_sioc __user *sioc = argp; + + len = &sioc->length; + if (get_user(buf, &sioc->arg)) + return -EFAULT; + if (get_user(number, &sioc->number)) + return -EFAULT; + } + error = atm_dev_ioctl(cmd, buf, len, number, compat); } done: |