]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: rawmidi: Change resized buffers atomically
authorTakashi Iwai <tiwai@suse.de>
Tue, 17 Jul 2018 15:26:43 +0000 (17:26 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 17 Jul 2018 15:33:17 +0000 (17:33 +0200)
commitf38a6639105f06357eb4827357ff8c6137b69160
tree5109d844e69ee0f48e8575f487967a78cb8b9c3c
parent65c9022c53f050875b6f85ab84b156a225007b61
ALSA: rawmidi: Change resized buffers atomically

The SNDRV_RAWMIDI_IOCTL_PARAMS ioctl may resize the buffers and the
current code is racy.  For example, the sequencer client may write to
buffer while it being resized.

As a simple workaround, let's switch to the resized buffer inside the
stream runtime lock.

Reported-by: syzbot+52f83f0ea8df16932f7f@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/rawmidi.c