]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: rawmidi: Access runtime->avail always in spinlock
authorTakashi Iwai <tiwai@suse.de>
Sun, 6 Dec 2020 08:35:27 +0000 (09:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:45:00 +0000 (14:45 +0100)
commit64b2a977e116835dbe184a2f44d90b61c84fb5e8
tree9d325f0e85bdfeddb19a66c93c91ca3bbd8160f7
parent2c8ccc3052d83f84729b0173863677ce4066d151
ALSA: rawmidi: Access runtime->avail always in spinlock

commit 88a06d6fd6b369d88cec46c62db3e2604a2f50d5 upstream.

The runtime->avail field may be accessed concurrently while some
places refer to it without taking the runtime->lock spinlock, as
detected by KCSAN.  Usually this isn't a big problem, but for
consistency and safety, we should take the spinlock at each place
referencing this field.

Reported-by: syzbot+a23a6f1215c84756577c@syzkaller.appspotmail.com
Reported-by: syzbot+3d367d1df1d2b67f5c19@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20201206083527.21163-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/rawmidi.c