atm: lift copyin from atm_dev_ioctl()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user