linux-stable/arch
David Kaplan 585172ff4c x86/cpu: Fix check for RDPKRU in __show_regs()
commit b53c6bd5d2 upstream.

cpu_feature_enabled(X86_FEATURE_OSPKE) does not necessarily reflect
whether CR4.PKE is set on the CPU.  In particular, they may differ on
non-BSP CPUs before setup_pku() is executed.  In this scenario, RDPKRU
will #UD causing the system to hang.

Fix by checking CR4 for PKE enablement which is always correct for the
current CPU.

The scenario happens by inserting a WARN* before setup_pku() in
identiy_cpu() or some other diagnostic which would lead to calling
__show_regs().

  [ bp: Massage commit message. ]

Signed-off-by: David Kaplan <david.kaplan@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240421191728.32239-1-bp@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-02 16:35:24 +02:00
..
alpha RTC for 6.8 2024-01-18 17:25:39 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:35:14 +02:00
arm ARM: dts: imx6ull-tarragon: fix USB over-current polarity 2024-05-02 16:35:21 +02:00
arm64 arm64: dts: qcom: sc8180x: Fix ss_phy_irq for secondary USB controller 2024-05-02 16:35:13 +02:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:32:39 +02:00
loongarch LoongArch/crypto: Clean up useless assignment operations 2024-04-03 15:32:25 +02:00
m68k kbuild: use 4-space indentation when followed by conditionals 2024-02-15 06:05:44 +09:00
microblaze Microblaze patches for 6.8-rc1 2024-01-17 11:27:23 -08:00
mips mips: cm: Convert __mips_cm_l2sync_phys_base() to weak function 2024-03-26 18:17:21 -04:00
nios2 percpu: 2024-01-18 15:01:28 -08:00
openrisc
parisc prctl: generalize PR_SET_MDWE support check to be per-arch 2024-04-03 15:32:37 +02:00
powerpc mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:38:00 +02:00
riscv riscv: process: Fix kernel gp leakage 2024-04-10 16:38:20 +02:00
s390 s390/entry: align system call table on 8 bytes 2024-04-10 16:38:20 +02:00
sh sh updates for v6.8 2024-01-20 09:24:06 -08:00
sparc mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:38:00 +02:00
um work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
x86 x86/cpu: Fix check for RDPKRU in __show_regs() 2024-05-02 16:35:24 +02:00
xtensa work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-01-25 23:52:21 -08:00