diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-10-15 13:22:41 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-10-15 18:36:56 +0200 |
| commit | 6904743ab77e0684dff319f3806ef982e5eea6cf (patch) | |
| tree | 8d03c460160a4ea530493ef79661970285be2f1f /tools/lib/python | |
| parent | 91d0048a97e0fdc0a071caa0ba59e659bc6f84df (diff) | |
ALSA: core: Serialize snd_refcount put and sync
When a thread tries to sync-and-destroy the resource with
snd_refcount_sync(), it might lead to a UAF in a very slight time
window. Namely, snd_refount_put() calls wake_up() after
atomic_dec_and_test(), but wait_event() in snd_refcount_sync() checks
the condition via atomic_test() without serialization, hence the
thread that called snd_refcount_sync() can continue immediately to
release the resource before another thread calls wake_up().
For avoiding the race above, introduce the spinlock and take it at
snd_refcount_put() and snd_refcount_sync() in order to serialize the
operations.
Fixes: dcca9b6064c3 ("ALSA: Add simple refcount helper functions")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20261015071838.31082-1-tiwai%40suse.de
Reviewed-by: Cen Zhang <zzzccc427@gmail.com>
Link: https://patch.msgid.link/20261015112256.3902-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
