]> git.baikalelectronics.ru Git - kernel.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)
committerTakashi Iwai <tiwai@suse.de>
Tue, 16 Feb 2016 13:37:19 +0000 (14:37 +0100)
commitb983138276014bec9b0060fbea03f5f66a0aebe4
tree60f260262d588d1d4ba08b1b2907fbde23dca5a7
parentfc1d1063a0d2975d035b2c8e547ec273bb4b74e8
ALSA: seq: Fix double port list deletion

The commit [4eb0d4de91ed: 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: 4eb0d4de91ed ('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>
sound/core/seq/seq_ports.c