OrangePi_CM5/sound/core/seq/oss
Takashi Iwai f19a209f61 ALSA: seq: oss: Fix data-race for max_midi_devs access
commit 22dec134dbfa825b963f8a1807ad19b943e46a56 upstream.

ALSA OSS sequencer refers to a global variable max_midi_devs at
creating a new port, storing it to its own field.  Meanwhile this
variable may be changed by other sequencer events at
snd_seq_oss_midi_check_exit_port() in parallel, which may cause a data
race.

OTOH, this data race itself is almost harmless, as the access to the
MIDI device is done via get_mdev() and it's protected with a refcount,
hence its presence is guaranteed.

Though, it's sill better to address the data-race from the code sanity
POV, and this patch adds the proper spinlock for the protection.

Reported-by: Abhishek Shah <abhishek.shah@columbia.edu>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/CAEHB2493pZRXs863w58QWnUTtv3HHfg85aYhLn5HJHCwxqtHQg@mail.gmail.com
Link: https://lore.kernel.org/r/20220823072717.1706-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-08 11:11:40 +02:00
..
Makefile
…
seq_oss.c ALSA: seq: oss: Avoid mutex lock for a long-time ioctl 2020-09-23 14:45:14 +02:00
seq_oss_device.h
…
seq_oss_event.c
…
seq_oss_event.h
…
seq_oss_init.c
…
seq_oss_ioctl.c
…
seq_oss_midi.c ALSA: seq: oss: Fix data-race for max_midi_devs access 2022-09-08 11:11:40 +02:00
seq_oss_midi.h
…
seq_oss_readq.c
…
seq_oss_readq.h
…
seq_oss_rw.c
…
seq_oss_synth.c ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info() 2021-01-27 11:54:51 +01:00
seq_oss_synth.h
…
seq_oss_timer.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
seq_oss_timer.h
…
seq_oss_writeq.c
…
seq_oss_writeq.h
…