linux-stable/drivers/platform/chrome
Victor Ding b610758bb3 platform/chrome: cros_ec_typec: zero out stale pointers
[ Upstream commit 9a8aadcf0b ]

`cros_typec_get_switch_handles` allocates four pointers when obtaining
type-c switch handles. These pointers are all freed if failing to obtain
any of them; therefore, pointers in `port` become stale. The stale
pointers eventually cause use-after-free or double free in later code
paths. Zeroing out all pointer fields after freeing to eliminate these
stale pointers.

Fixes: f28adb41da ("platform/chrome: cros_ec_typec: Register Type C switches")
Fixes: 1a8912caba ("platform/chrome: cros_ec_typec: Get retimer handle")
Signed-off-by: Victor Ding <victording@chromium.org>
Acked-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20221207093924.v2.1.I1864b6a7ee98824118b93677868d22d3750f439b@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:25:47 +01:00
..
wilco_ec platform/chrome: wilco_ec: event: Fix typo in comment 2022-06-24 04:01:13 +00:00
Kconfig platform/chrome: merge Kunit utils and test cases 2022-07-21 08:49:28 +00:00
Makefile platform/chrome: merge Kunit utils and test cases 2022-07-21 08:49:28 +00:00
chromeos_acpi.c platform/chrome: Add ChromeOS ACPI device driver 2022-05-13 19:42:30 +08:00
chromeos_laptop.c platform/chrome: fix double-free in chromeos_laptop_prepare() 2022-10-21 12:38:23 +02:00
chromeos_privacy_screen.c platform/chrome: Add driver for ChromeOS privacy-screen 2022-01-10 12:17:37 +01:00
chromeos_pstore.c
chromeos_tbmc.c
cros_ec.c platform/chrome: cros_ec: Notify the PM of wake events during resume 2022-10-21 12:39:14 +02:00
cros_ec.h platform/chrome: cros_ec: Make cros_ec_unregister() return void 2022-02-09 13:00:43 +00:00
cros_ec_chardev.c platform/chrome: fix memory corruption in ioctl 2022-10-21 12:38:24 +02:00
cros_ec_debugfs.c platform/chrome: cros_ec_debugfs: detach log reader wq from devm 2022-03-31 16:56:48 -07:00
cros_ec_i2c.c platform/chrome: cros_ec_i2c: drop BUG_ON() in cros_ec_pkt_xfer_i2c() 2022-05-16 10:01:51 +08:00
cros_ec_ishtp.c platform/chrome: correct cros_ec_prepare_tx() usage 2022-05-16 10:01:51 +08:00
cros_ec_lightbar.c platform/chrome: Constify static attribute_group structs 2021-01-20 16:19:17 +01:00
cros_ec_lpc.c platform/chrome: correct cros_ec_prepare_tx() usage 2022-05-16 10:01:51 +08:00
cros_ec_lpc_mec.c platform/chrome: cros_ec_lpc: Use DEFINE_MUTEX() for mutex lock 2021-04-21 10:00:30 +02:00
cros_ec_lpc_mec.h
cros_ec_proto.c platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure 2022-10-21 12:37:37 +02:00
cros_ec_proto_test.c platform/chrome: cros_ec_proto: add Kunit test for cros_ec_cmd() 2022-07-20 01:22:59 +00:00
cros_ec_rpmsg.c platform/chrome: correct cros_ec_prepare_tx() usage 2022-05-16 10:01:51 +08:00
cros_ec_sensorhub.c platform/chrome: cros_ec_sensorhub: simplify getting .driver_data 2021-09-27 09:18:58 +02:00
cros_ec_sensorhub_ring.c platform: chrome: Split trace include file 2022-03-31 16:56:29 -07:00
cros_ec_sensorhub_trace.h platform: chrome: Split trace include file 2022-03-31 16:56:29 -07:00
cros_ec_spi.c platform/chrome: cros_ec_spi: drop BUG_ON() if `din` isn't large enough 2022-05-16 10:01:52 +08:00
cros_ec_sysfs.c platform/chrome: cros_ec_sysfs: Add cold-ap-off to sysfs reboot. 2021-01-20 16:19:17 +01:00
cros_ec_trace.c
cros_ec_trace.h platform/chrome: use macros for passthru indexes 2022-06-10 02:31:42 +00:00
cros_ec_typec.c platform/chrome: cros_ec_typec: zero out stale pointers 2022-12-31 13:25:47 +01:00
cros_ec_vbc.c platform/chrome: Constify static attribute_group structs 2021-01-20 16:19:17 +01:00
cros_kbd_led_backlight.c platform/chrome: cros_kbd_led_backlight: fix build warning 2022-07-20 01:22:59 +00:00
cros_kunit_util.c platform/chrome: cros_kunit_util: add default value for `msg->result` 2022-07-21 08:49:28 +00:00
cros_kunit_util.h platform/chrome: cros_kunit_util: add default value for `msg->result` 2022-07-21 08:49:28 +00:00
cros_usbpd_logger.c
cros_usbpd_notify.c platform/chrome: cros_usbpd_notify: Fix error handling in cros_usbpd_notify_init() 2022-12-31 13:25:44 +01:00