android_kernel_oneplus_msm8998/tools/lib/lockdep
Ben Hutchings 0d6ee0bea8 tools/lib/lockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain/: Depth
commit 98dcea0cfd04e083ac74137ceb9a632604740e2d upstream.

liblockdep has been broken since commit 75dd602a5198 ("lockdep: Fix
lock_chain::base size"), as that adds a check that MAX_LOCK_DEPTH is
within the range of lock_chain::depth and in liblockdep it is much
too large.

That should have resulted in a compiler error, but didn't because:

- the check uses ARRAY_SIZE(), which isn't yet defined in liblockdep
  so is assumed to be an (undeclared) function
- putting a function call inside a BUILD_BUG_ON() expression quietly
  turns it into some nonsense involving a variable-length array

It did produce a compiler warning, but I didn't notice because
liblockdep already produces too many warnings if -Wall is enabled
(which I'll fix shortly).

Even before that commit, which reduced lock_chain::depth from 8 bits
to 6, MAX_LOCK_DEPTH was too large.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: a.p.zijlstra@chello.nl
Link: http://lkml.kernel.org/r/20170525130005.5947-3-alexander.levin@verizon.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-21 07:44:56 +02:00
..
include/liblockdep tools/liblockdep: explicitly declare lockdep API we call from liblockdep 2015-11-06 16:01:37 -05:00
tests liblockdep: Add pthread_rwlock_t test suite 2013-11-27 11:55:24 +01:00
uinclude tools/lib/lockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain/: Depth 2017-07-21 07:44:56 +02:00
.gitignore tools/liblockdep: ignore generated .so file 2015-01-29 21:55:19 -05:00
Build tools lib lockdep: Use tools build framework 2015-02-12 17:56:01 -03:00
common.c tools/liblockdep: remove task argument from debug_check_no_locks_held 2015-11-06 16:01:29 -05:00
lockdep liblockdep: Add the 'lockdep' user-space utility 2013-11-27 11:56:25 +01:00
lockdep.c liblockdep: Wrap kernel/locking/lockdep.c to allow usage from userspace 2013-11-27 11:55:21 +01:00
lockdep_internals.h liblockdep: Wrap kernel/locking/lockdep.c to allow usage from userspace 2013-11-27 11:55:21 +01:00
lockdep_states.h liblockdep: Wrap kernel/locking/lockdep.c to allow usage from userspace 2013-11-27 11:55:21 +01:00
Makefile tools build: Build fixdep helper from perf and basic libs 2015-09-28 15:50:55 -03:00
preload.c tools/liblockdep: Use the rbtree header provided by common tools headers 2015-08-25 09:44:23 +02:00
rbtree.c liblockdep: Wrap kernel/locking/lockdep.c to allow usage from userspace 2013-11-27 11:55:21 +01:00
run_tests.sh tools/liblockdep: Mark runtests.sh as executable 2014-02-26 21:21:59 -05:00