Skip to content

Commit affa80b

Browse files
Ricky Liangdtor
authored andcommitted
Input: uinput - handle compat ioctl for UI_SET_PHYS
When running a 32-bit userspace on a 64-bit kernel, the UI_SET_PHYS ioctl needs to be treated with special care, as it has the pointer size encoded in the command. Signed-off-by: Ricky Liang <jcliang@chromium.org> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 23ea596 commit affa80b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎drivers/input/misc/uinput.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,15 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
981981
}
982982

983983
#ifdef CONFIG_COMPAT
984+
985+
#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
986+
984987
static long uinput_compat_ioctl(struct file *file,
985988
unsigned int cmd, unsigned long arg)
986989
{
990+
if (cmd == UI_SET_PHYS_COMPAT)
991+
cmd = UI_SET_PHYS;
992+
987993
return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
988994
}
989995
#endif

0 commit comments

Comments
 (0)