]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: sma1307: Fix uevent string leaks in fault worker
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Tue, 9 Jun 2026 12:03:56 +0000 (09:03 -0300)
committerMark Brown <broonie@kernel.org>
Tue, 9 Jun 2026 17:41:45 +0000 (18:41 +0100)
commita750ca72af72dde9744468fdca6eda0b698a1cfc
treeb33e0226c4f354316fc0b1986704a37fc6e2a15b
parent9f0b311829eb58e0a0541d356f651ba4399aa765
ASoC: sma1307: Fix uevent string leaks in fault worker

sma1307_check_fault_worker() stores dynamically allocated uevent strings in
envp[0]. Several fault conditions are checked in sequence, so a later fault
can overwrite envp[0] before the final kfree() and leak the previous
allocation.

The same flow can leave an OT1 volume entry in envp[1] while envp[0]
has been overwritten by a later non-OT1 fault, causing an inconsistent
uevent payload.

Use static STATUS strings and a stack buffer for the optional VOLUME entry.
This removes the allocations from the worker and keeps VOLUME tied only
to the OT1 events that produce it.

Fixes: 576c57e6b4c1 ("ASoC: sma1307: Add driver for Iron Device SMA1307")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260609-asoc-sma1307-uevent-leak-v1-1-cd7f5b062ab7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/sma1307.c