acrn-kernel/drivers/hid
Tanu Malhotra 6c8cc40c58 HID: intel-ish-hid: Fix kernel panic during warm reset
commit 38518593ec upstream.

During warm reset device->fw_client is set to NULL. If a bus driver is
registered after this NULL setting and before new firmware clients are
enumerated by ISHTP, kernel panic will result in the function
ishtp_cl_bus_match(). This is because of reference to
device->fw_client->props.protocol_name.

ISH firmware after getting successfully loaded, sends a warm reset
notification to remove all clients from the bus and sets
device->fw_client to NULL. Until kernel v5.15, all enabled ISHTP kernel
module drivers were loaded right after any of the first ISHTP device was
registered, regardless of whether it was a matched or an unmatched
device. This resulted in all drivers getting registered much before the
warm reset notification from ISH.

Starting kernel v5.16, this issue got exposed after the change was
introduced to load only bus drivers for the respective matching devices.
In this scenario, cros_ec_ishtp device and cros_ec_ishtp driver are
registered after the warm reset device fw_client NULL setting.
cros_ec_ishtp driver_register() triggers the callback to
ishtp_cl_bus_match() to match ISHTP driver to the device and causes kernel
panic in guid_equal() when dereferencing fw_client NULL pointer to get
protocol_name.

