aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-12-06 17:39:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-12-06 17:39:44 -0800
commit189dbab0dddcf7d8525f32ae13d22ac95927fdb6 (patch)
treef72900c260b3f7612f94f37afca3619f3eb60b2d /kernel
parentMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
parentlocking/lockdep: Fix possible NULL deref (diff)
downloadlinux-dev-189dbab0dddcf7d8525f32ae13d22ac95927fdb6.tar.xz
linux-dev-189dbab0dddcf7d8525f32ae13d22ac95927fdb6.zip
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull lockdep fix from Ingo Molnar: "Fix a possible NULL dereference for the (rare) case when a task doesn't have ->xhlocks space allocated due to kmalloc() OOM-ing" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/lockdep: Fix possible NULL deref
Diffstat (limited to 'kernel')
-rw-r--r--kernel/locking/lockdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 9776da8db180..670d8d7d8087 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4790,7 +4790,8 @@ void lockdep_invariant_state(bool force)
* Verify the former, enforce the latter.
*/
WARN_ON_ONCE(!force && current->lockdep_depth);
- invalidate_xhlock(&xhlock(current->xhlock_idx));
+ if (current->xhlocks)
+ invalidate_xhlock(&xhlock(current->xhlock_idx));
}
static int cross_lock(struct lockdep_map *lock)