kernel-fxtec-pro1x/arch
Thomas Gleixner 5680b0635c 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: 1f50ddb4f4 ("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>
2019-04-27 09:36:38 +02:00
..
alpha
arc arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM 2019-04-20 09:15:54 +02:00
arm ARM: 8839/1: kprobe: make patch_lock a raw_spinlock_t 2019-04-20 09:16:04 +02:00
arm64 arm64: futex: Restore oldval initialization to work around buggy compilers 2019-04-27 09:36:37 +02:00
c6x
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:32:55 +02:00
hexagon
ia64
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 20:10:00 +01:00
microblaze
mips MIPS: Fix kernel crash for R6 in jump label branch function 2019-03-27 14:14:39 +09:00
nds32
nios2
openrisc
parisc parisc: also set iaoq_b in instruction_pointer_set() 2019-04-17 08:38:49 +02:00
powerpc powerpc/pseries: Remove prrn_work workqueue 2019-04-20 09:16:01 +02:00
riscv riscv: Fix syscall_get_arguments() and syscall_set_arguments() 2019-04-17 08:38:51 +02:00
s390 perf/aux: Make perf_event accessible to setup_aux() 2019-04-05 22:33:11 +02:00
sh
sparc
um
unicore32
x86 x86/speculation: Prevent deadlock on ssb_state::lock 2019-04-27 09:36:38 +02:00
xtensa xtensa: fix return_address 2019-04-17 08:38:53 +02:00
.gitignore
Kconfig