linux/drivers/pmdomain/mediatek
Wentao Liang ec1fcddb31 pmdomain: mediatek: fix use-after-free in scpsys_get_bus_protection_legacy()
In scpsys_get_bus_protection_legacy(), of_find_node_with_property()
returns a device node with its reference count incremented. The function
then calls of_node_put(node) before checking whether
syscon_regmap_lookup_by_phandle() returns an error. If an error occurs,
dev_err_probe() dereferences the node pointer to print diagnostic
information, but the node memory may have already been freed due to the
earlier of_node_put(), leading to a use-after-free vulnerability.

Fix this by moving the of_node_put() call after the error check, ensuring
the node is still valid when accessed in the error path.

Fixes: c29345fa5f ("pmdomain: mediatek: Refactor bus protection regmaps retrieval")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-04-27 14:53:30 +02:00
..
airoha-cpu-pmdomain.c pmdomain: mediatek: airoha: convert from round_rate() to determine_rate() 2025-09-17 16:28:18 +02:00
Kconfig pmdomain: mediatek: mtk-mfg: select MAILBOX in Kconfig 2025-11-19 18:06:50 +01:00
Makefile pmdomain: mediatek: Add support for MFlexGraphics 2025-11-19 18:06:50 +01:00
mt6735-pm-domains.h pmdomain: mediatek: Add support for MT6735 2024-10-22 13:08:11 +02:00
mt6795-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt6893-pm-domains.h pmdomain: mediatek: Add support for Dimensity 1200 MT6893 2025-04-23 10:28:13 +02:00
mt8167-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8173-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8183-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8186-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8188-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8189-pm-domains.h pmdomain: mediatek: Add power domain driver for MT8189 SoC 2026-04-01 13:07:31 +02:00
mt8192-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8195-pm-domains.h pmdomain: Merge branch fixes into next 2025-09-23 16:35:23 +02:00
mt8196-pm-domains.h pmdomain: mediatek: Add support for MT8196 HFRPSYS power domains 2025-11-19 18:06:50 +01:00
mt8365-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mtk-mfg-pmdomain.c pmdomain: mediatek: mtk-mfg: Expose shader_present as nvmem cell 2026-04-01 13:07:31 +02:00
mtk-pm-domains.c pmdomain: mediatek: fix use-after-free in scpsys_get_bus_protection_legacy() 2026-04-27 14:53:30 +02:00
mtk-pm-domains.h pmdomain: mediatek: Add bus protect control flow for MT8189 2026-04-01 13:07:31 +02:00
mtk-scpsys.c pmdomain: mediatek: scpsys: Add MT7622 Audio power domain to legacy driver 2026-04-01 13:07:31 +02:00