android_kernel_samsung_msm8226/drivers/hid
Alan Stern f9cc3d1366 HID: Fix assumption that devices have inputs
commit d9d4b1e46d9543a82c23f6df03f4ad697dab361b upstream.

The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
driver.  The problem is caused by the driver's assumption that the
device must have an input report.  While this will be true for all
normal HID input devices, a suitably malicious device can violate the
assumption.

The same assumption is present in over a dozen other HID drivers.
This patch fixes them by checking that the list of hid_inputs for the
hid_device is nonempty before allowing it to be used.

Reported-and-tested-by: syzbot+403741a091bf41d4ae79@syzkaller.appspotmail.com
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
[bwh: Backported to 3.16:
 - Drop changes in hid-logitech-hidpp, hid-microsoft
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[haggertk: Backported to android/3.4:
 - Drop changes to hid-sony, add changes to hid-pidff]
CVE-2019-19532
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Change-Id: Icfe325236f0c40aa0c3ca638e903179b3935ad1e
2020-05-12 21:47:27 +02:00
..
usbhid HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
Kconfig HID: Fix the generic Kconfig options 2020-01-06 08:40:29 +01:00
Makefile HID: Create a common generic driver 2020-01-06 08:40:29 +01:00
hid-a4tech.c
hid-apple.c
hid-axff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-belkin.c
hid-cherry.c
hid-chicony.c
hid-core.c HID: explain the signed/unsigned handling in hid_add_field() 2020-01-06 08:40:29 +01:00
hid-cypress.c
hid-debug.c ANDROID: HID: debug: check length in hid_debug_events_read() before copy_to_user() 2020-01-06 08:40:28 +01:00
hid-dr.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-elecom.c
hid-emsff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-ezkey.c
hid-gaff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-generic.c HID: Create a common generic driver 2020-01-06 08:40:29 +01:00
hid-gyration.c
hid-holtekff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-hyperv.c
hid-ids.h
hid-input.c HID: hid-multitouch: Switch to device groups 2020-01-06 08:40:29 +01:00
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-lg.c
hid-lg.h
hid-lg2ff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-lg3ff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-lg4ff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-lgff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-logitech-dj.c
hid-logitech-dj.h
hid-magicmouse.c
hid-microsoft.c
hid-monterey.c
hid-multitouch.c HID: multitouch: MT interface matching for Baanto 2020-01-06 08:40:29 +01:00
hid-ntrig.c
hid-ortek.c
hid-ovr.c
hid-petalynx.c
hid-picolcd.c
hid-pl.c
hid-primax.c
hid-prodikeys.c
hid-roccat-arvo.c
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h
hid-roccat-isku.c
hid-roccat-isku.h
hid-roccat-kone.c
hid-roccat-kone.h
hid-roccat-koneplus.c
hid-roccat-koneplus.h
hid-roccat-kovaplus.c
hid-roccat-kovaplus.h
hid-roccat-pyra.c
hid-roccat-pyra.h
hid-roccat.c
hid-saitek.c
hid-samsung.c misc: fix some GCC warnings 2020-01-06 08:40:46 +01:00
hid-sjoy.c
hid-sony.c
hid-speedlink.c
hid-sunplus.c
hid-synaptics-bt.c
hid-tivo.c
hid-tmff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-topseed.c
hid-twinhan.c
hid-uclogic.c
hid-wacom.c
hid-waltop.c
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-ext.c
hid-wiimote.h
hid-zagg.c misc: fix some GCC warnings 2020-01-06 08:40:46 +01:00
hid-zpff.c HID: Fix assumption that devices have inputs 2020-05-12 21:47:27 +02:00
hid-zydacron.c
hidraw.c
uhid.c