Skip to content

Commit 8c76e31

Browse files
committed
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Thomas Gleixner: "Two final locking fixes for 4.15: - Repair the OWNER_DIED logic in the futex code which got wreckaged with the recent fix for a subtle race condition. - Prevent the hard lockup detector from triggering when dumping all held locks in the system" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/lockdep: Avoid triggering hardlockup from debug_show_all_locks() futex: Fix OWNER_DEAD fixup
2 parents c4e0ca7 + 88f1c87 commit 8c76e31

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

kernel/futex.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,9 +2311,6 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,
23112311
raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock);
23122312

23132313
oldowner = pi_state->owner;
2314-
/* Owner died? */
2315-
if (!pi_state->owner)
2316-
newtid |= FUTEX_OWNER_DIED;
23172314

23182315
/*
23192316
* We are here because either:
@@ -2374,6 +2371,9 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,
23742371
}
23752372

23762373
newtid = task_pid_vnr(newowner) | FUTEX_WAITERS;
2374+
/* Owner died? */
2375+
if (!pi_state->owner)
2376+
newtid |= FUTEX_OWNER_DIED;
23772377

23782378
if (get_futex_value_locked(&uval, uaddr))
23792379
goto handle_fault;

kernel/locking/lockdep.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <linux/gfp.h>
5050
#include <linux/random.h>
5151
#include <linux/jhash.h>
52+
#include <linux/nmi.h>
5253

5354
#include <asm/sections.h>
5455

@@ -4490,6 +4491,7 @@ void debug_show_all_locks(void)
44904491
if (!unlock)
44914492
if (read_trylock(&tasklist_lock))
44924493
unlock = 1;
4494+
touch_nmi_watchdog();
44934495
} while_each_thread(g, p);
44944496

44954497
pr_warn("\n");

0 commit comments

Comments
 (0)