diff options
| author | Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com> | 2026-09-26 00:07:17 +0700 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-09-28 13:43:26 +0200 |
| commit | 0b7bd20f6379bc5e431fd74d866390f5b5b63f3c (patch) | |
| tree | 690ee96dfe1e8e703bb39b9b9d5bf2eef3e6e2bc /tools/perf/scripts/python/stackcollapse.py | |
| parent | 7b457ae8cf711831f19d20963f5ed2fdf4842d3a (diff) | |
| download | linux-0b7bd20f6379bc5e431fd74d866390f5b5b63f3c.tar.gz linux-0b7bd20f6379bc5e431fd74d866390f5b5b63f3c.zip | |
ALSA: caiaq: unregister the input device when probe fails
setup_card() registers the input device, whose name and phys point into
struct snd_usb_caiaqdev, and then goes on to snd_card_register() and
snd_usb_caiaq_control_init(). If either fails, snd_probe() calls
snd_card_free(), which frees the device state but leaves the input
device registered: card_free() only clears the pointer, and the input
device is unregistered from snd_disconnect() alone. Reading its "uevent"
attribute afterwards dereferences freed memory:
BUG: KASAN: slab-use-after-free in string+0x4a9/0x4f0
Read of size 1 at addr ffff8880208f5043 by task caiaq/4967
add_uevent_var+0x183/0x3a0
input_dev_uevent+0x162/0x900
dev_uevent+0x2f1/0x870
uevent_show+0x1ca/0x3a0
...
Unregister the input device on the probe error path, as
snd_disconnect() does. snd_usb_caiaq_input_disconnect() is a no-op when
no input device was registered.
Reproduced with a raw-gadget Audio Kontrol 1 and a temporary hack that
makes snd_usb_caiaq_control_init() fail.
Fixes: 28abd224db4a ("ALSA: caiaq: Handle probe errors properly")
Cc: stable@vger.kernel.org
Reported-by: syzbot+2a123f6269da57ffefaa@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2a123f6269da57ffefaa
Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Link: https://patch.msgid.link/20260925170717.22462-1-ngocthang2710.1999@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
