]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: rawmidi: Take open_mutex around parameter changes
authorTakashi Iwai <tiwai@suse.de>
Fri, 17 Jun 2022 14:40:49 +0000 (16:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Jun 2022 07:36:02 +0000 (09:36 +0200)
commit7ddc53d281f4962a6ecd5dfa7efa1e325e802a21
tree1220408576b9f1e25bf1db000de5800b74adb486
parentdbd63343b8f81733fcfe5b2a1bf83e1669522a91
ALSA: rawmidi: Take open_mutex around parameter changes

The input/output parameter changes are pretty intrusive, possibly
involving with the buffer resizing operation.  Hence those should be
performed exclusively; otherwise some ugly race could happen.

This patch puts the existing open_mutex for snd_rawmidi_input_params()
and *_output_params() for protecting the concurrent calls.  Since
those are exported, it's also meant for hardening from the external
calls, too.

Link: https://lore.kernel.org/r/20220617144051.18985-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/rawmidi.c