Ubuntu-focal-kernel/drivers/hid
Rahul Rameshbabu 4919297c3f HID: multitouch: Correct devm device reference for hidinput input_dev name
BugLink: https://bugs.launchpad.net/bugs/2040284

[ Upstream commit 4794394635293a3e74591351fff469cea7ad15a2 ]

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>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2023-10-30 11:42:15 +01:00
..
i2c-hid HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports 2022-05-20 15:18:54 +02:00
intel-ish-hid HID: intel_ish-hid: Add check for ishtp_dma_tx_map 2023-03-21 10:08:57 +01:00
usbhid HID: usbhid: free raw_report buffers in usbhid_stop 2021-11-05 09:12:51 +01:00
Kconfig HID: asus: Add depends on USB_HID to HID_ASUS Kconfig option 2022-03-07 16:34:38 +01:00
Makefile
hid-a4tech.c
hid-accutouch.c
hid-alps.c HID: alps: Declare U1_UNICORN_LEGACY support 2022-10-17 15:01:05 +02:00
hid-apple.c HID: apple: Do not reset quirks when the Fn key is not found 2022-03-07 16:36:09 +01:00
hid-appleir.c
hid-asus.c HID: asus: Fix mute and touchpad-toggle keys on Medion Akoya E1239T 2023-05-12 17:15:04 +02:00
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-betopff.c HID: betop: check shape of output reports 2023-03-21 10:08:58 +01:00
hid-bigbenff.c hid: bigben_probe(): validate report count 2023-05-12 17:15:04 +02:00
hid-cherry.c
hid-chicony.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-cmedia.c
hid-core.c HID: core: Provide new max_buffer_size attribute to over-ride the default 2023-07-10 17:21:44 +02:00
hid-corsair.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-cougar.c
hid-cp2112.c HID: cp2112: prevent a buffer overflow in cp2112_xfer() 2022-10-17 15:00:55 +02:00
hid-creative-sb0540.c
hid-cypress.c HID: cypress: Support Varmilo Keyboards' media hotkeys 2021-01-20 14:24:36 +01:00
hid-debug.c HID: Add Mapping for System Microphone Mute 2023-05-12 17:15:07 +02:00
hid-dr.c
hid-elan.c HID: elan: Fix potential double free in elan_input_configured 2022-08-26 11:07:41 +02:00
hid-elecom.c
hid-elo.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-emsff.c
hid-ezkey.c
hid-gaff.c
hid-gembird.c
hid-generic.c
hid-gfrm.c
hid-google-hammer.c HID: google: add jewel USB id 2023-08-09 12:25:40 +02:00
hid-gt683r.c HID: gt683r: add missing MODULE_DEVICE_TABLE 2021-07-15 19:27:28 +02:00
hid-gyration.c
hid-holtek-kbd.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-holtek-mouse.c HID: holtek: fix mouse probing 2022-02-03 18:58:15 +01:00
hid-holtekff.c
hid-hyperv.c HID: hyperv: fix possible memory leak in mousevsc_probe() 2023-02-01 15:20:55 +01:00
hid-icade.c
hid-ids.h HID: add quirk for 03f0:464a HP Elite Presenter Mouse 2023-10-30 11:41:55 +01:00
hid-input.c HID: Add Mapping for System Microphone Mute 2023-05-12 17:15:07 +02:00
hid-ite.c HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10 2023-02-01 15:22:05 +01:00
hid-jabra.c
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-led.c HID: hid-led: fix maximum brightness for Dream Cheeky 2022-08-26 11:07:40 +02:00
hid-lenovo.c
hid-lg.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c HID: hid-lg4ff: Add check for empty lbuf 2023-02-01 15:21:53 +01:00
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-10-30 11:42:15 +01:00
hid-logitech-hidpp.c HID: logitech-hidpp: Reconcile USB and Unifying serials 2023-08-09 12:25:29 +02:00
hid-macally.c
hid-magicmouse.c HID: magicmouse: Do not set BTN_MOUSE on double report 2023-01-06 08:44:09 -08:00
hid-maltron.c
hid-mf.c HID: mf: add support for 0079:1846 Mayflash/Dragonrise USB Gamecube Adapter 2021-04-14 18:31:50 +02:00
hid-microsoft.c HID: microsoft: Add rumble support for the 8bitdo SN30 Pro+ controller 2020-11-09 14:46:43 +01:00
hid-monterey.c
hid-multitouch.c HID: multitouch: Correct devm device reference for hidinput input_dev name 2023-10-30 11:42:15 +01: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: plantronics: Additional PIDs for double volume key presses quirk 2023-02-01 15:23:19 +01:00
hid-primax.c
hid-prodikeys.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-quirks.c HID: add quirk for 03f0:464a HP Elite Presenter Mouse 2023-10-30 11:41:55 +01:00
hid-redragon.c
hid-retrode.c
hid-rmi.c
hid-roccat-arvo.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h
hid-roccat-isku.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-isku.h
hid-roccat-kone.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-kone.h
hid-roccat-koneplus.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-koneplus.h
hid-roccat-konepure.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-kovaplus.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-kovaplus.h
hid-roccat-lua.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-lua.h
hid-roccat-pyra.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-pyra.h
hid-roccat-ryos.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-savu.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-roccat-savu.h
hid-roccat.c HID: roccat: Fix use-after-free in roccat_read() 2023-01-06 08:44:05 -08:00
hid-saitek.c HID: saitek: add madcatz variant of MMO7 mouse device ID 2023-01-06 08:44:43 -08:00
hid-samsung.c HID: check for valid USB device for many HID drivers 2022-02-03 18:57:43 +01:00
hid-sensor-custom.c HID: hid-sensor-custom: set fixed size for custom attributes 2023-02-01 15:22:28 +01:00
hid-sensor-hub.c HID: hid-sensor-hub: Return error for hid_set_field() failure 2021-07-15 19:27:27 +02:00
hid-sjoy.c
hid-sony.c HID: sony: Workaround for DS4 dongle hotplug kernel crash. 2021-08-13 09:47:06 +02:00
hid-speedlink.c
hid-steam.c HID: steam: Prevent NULL pointer dereference in steam_{recv,send}_report 2022-10-17 15:02:22 +02:00
hid-steelseries.c
hid-sunplus.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-u2fzero.c HID: add hid_is_usb() function to make it simpler for USB detection 2022-02-03 18:57:41 +01:00
hid-uclogic-core.c HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk 2023-02-01 15:22:06 +01:00
hid-uclogic-params.c HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad 2022-03-07 16:35:52 +01:00
hid-uclogic-params.h
hid-uclogic-rdesc.c
hid-uclogic-rdesc.h
hid-udraw-ps3.c
hid-viewsonic.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 HID: hidraw: fix memory leak in hidraw_release() 2022-10-17 15:02:23 +02:00
uhid.c HID: uhid: Over-ride the default maximum data buffer value with our own 2023-07-10 17:21:44 +02:00
wacom.h HID: wacom: remove the battery when the EKR is off 2023-10-30 11:42:05 +01:00
wacom_sys.c HID: wacom: remove the battery when the EKR is off 2023-10-30 11:42:05 +01:00
wacom_wac.c HID: wacom: remove the battery when the EKR is off 2023-10-30 11:42:05 +01:00
wacom_wac.h HID: wacom: remove the battery when the EKR is off 2023-10-30 11:42:05 +01:00