Skip to contentSkip to conversation

platform/chrome: cros_ec_ishtp: Fix UAF after unbinding driver

PATCH In review Tzung-Bi Shih 1 participant 2 messages Oct 31, 2025 – Nov 10, 2025

Subsystems (2)
lore
Share & tools
lore

Tzung-Bi Shih

author maintainer
#0 lore raw

PATCH 1/1 platform/chrome: cros_ec_ishtp: Fix UAF after unbinding driver

After unbinding the driver, another kthread cros_ec_console_log_work is still accessing the device, resulting an UAF and crash.

The driver doesn't unregister the EC device in .remove() which should shutdown sub-devices synchronously. Fix it.

Fixes 26a14267aff2 ("platform/chrome: Add ChromeOS EC ISHTP driver")
---
 drivers/platform/chrome/cros_ec_ishtp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/chrome/cros_ec_ishtp.c +1 -0
index 4e74e702c5a2..3766cef81fe8 100644
@@ -667,6 +667,7 @@ static void cros_ec_ishtp_remove(struct ishtp_cl_device *cl_device)
 
 	cancel_work_sync(&client_data->work_ishtp_reset);
 	cancel_work_sync(&client_data->work_ec_evt);
+	cros_ec_unregister(client_data->ec_dev);
 	cros_ish_deinit(cros_ish_cl);
 	ishtp_put_device(cl_device);
 }
Signature · 1 line
2.51.2.997.g839fc31de9-goog
author maintainer
#1 lore raw
Quoted 7 lines · Tzung-Bi Shih

After unbinding the driver, another kthread cros_ec_console_log_work is still accessing the device, resulting an UAF and crash.

The driver doesn't unregister the EC device in .remove() which should shutdown sub-devices synchronously. Fix it.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

[1/1] platform/chrome: cros_ec_ishtp: Fix UAF after unbinding driver

      commit: 944edca81e7aea15f83cf9a13a6ab67f711e8abd

Thanks!