[PATCH 5.10/5.15 0/2] power: supply: Fix supplied_from allocation

From: Mikhail Dmitrichenko

Date: Mon Nov 02 2026 - 06:15:05 EST


Please apply this series to 5.10.y and 5.15.y to fix CVE-2026-74271.

When a Device Tree power-supplies property lists more than one supplier,
power_supply_check_supplies() allocates space for only one pointer in
psy->supplied_from. The subsequent allocation through *psy->supplied_from
does not extend that array, and populating the second supplier writes
past its end. Patch 2 allocates a single array large enough for all the
supplier pointers.

Patch 1, upstream commit 966f6551173a ("power: supply: Fix typo in
power_supply_check_supplies"), adjusts the sizeof expressions used by
these allocations. With this small prerequisite in place, the fix in
ba61aed9a346 ("power: supply: core: fix supplied_from allocations")
applies unchanged to both branches. The fix is already in 6.1.y and
newer stable branches.

The series applies cleanly to v5.10.273 and v5.15.224.
Build-tested only.

Schspa Shi (1):
power: supply: Fix typo in power_supply_check_supplies

Lucas Tsai (1):
power: supply: core: fix supplied_from allocations

drivers/power/supply/power_supply_core.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

--
2.43.0