]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: pcm: oss: Fix setup list UAF on proc write error
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Sat, 23 May 2026 01:09:40 +0000 (22:09 -0300)
committerTakashi Iwai <tiwai@suse.de>
Mon, 25 May 2026 07:23:10 +0000 (09:23 +0200)
commit4cc54bdd54b337e77115be5b55577d1c58608eae
tree77364e5e102b3284bc128690654977b21dbae5a7
parenta0d9e8df2ebca290c2efff70abc05426e5a476b0
ALSA: pcm: oss: Fix setup list UAF on proc write error

snd_pcm_oss_proc_write() links a newly allocated setup entry into the
OSS setup list before duplicating the task name. If the task-name
allocation fails, the error path frees the already linked entry and
leaves setup_list pointing at freed memory.

A later OSS device open can then walk the stale list entry in
snd_pcm_oss_look_for_setup() and dereference freed memory.

Allocate the task name and initialize the setup entry before publishing
the entry on setup_list. Also fetch the initial proc read iterator only
after taking setup_mutex, so all setup_list traversal follows the same
list lifetime rules.

Reported-by: syzbot+8e498074a794999eb41c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/6a1062b7.170a0220.35b2b7.0003.GAE@google.com
Closes: https://syzkaller.appspot.com/bug?extid=8e498074a794999eb41c
Fixes: 060d77b9c04a ("[ALSA] Fix / clean up PCM-OSS setup hooks")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260522-alsa-pcm-oss-setup-uaf-v1-1-40bdcc4d17e8@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_oss.c