diff options
| author | Yibo Tan <lhfff@tju.edu.cn> | 2026-09-23 02:50:57 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-28 13:19:51 +0100 |
| commit | 095025078dc3a1b4f0fcdc8b8d9dcb4d192a2a14 (patch) | |
| tree | e2e20d9d592dcd745d9a16c169116a66f7a172fc /tools/perf/scripts/python/task-analyzer.py | |
| parent | c257e3bcb36f4597d6dbb6fbc546e466ef53e385 (diff) | |
ASoC: amd: acp3x-es83xx: Keep an owned codec device reference
acpi_get_first_physical_node() returns a borrowed device pointer. The
private data allocation failure path in acp3x_es83xx_probe() puts that
pointer despite not owning a reference. The successful path also saves the
borrowed pointer for later card operations.
This was reproduced on current mainline with failslab restricted to the
real static callback. The rejected devm_kzalloc() returned -ENOMEM, and
normal codec platform-device unregister then produced a KASAN
slab-use-after-free in device_del(), with allocation in
acpi_create_platform_device() and release in acpi_unbind_one().
Use acpi_bus_get_primary_device() to acquire the reference while the
physical-node lock is held. After allocating private data, register a
devres put action before publishing the pointer. This balances action
allocation and later probe failures, keeps the saved pointer alive during
card use, and drops the reference after ASoC card unregister during
successful teardown. The existing OOM put now correctly balances the owned
lookup.
The same filtered KASAN guest with this change reached the same -ENOMEM and
unregister path without KASAN, WARNING, Oops or panic. The test directly
invoked the production callback and did not emulate a complete ACP/ASoC
card or physical Huawei hardware.
Fixes: 54fcd9dd44b2 ("ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec")
Signed-off-by: Yibo Tan <lhfff@tju.edu.cn>
Link: https://patch.msgid.link/20260922185057.954150-3-lhfff@tju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
