summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-15 22:50:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 09:10:56 +0200
commita9865cf13a6edfedac84cc0d53023ca0a9267cfe (patch)
treef259e7e96a71faaac1bef55ebd15911648e6ce94 /sound/pci/hda/hda_codec.c
parentc7b5dbbacb0dace989c57a726aa68be72e746441 (diff)
downloadlinux-stable-a9865cf13a6edfedac84cc0d53023ca0a9267cfe.tar.gz
linux-stable-a9865cf13a6edfedac84cc0d53023ca0a9267cfe.tar.bz2
linux-stable-a9865cf13a6edfedac84cc0d53023ca0a9267cfe.zip
ALSA: seq: Break too long mutex context in the write loop
commit ede34f397ddb063b145b9e7d79c6026f819ded13 upstream. The fix for the racy writes and ioctls to sequencer widened the application of client->ioctl_mutex to the whole write loop. Although it does unlock/relock for the lengthy operation like the event dup, the loop keeps the ioctl_mutex for the whole time in other situations. This may take quite long time if the user-space would give a huge buffer, and this is a likely cause of some weird behavior spotted by syzcaller fuzzer. This patch puts a simple workaround, just adding a mutex break in the loop when a large number of events have been processed. This shouldn't hit any performance drop because the threshold is set high enough for usual operations. Fixes: 7bd800915677 ("ALSA: seq: More protection for concurrent write and ioctl races") Reported-by: syzbot+97aae04ce27e39cbfca9@syzkaller.appspotmail.com Reported-by: syzbot+4c595632b98bb8ffcc66@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
0 files changed, 0 insertions, 0 deletions