public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] power: supply: Fix use-after-free in power_supply_changed()
@ 2025-12-20 22:35 Waqar Hameed
  2025-12-20 22:35 ` [PATCH 01/11] power: supply: ab8500: " Waqar Hameed
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Waqar Hameed @ 2025-12-20 22:35 UTC (permalink / raw)
  To: Linus Walleij, Sebastian Reichel, Samuel Kayode, Wenyou Yang,
	Ricardo Rivera-Matos, Dan Murphy, Tony Lindgren, Mike A. Chan,
	Jun Nakajima, Xiaohui Xin, Yunhong Jiang, Tom Keel, Frank Li,
	Lee Jones, Nikita Travkin, Anda-Maria Nicolae,
	Krzysztof Kozlowski, Phil Reid, Alan Cox, Sheng Yang
  Cc: linux-pm, linux-kernel, imx

The majority of the drivers in `drivers/power/supply/` do the right
thing when registering an interrupt handler and the `power_supply`
handle; namely making sure that the interrupt handler only runs while
the `power_supply` handle is valid. The drivers in this patch series do
not however. This can lead to a nasty use-after-free as thoroughly
explained in the commit message.

These were identified by grepping for `request.+irq` and
`power_supply_changed\(`, and then manually inspecting and fixing the
affected ones. This issue was found when writing a new driver for the
upcoming TI BQ25630 [1]. Patch adding support for that one will be sent
as soon as TI releases the datasheet publicly, which should be anytime
soon...

[1] https://www.ti.com/product/BQ25630

Waqar Hameed (11):
  power: supply: ab8500: Fix use-after-free in power_supply_changed()
  power: supply: act8945a: Fix use-after-free in power_supply_changed()
  power: supply: bq256xx: Fix use-after-free in power_supply_changed()
  power: supply: bq25980: Fix use-after-free in power_supply_changed()
  power: supply: cpcap-battery: Fix use-after-free in
    power_supply_changed()
  power: supply: goldfish: Fix use-after-free in power_supply_changed()
  power: supply: pf1550: Fix use-after-free in power_supply_changed()
  power: supply: pm8916_bms_vm: Fix use-after-free in
    power_supply_changed()
  power: supply: pm8916_lbc: Fix use-after-free in
    power_supply_changed()
  power: supply: rt9455: Fix use-after-free in power_supply_changed()
  power: supply: sbs-battery: Fix use-after-free in
    power_supply_changed()

 drivers/power/supply/ab8500_charger.c   | 40 ++++++++++++-------------
 drivers/power/supply/act8945a_charger.c | 16 +++++-----
 drivers/power/supply/bq256xx_charger.c  | 12 ++++----
 drivers/power/supply/bq25980_charger.c  | 12 ++++----
 drivers/power/supply/cpcap-battery.c    |  8 ++---
 drivers/power/supply/goldfish_battery.c | 12 ++++----
 drivers/power/supply/pf1550-charger.c   | 32 ++++++++++----------
 drivers/power/supply/pm8916_bms_vm.c    | 18 +++++------
 drivers/power/supply/pm8916_lbc.c       | 18 +++++------
 drivers/power/supply/rt9455_charger.c   | 17 ++++++-----
 drivers/power/supply/sbs-battery.c      | 36 +++++++++++-----------
 11 files changed, 111 insertions(+), 110 deletions(-)


base-commit: fa084c35afa13ab07a860ef0936cd987f9aa0460
-- 
2.39.5


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-01-14 14:53 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20 22:35 [PATCH 00/11] power: supply: Fix use-after-free in power_supply_changed() Waqar Hameed
2025-12-20 22:35 ` [PATCH 01/11] power: supply: ab8500: " Waqar Hameed
2025-12-22 22:35   ` Linus Walleij
2025-12-20 22:35 ` [PATCH 04/11] power: supply: bq25980: " Waqar Hameed
2025-12-20 22:35 ` [PATCH 02/11] power: supply: act8945a: " Waqar Hameed
2025-12-20 22:35 ` [PATCH 03/11] power: supply: bq256xx: " Waqar Hameed
2025-12-20 22:36 ` [PATCH 06/11] power: supply: goldfish: " Waqar Hameed
2025-12-20 22:36 ` [PATCH 05/11] power: supply: cpcap-battery: " Waqar Hameed
2025-12-20 22:36 ` [PATCH 07/11] power: supply: pf1550: " Waqar Hameed
2026-01-06  2:59   ` Samuel Kayode
2025-12-20 22:36 ` [PATCH 08/11] power: supply: pm8916_bms_vm: " Waqar Hameed
2025-12-21  5:47   ` Nikita Travkin
2025-12-20 22:36 ` [PATCH 09/11] power: supply: pm8916_lbc: " Waqar Hameed
2025-12-21  5:45   ` Nikita Travkin
2026-01-07 14:32     ` Waqar Hameed
2026-01-14 10:48       ` Waqar Hameed
2026-01-14 14:52         ` Sebastian Reichel
2025-12-20 22:36 ` [PATCH 10/11] power: supply: rt9455: " Waqar Hameed
2025-12-20 22:36 ` [PATCH 11/11] power: supply: sbs-battery: " Waqar Hameed
2026-01-05  3:16   ` Phil Reid
2026-01-12  1:56 ` [PATCH 00/11] power: supply: " Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox