]> git.hungrycats.org Git - linux/commitdiff
ALSA: seq: Avoid invalid lockdep class warning
authorTakashi Iwai <tiwai@suse.de>
Mon, 6 Nov 2017 19:16:50 +0000 (20:16 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 1 Jan 2018 20:52:05 +0000 (20:52 +0000)
commit 3510c7aa069aa83a2de6dab2b41401a198317bdc upstream.

The recent fix for adding rwsem nesting annotation was using the given
"hop" argument as the lock subclass key.  Although the idea itself
works, it may trigger a kernel warning like:
  BUG: looking up invalid subclass: 8
  ....
since the lockdep has a smaller number of subclasses (8) than we
currently allow for the hops there (10).

The current definition is merely a sanity check for avoiding the too
deep delivery paths, and the 8 hops are already enough.  So, as a
quick fix, just follow the max hops as same as the max lockdep
subclasses.

Fixes: 1f20f9ff57ca ("ALSA: seq: Fix nested rwsem annotation for lockdep splat")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
include/sound/seq_kernel.h

index 2398521f0998e5ab0ecce6e87728d35e533d6a38..d06bb8109cdcba55716a7dbbd50b2fa1e83c609d 100644 (file)
@@ -55,7 +55,8 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t;
 #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS        200
 
 /* max delivery path length */
-#define SNDRV_SEQ_MAX_HOPS             10
+/* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
+#define SNDRV_SEQ_MAX_HOPS             8
 
 /* max size of event size */
 #define SNDRV_SEQ_MAX_EVENT_LEN                0x3fffffff