linux/drivers/platform
Victor Ding 9a8aadcf0b platform/chrome: cros_ec_typec: zero out stale pointers
`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
2022-12-08 09:44:48 +08:00
..
chrome platform/chrome: cros_ec_typec: zero out stale pointers 2022-12-08 09:44:48 +08:00
goldfish platform: goldfish: pipe: Use platform_get_irq() to get the interrupt 2022-03-18 13:55:21 +01:00
loongarch LoongArch: Add ACPI-based generic laptop driver 2022-10-12 16:36:20 +08:00
mellanox platform-drivers-x86 for v6.1-1 2022-10-05 10:38:24 -07:00
mips MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error. 2022-06-09 22:24:19 +02:00
olpc platform/olpc: Fix uninitialized data in debugfs write 2022-07-28 20:40:15 +02:00
surface platform-drivers-x86 for v6.1-1 2022-10-05 10:38:24 -07:00
x86 Interrupt subsystem updates: 2022-10-12 10:23:24 -07:00
Kconfig LoongArch: Add ACPI-based generic laptop driver 2022-10-12 16:36:20 +08:00
Makefile LoongArch: Add ACPI-based generic laptop driver 2022-10-12 16:36:20 +08:00