diff options
author | Thomas Gleixner | 2019-04-14 19:51:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2019-04-27 09:36:38 +0200 |
commit | 5680b0635cdab1a1afb4f2078226584e008008b0 (patch) | |
tree | 9e449c9048863a09957512ee8db519fa045a74f9 /kernel/time/tick-common.c | |
parent | perf/x86: Fix incorrect PEBS_REGS (diff) | |
download | kernel-qcow2-linux-5680b0635cdab1a1afb4f2078226584e008008b0.tar.gz kernel-qcow2-linux-5680b0635cdab1a1afb4f2078226584e008008b0.tar.xz kernel-qcow2-linux-5680b0635cdab1a1afb4f2078226584e008008b0.zip |
x86/speculation: Prevent deadlock on ssb_state::lock
commit 2f5fb19341883bb6e37da351bc3700489d8506a7 upstream.
Mikhail reported a lockdep splat related to the AMD specific ssb_state
lock:
CPU0 CPU1
lock(&st->lock);
local_irq_disable();
lock(&(&sighand->siglock)->rlock);
lock(&st->lock);
<Interrupt>
lock(&(&sighand->siglock)->rlock);
*** DEADLOCK ***
The connection between sighand->siglock and st->lock comes through seccomp,
which takes st->lock while holding sighand->siglock.
Make sure interrupts are disabled when __speculation_ctrl_update() is
invoked via prctl() -> speculation_ctrl_update(). Add a lockdep assert to
catch future offenders.
Fixes: 1f50ddb4f418 ("x86/speculation: Handle HT correctly on AMD")
Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Cc: Thomas Lendacky <thomas.lendacky@amd.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1904141948200.4917@nanos.tec.linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/time/tick-common.c')
0 files changed, 0 insertions, 0 deletions