Fixes: f155dfeaa4 ("platform/x86: isthp_eclite: only load for matching devices")
Fixes: facfe0a4fd ("platform/chrome: chros_ec_ishtp: only load for matching devices")
Fixes: 0d0cccc0fd ("HID: intel-ish-hid: hid-client: only load for matching devices")
Fixes: 44e2a58cb8 ("HID: intel-ish-hid: fw-loader: only load for matching devices")
Cc: <stable@vger.kernel.org> # 5.16+
Signed-off-by: Tanu Malhotra <tanu.malhotra@intel.com>
Tested-by: Shaunak Saha <shaunak.saha@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-20 12:35:13 +02:00
..
amd-sfh-hid HID: amd_sfh: if no sensors are enabled, clean up 2023-02-14 19:11:45 +01:00
i2c-hid HID: retain initial quirks set up when creating HID devices 2023-03-10 09:33:21 +01:00
intel-ish-hid HID: intel-ish-hid: Fix kernel panic during warm reset 2023-04-20 12:35:13 +02:00
surface-hid HID: surface-hid: Add support for hot-removal 2022-06-13 17:25:08 +02:00
usbhid HID: move from strlcpy with unused retval to strscpy 2022-08-25 11:44:27 +02:00
.kunitconfig HID: uclogic: Add KUnit tests for uclogic_rdesc_template_apply() 2022-06-15 15:51:46 +02:00
Kconfig Merge branch 'for-6.1/uclogic' into for-linus 2022-10-05 10:34:48 +01:00
Makefile Merge branch 'for-6.1/uclogic' into for-linus 2022-10-05 10:34:48 +01:00
hid-a4tech.c
hid-accutouch.c
hid-alps.c HID: alps: Declare U1_UNICORN_LEGACY support 2022-07-22 15:02:20 +02:00
hid-apple.c HID: apple: enable APPLE_ISO_TILDE_QUIRK for the keyboards of Macs with the T2 chip 2022-12-31 13:33:00 +01:00
hid-appleir.c
hid-asus.c HID: asus: use spinlock to safely schedule workers 2023-03-10 09:32:32 +01:00
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-betopff.c HID: betop: check shape of output reports 2023-02-01 08:34:24 +01:00
hid-bigbenff.c hid: bigben_probe(): validate report count 2023-03-10 09:33:23 +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-17 08:50:17 +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:49:16 +02:00
hid-creative-sb0540.c
hid-cypress.c
hid-debug.c HID: Add Mapping for System Microphone Mute 2023-03-10 09:33:55 +01:00
hid-dr.c
hid-elan.c HID: elan: Fix potential double free in elan_input_configured 2022-04-21 11:38:28 +02:00
hid-elecom.c HID: elecom: add support for TrackBall 056E:011C 2023-03-03 11:52:20 +01:00
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: vivaldi: convert to use dev_groups 2022-08-25 11:37:21 +02:00
hid-gt683r.c
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c
hid-hyperv.c HID: hyperv: fix possible memory leak in mousevsc_probe() 2022-11-02 14:34:56 +01:00
hid-icade.c
hid-ids.h HID: uclogic: Add support for XP-PEN Deco Pro MW 2023-03-10 09:33:57 +01:00
hid-input.c HID: uclogic: Add support for XP-PEN Deco Pro MW 2023-03-10 09:33:57 +01:00
hid-ite.c HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10 2022-11-14 23:55:12 +01:00
hid-jabra.c
hid-kensington.c
hid-keytouch.c
hid-kye.c HID: uclogic: Switch to Digitizer usage for styluses 2022-05-11 14:19:27 +02:00
hid-lcpower.c
hid-led.c HID: hid-led: fix maximum brightness for Dream Cheeky 2022-04-21 10:28:49 +02:00
hid-lenovo.c HID: lenovo: Make array tp10ubkbd_led static const 2022-10-18 14:43:59 +02:00
hid-letsketch.c
hid-lg-g15.c HID: lg-g15: Fix comment typo 2022-07-21 13:47:12 +02:00
hid-lg.c
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c HID: hid-lg4ff: Add check for empty lbuf 2022-11-14 23:56:52 +01:00
hid-lg4ff.h
hid-lgff.c
hid-logitech-dj.c
hid-logitech-hidpp.c HID: logitech-hidpp: Add support for Logitech MX Master 3S mouse 2023-03-30 12:49:16 +02:00
hid-macally.c
hid-magicmouse.c HID: magicmouse: Do not set BTN_MOUSE on double report 2022-10-14 10:47:50 +01:00
hid-maltron.c
hid-mcp2221.c HID: mcp2221: don't connect hidraw 2022-12-31 13:33:10 +01:00
hid-megaworld.c HID: Add support for Mega World controller force feedback 2022-05-06 08:29:26 +02:00
hid-mf.c
hid-microsoft.c
hid-monterey.c
hid-multitouch.c HID: multitouch: Add quirks for flipped axes 2023-03-10 09:33:20 +01:00
hid-nintendo.c HID: nintendo: check analog user calibration for plausibility 2022-09-21 13:25:26 +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 fbdev: Rename pagelist to pagereflist for deferred I/O 2022-05-03 16:04:22 +02:00
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-01-04 11:28:58 +01:00
hid-playstation.c HID: playstation: sanity check DualSense calibration data. 2023-02-06 08:06:33 +01:00
hid-primax.c
hid-prodikeys.c
hid-pxrc.c HID: Add driver for PhoenixRC Flight Controller 2022-09-20 11:36:21 +01:00
hid-quirks.c HID: retain initial quirks set up when creating HID devices 2023-03-10 09:33:21 +01:00
hid-razer.c
hid-redragon.c
hid-retrode.c
hid-rmi.c HID: i2c: let RMI devices decide what constitutes wakeup event 2022-12-31 13:32:14 +01:00
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: roccat: Fix use-after-free in roccat_read() 2022-09-20 14:49:15 +02:00
hid-saitek.c HID: saitek: add madcatz variant of MMO7 mouse device ID 2022-10-18 14:42:45 +02:00
hid-samsung.c
hid-semitek.c
hid-sensor-custom.c HID: hid-sensor-custom: set fixed size for custom attributes 2022-12-31 13:32:14 +01:00
hid-sensor-hub.c
hid-sigmamicro.c
hid-sjoy.c
hid-sony.c HID: sony: Fix double word in comments 2022-09-20 11:27:29 +01:00
hid-speedlink.c
hid-steam.c Merge branch 'for-6.1/core' into for-linus 2022-10-05 10:19:06 +01:00
hid-steelseries.c
hid-sunplus.c
hid-thrustmaster.c HID: thrustmaster: Add sparco wheel and fix array length 2022-08-25 11:38:55 +02:00
hid-tivo.c
hid-tmff.c
hid-topre.c hid: topre: Add driver fixing report descriptor 2022-09-20 12:16:25 +01:00
hid-topseed.c
hid-twinhan.c
hid-u2fzero.c
hid-uclogic-core.c HID: uclogic: Add support for XP-PEN Deco Pro MW 2023-03-10 09:33:57 +01:00
hid-uclogic-params-test.c HID: uclogic: Parse the UGEE v2 frame type 2022-08-25 10:26:31 +02:00
hid-uclogic-params.c HID: uclogic: Add support for XP-PEN Deco Pro MW 2023-03-10 09:33:57 +01:00
hid-uclogic-params.h HID: uclogic: Add battery quirk 2023-03-10 09:33:56 +01:00
hid-uclogic-rdesc-test.c HID: uclogic: KUnit best practices and naming conventions 2022-08-25 10:26:31 +02:00
hid-uclogic-rdesc.c HID: uclogic: Add support for XP-PEN Deco LW 2022-12-31 13:33:00 +01:00
hid-uclogic-rdesc.h HID: uclogic: Add support for XP-PEN Deco LW 2022-12-31 13:33:00 +01:00
hid-udraw-ps3.c
hid-viewsonic.c HID: uclogic: Switch to Digitizer usage for styluses 2022-05-11 14:19:27 +02:00
hid-vivaldi-common.c HID: vivaldi: convert to use dev_groups 2022-08-25 11:37:21 +02:00
hid-vivaldi-common.h HID: vivaldi: convert to use dev_groups 2022-08-25 11:37:21 +02:00
hid-vivaldi.c HID: vivaldi: convert to use dev_groups 2022-08-25 11:37:21 +02:00
hid-vrc2.c HID: Add driver for VRC-2 Car Controller 2022-09-20 11:35:00 +01:00
hid-waltop.c
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-modules.c
hid-wiimote.h
hid-xiaomi.c
hid-xinmo.c
hid-zpff.c
hid-zydacron.c
hidraw.c HID: hidraw: fix memory leak in hidraw_release() 2022-08-25 11:30:50 +02:00
uhid.c HID: uhid: Over-ride the default maximum data buffer value with our own 2023-03-17 08:50:17 +01:00
wacom.h HID: wacom: Simplify comments 2022-08-25 11:32:31 +02:00
wacom_sys.c HID: wacom: Ensure bootloader PID is usable in hidraw mode 2022-12-31 13:33:10 +01:00
wacom_wac.c HID: wacom: Ensure bootloader PID is usable in hidraw mode 2022-12-31 13:33:10 +01:00
wacom_wac.h HID: wacom: Ensure bootloader PID is usable in hidraw mode 2022-12-31 13:33:10 +01:00