drivers/hid/uhid.c: check write() bitness using in_compat_syscall
authorAndy Lutomirski <luto@kernel.org>
Tue, 22 Mar 2016 21:25:24 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2016 22:36:02 +0000 (15:36 -0700)
uhid changes the format expected in write() depending on bitness.  It
should check the syscall bitness directly.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/hid/uhid.c

index e094c572b86e61ff5b4108a29ef78340114d018e..16b6f11a07001c7831a987e6bd891b7d00868f65 100644 (file)
@@ -384,7 +384,7 @@ struct uhid_create_req_compat {
 static int uhid_event_from_user(const char __user *buffer, size_t len,
                                struct uhid_event *event)
 {
-       if (is_compat_task()) {
+       if (in_compat_syscall()) {
                u32 type;
 
                if (get_user(type, buffer))