]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:43:24 +0000 (16:43 +0100)
commit189c87e4be1c3565101519d199023e0105499abb
tree5beb989a63c064b3d6f97254c3c6e7e80d75a242
parent433a559ffbfc917311d444ac82c1d5a773cc12dc
ALSA: rawmidi: Access runtime->avail always in spinlock

BugLink: https://bugs.launchpad.net/bugs/1912681
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
sound/core/rawmidi.c