WSL2-Linux-Kernel/drivers/hid
Rahul Rameshbabu dde88ab4e4 HID: multitouch: Correct devm device reference for hidinput input_dev name
[ Upstream commit 4794394635 ]

Reference the HID device rather than the input device for the devm
allocation of the input_dev name. Referencing the input_dev would lead to a
use-after-free when the input_dev was unregistered and subsequently fires a
uevent that depends on the name. At the point of firing the uevent, the
name would be freed by devres management.

Use devm_kasprintf to simplify the logic for allocating memory and
formatting the input_dev name string.

Reported-by: Maxime Ripard <mripard@kernel.org>
Closes: https://lore.kernel.org/linux-input/ZOZIZCND+L0P1wJc@penguin/T/#m443f3dce92520f74b6cf6ffa8653f9c92643d4ae
Fixes: c08d46aa80 ("HID: multitouch: devm conversion")
Suggested-by: Maxime Ripard <mripard@kernel.org>
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20230824061308.222021-3-sergeantsagara@protonmail.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:22:48 +02:00
..
amd-sfh-hid HID: amd_sfh: Add support for shutdown operation 2023-05-11 23:00:33 +09:00
i2c-hid
intel-ish-hid HID: intel-ish-hid: ipc: Fix potential use-after-free in work function 2023-03-30 12:47:53 +02:00
surface-hid
usbhid
Kconfig
Makefile
hid-a4tech.c
hid-accutouch.c
hid-alps.c
hid-apple.c
hid-appleir.c
hid-asus.c
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-betopff.c
hid-bigbenff.c hid: bigben_probe(): validate report count 2023-03-10 09:39:31 +01:00
hid-cherry.c
hid-chicony.c
hid-cmedia.c
hid-core.c HID: core: Provide new max_buffer_size attribute to over-ride the default 2023-03-22 13:31:37 +01:00
hid-corsair.c
hid-cougar.c
hid-cp2112.c HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded 2023-03-30 12:47:53 +02:00
hid-creative-sb0540.c
hid-cypress.c
hid-debug.c HID: Add Mapping for System Microphone Mute 2023-03-10 09:39:52 +01:00
hid-dr.c
hid-elan.c
hid-elecom.c
hid-elo.c
hid-emsff.c
hid-ezkey.c
hid-ft260.c
hid-gaff.c
hid-gembird.c
hid-generic.c
hid-gfrm.c
hid-glorious.c
hid-google-hammer.c HID: google: add jewel USB id 2023-06-09 10:32:27 +02:00
hid-gt683r.c
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c
hid-hyperv.c
hid-icade.c
hid-ids.h HID: add quirk for 03f0:464a HP Elite Presenter Mouse 2023-08-26 14:23:23 +02:00
hid-input.c HID: Add Mapping for System Microphone Mute 2023-03-10 09:39:52 +01:00
hid-ite.c
hid-jabra.c
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-led.c
hid-lenovo.c
hid-lg-g15.c
hid-lg.c
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c
hid-lg4ff.h
hid-lgff.c
hid-logitech-dj.c HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode() 2023-09-19 12:22:48 +02:00
hid-logitech-hidpp.c HID: logitech-hidpp: Add USB and Bluetooth IDs for the Logitech G915 TKL Keyboard 2023-08-26 14:23:23 +02:00
hid-macally.c
hid-magicmouse.c
hid-maltron.c
hid-mcp2221.c
hid-mf.c
hid-microsoft.c
hid-monterey.c
hid-multitouch.c HID: multitouch: Correct devm device reference for hidinput input_dev name 2023-09-19 12:22:48 +02:00
hid-nti.c
hid-ntrig.c
hid-ortek.c
hid-penmount.c
hid-petalynx.c
hid-picolcd.h
hid-picolcd_backlight.c
hid-picolcd_cir.c
hid-picolcd_core.c
hid-picolcd_debugfs.c
hid-picolcd_fb.c
hid-picolcd_lcd.c
hid-picolcd_leds.c
hid-pl.c
hid-plantronics.c
hid-playstation.c
hid-primax.c
hid-prodikeys.c
hid-quirks.c HID: add quirk for 03f0:464a HP Elite Presenter Mouse 2023-08-26 14:23:23 +02:00
hid-redragon.c
hid-retrode.c
hid-rmi.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-konepure.c
hid-roccat-kovaplus.c
hid-roccat-kovaplus.h
hid-roccat-lua.c
hid-roccat-lua.h
hid-roccat-pyra.c
hid-roccat-pyra.h
hid-roccat-ryos.c
hid-roccat-savu.c
hid-roccat-savu.h
hid-roccat.c
hid-saitek.c
hid-samsung.c
hid-semitek.c
hid-sensor-custom.c
hid-sensor-hub.c
hid-sjoy.c
hid-sony.c
hid-speedlink.c
hid-steam.c
hid-steelseries.c
hid-sunplus.c
hid-thrustmaster.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-u2fzero.c
hid-uclogic-core.c
hid-uclogic-params.c
hid-uclogic-params.h
hid-uclogic-rdesc.c
hid-uclogic-rdesc.h
hid-udraw-ps3.c
hid-viewsonic.c
hid-vivaldi.c
hid-waltop.c
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-modules.c
hid-wiimote.h
hid-xinmo.c
hid-zpff.c
hid-zydacron.c
hidraw.c
uhid.c HID: uhid: Over-ride the default maximum data buffer value with our own 2023-03-22 13:31:37 +01:00
wacom.h HID: wacom: remove the battery when the EKR is off 2023-09-06 21:28:38 +01:00
wacom_sys.c HID: wacom: remove the battery when the EKR is off 2023-09-06 21:28:38 +01:00
wacom_wac.c HID: wacom: remove the battery when the EKR is off 2023-09-06 21:28:38 +01:00
wacom_wac.h HID: wacom: remove the battery when the EKR is off 2023-09-06 21:28:38 +01:00