diff options
author | Takashi Iwai <tiwai@suse.de> | 2025-09-17 14:13:27 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2025-09-17 14:14:12 +0200 |
commit | 1f9fc89cbbe8a7a8648ea2f827f7d8590e62e52c (patch) | |
tree | 89e3730f73c7281dec22d49a4e50988c436b1497 /sound/core | |
parent | 7e18682bdbda4df24837dae4cf103b2a6de3d699 (diff) |
ALSA: seq: Fix KCSAN data-race warning at snd_seq_fifo_poll_wait()
snd_seq_fifo_poll_wait() evaluates f->cells without locking after
poll_wait(), and KCSAN doesn't like it as it appears to be a
data-race. Although this doesn't matter much in practice as the value
is volatile, it's still better to address it for the mind piece.
Wrap it with f->lock spinlock for avoiding the potential data race.
Reported-by: syzbot+c3dbc239259940ededba@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=c3dbc239259940ededba
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/seq_fifo.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c index f23c6b7ae240..91cce1890111 100644 --- a/sound/core/seq/seq_fifo.c +++ b/sound/core/seq/seq_fifo.c @@ -210,6 +210,7 @@ int snd_seq_fifo_poll_wait(struct snd_seq_fifo *f, struct file *file, poll_table *wait) { poll_wait(file, &f->input_sleep, wait); + guard(spinlock_irq)(&f->lock); return (f->cells > 0); } |