]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ALSA: seq: Fix double port list deletion
authorTakashi Iwai <tiwai@suse.de>
Tue, 16 Feb 2016 13:15:59 +0000 (14:15 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:08 +0000 (15:45 -0700)
commitd26d34031883a239c1a8096d45e35dd503e1e6dc
treee81d02441420fd0fa300e4362e41f55f40c13235
parent2234687e4716816d5eb246e61cf6ccf660176523
ALSA: seq: Fix double port list deletion

Orabug: 23330865

[ Upstream commit 13d5e5d4725c64ec06040d636832e78453f477b7 ]

The commit [7f0973e973cd: ALSA: seq: Fix lockdep warnings due to
double mutex locks] split the management of two linked lists (source
and destination) into two individual calls for avoiding the AB/BA
deadlock.  However, this may leave the possible double deletion of one
of two lists when the counterpart is being deleted concurrently.
It ends up with a list corruption, as revealed by syzkaller fuzzer.

This patch fixes it by checking the list emptiness and skipping the
deletion and the following process.

BugLink: http://lkml.kernel.org/r/CACT4Y+bay9qsrz6dQu31EcGaH9XwfW7o3oBzSQUG9fMszoh=Sg@mail.gmail.com
Fixes: 7f0973e973cd ('ALSA: seq: Fix lockdep warnings due to 'double mutex locks)
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit ad4ad1ac3b0aef2779097a298ecc20ef9eef17d6)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
sound/core/seq/seq_ports.c