Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+1
+1
sound/core/seq/seq_fifo.c
··· 210 210 poll_table *wait) 211 211 { 212 212 poll_wait(file, &f->input_sleep, wait); 213 + guard(spinlock_irq)(&f->lock); 213 214 return (f->cells > 0); 214 215 } 215 216