Commit 33299257 authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Stefan Bader

Input: uinput - add compat ioctl number translation for UI_*_FF_UPLOAD

BugLink: https://bugs.launchpad.net/bugs/1836668

commit 7c7da40d upstream.

In the case of compat syscall ioctl numbers for UI_BEGIN_FF_UPLOAD and
UI_END_FF_UPLOAD need to be adjusted before being passed on
uinput_ioctl_handler() since code built with -m32 will be passing
slightly different values. Extend the code already covering
UI_SET_PHYS to cover UI_BEGIN_FF_UPLOAD and UI_END_FF_UPLOAD as well.
Reported-by: default avatarPierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 227daaef
...@@ -894,13 +894,31 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -894,13 +894,31 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t) /*
* These IOCTLs change their size and thus their numbers between
* 32 and 64 bits.
*/
#define UI_SET_PHYS_COMPAT \
_IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
#define UI_BEGIN_FF_UPLOAD_COMPAT \
_IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload_compat)
#define UI_END_FF_UPLOAD_COMPAT \
_IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload_compat)
static long uinput_compat_ioctl(struct file *file, static long uinput_compat_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
if (cmd == UI_SET_PHYS_COMPAT) switch (cmd) {
case UI_SET_PHYS_COMPAT:
cmd = UI_SET_PHYS; cmd = UI_SET_PHYS;
break;
case UI_BEGIN_FF_UPLOAD_COMPAT:
cmd = UI_BEGIN_FF_UPLOAD;
break;
case UI_END_FF_UPLOAD_COMPAT:
cmd = UI_END_FF_UPLOAD;
break;
}
return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg)); return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment