HID: intel-ish-hid: fix NULL-ptr-deref in ishtp_bus_remove_all_clients
Subsystems (2)
PATCH 1/1 HID: intel-ish-hid: fix NULL-ptr-deref in ishtp_bus_remove_all_clients
During a warm reset flow, the cl->device pointer may be NULL if the reset occurs while clients are still being enumerated. Accessing cl->device->reference_count without a NULL check leads to a kernel panic.
This issue was identified during multi-unit warm reboot stress clycles. Add a defensive NULL check for cl->device to ensure stability under such intensive testing conditions.
KASAN: null-ptr-deref in range [0000000000000000-0000000000000007] Workqueue: ish_fw_update_wq fw_reset_work_fn Call Trace: ishtp_bus_remove_all_clients+0xbe/0x130 [intel_ishtp] ishtp_reset_handler+0x85/0x1a0 [intel_ishtp] fw_reset_work_fn+0x8a/0xc0 [intel_ish_ipc]
--- drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/intel-ish-hid/ishtp/bus.c +1 -1
@@ -730,7 +730,7 @@ void ishtp_bus_remove_all_clients(struct ishtp_device *ishtp_dev,spin_lock_irqsave (&ishtp_dev->cl_list_lock, flags);list_for_each_entry (cl, &ishtp_dev->cl_list, link) { cl->state =ISHTP_CL_DISCONNECTED ; -if (warm_reset && cl->device->reference_count) +if (warm_reset && cl->device && cl->device->reference_count)continue ;/*
Signature · 1 line
2.34.1
srinivas pandruvada
maintainerQuoted 18 lines · Ryan Lin
During a warm reset flow, the
cl->devicepointer may be NULL if the reset occurs while clients are still being enumerated. Accessingcl->device->reference_countwithout a NULL check leads to a kernel panic.This issue was identified during multi-unit warm reboot stress clycles.
Add a defensive NULL check forcl->deviceto ensure stability under such intensive testing conditions.KASAN: null-ptr-deref in range [0000000000000000-0000000000000007] Workqueue: ish_fw_update_wq fw_reset_work_fn Call Trace: ishtp_bus_remove_all_clients+0xbe/0x130 [intel_ishtp] ishtp_reset_handler+0x85/0x1a0 [intel_ishtp] fw_reset_work_fn+0x8a/0xc0 [intel_ish_ipc]
Quoted 2 lines
Fixes 3703f53b99e4a ("HID: intel_ish-hid: ISH Transport layer")Signed-off-by Ryan Lin <[email protected]>
You need to use get_maintainer.pl to get all TO and CC list.
You missed
Jiri Kosina <[email protected]>
Benjamin Tissoires <[email protected]>
Quoted 20 lines
---
drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/intel-ish-hid/ishtp/bus.c +1
-1@@ -730,7 +730,7 @@ void ishtp_bus_remove_all_clients(structishtp_device *ishtp_dev, spin_lock_irqsave(&ishtp_dev->cl_list_lock, flags); list_for_each_entry(cl, &ishtp_dev->cl_list, link) { cl->state = ISHTP_CL_DISCONNECTED; -if (warm_reset && cl->device->reference_count) +if (warm_reset && cl->device && cl->device- >reference_count) continue;
/*
Quoted 31 lines
-----Original Message-----
From: srinivas pandruvada <[email protected]>
Sent: Saturday, January 31, 2026 9:32 AM
To: Lin, Ryan <[email protected]>; [email protected]; linux- [email protected]; [email protected]; Zhang, Lixu <[email protected]>; Benjamin Tissoires <[email protected]>; Jiri Kosina <[email protected]>
Subject: Re: [linux-drivers-review] [PATCH] HID: intel-ish-hid: fix NULL-ptr-deref inishtp_bus_remove_all_clientsQuoted 18 lines · Ryan Lin
During a warm reset flow, the
cl->devicepointer may be NULL if the reset occurs while clients are still being enumerated. Accessingcl->device->reference_countwithout a NULL check leads to a kernel panic.This issue was identified during multi-unit warm reboot stress clycles.
Add a defensive NULL check forcl->deviceto ensure stability under such intensive testing conditions.KASAN: null-ptr-deref in range [0000000000000000-0000000000000007] Workqueue: ish_fw_update_wq fw_reset_work_fn Call Trace: ishtp_bus_remove_all_clients+0xbe/0x130 [intel_ishtp] ishtp_reset_handler+0x85/0x1a0 [intel_ishtp] fw_reset_work_fn+0x8a/0xc0 [intel_ish_ipc]
Quoted 8 lines
Quoted 2 lines
Fixes 3703f53b99e4a ("HID: intel_ish-hid: ISH Transport layer")Signed-off-by Ryan Lin <[email protected]>You need to use get_maintainer.pl to get all TO and CC list.
You missed
Jiri Kosina <[email protected]>
Benjamin Tissoires <[email protected]>
Thanks, Srinivas. I've looped Jiri and Benjamin in the v2 thread. Appreciate the heads-up.
Regards,
Ryan
Quoted 22 lines
Quoted 22 lines
---
drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/intel-ish-hid/ishtp/bus.c +1
-1@@ -730,7 +730,7 @@ void ishtp_bus_remove_all_clients(structishtp_device *ishtp_dev, spin_lock_irqsave(&ishtp_dev->cl_list_lock, flags); list_for_each_entry(cl, &ishtp_dev->cl_list, link) { cl->state = ISHTP_CL_DISCONNECTED; -if (warm_reset && cl->device->reference_count) +if (warm_reset && cl->device && cl->device- >reference_count) continue;/*