summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-10-29 11:10:43 +0100
committerBen Hutchings <ben@decadent.org.uk>2018-01-01 20:51:00 +0000
commitc8b65d0592334b361264c82726c05ffcec60193f (patch)
treeb6a495cd6c37641e5377191fff86f65855b2427d /sound
parenta7cae39d138d5011b16fcf554cb91bdf445f3571 (diff)
downloadlinux-stable-c8b65d0592334b361264c82726c05ffcec60193f.tar.gz
linux-stable-c8b65d0592334b361264c82726c05ffcec60193f.tar.bz2
linux-stable-c8b65d0592334b361264c82726c05ffcec60193f.zip
ALSA: seq: Fix nested rwsem annotation for lockdep splat
commit 1f20f9ff57ca23b9f5502fca85ce3977e8496cb1 upstream. syzkaller reported the lockdep splat due to the possible deadlock of grp->list_mutex of each sequencer client object. Actually this is rather a false-positive report due to the missing nested lock annotations. The sequencer client may deliver the event directly to another client which takes another own lock. For addressing this issue, this patch replaces the simple down_read() with down_read_nested(). As a lock subclass, the already existing "hop" can be re-used, which indicates the depth of the call. Reference: http://lkml.kernel.org/r/089e082686ac9b482e055c832617@google.com Reported-by: syzbot <bot+7feb8de6b4d6bf810cf098bef942cc387e79d0ad@syzkaller.appspotmail.com> Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/seq/seq_clientmgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 7b5a7902b7a2..c789f91b4c2a 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -676,7 +676,7 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
if (atomic)
read_lock(&grp->list_lock);
else
- down_read(&grp->list_mutex);
+ down_read_nested(&grp->list_mutex, hop);
list_for_each_entry(subs, &grp->list_head, src_list) {
/* both ports ready? */
if (atomic_read(&subs->ref_count) != 2)