android_kernel_xiaomi_sm8450/arch
Peter Zijlstra b31bac0619 x86/iopl: Fake iopl(3) CLI/STI usage
commit b968e84b509da593c50dc3db679e1d33de701f78 upstream.

Since commit c8137ace56 ("x86/iopl: Restrict iopl() permission
scope") it's possible to emulate iopl(3) using ioperm(), except for
the CLI/STI usage.

Userspace CLI/STI usage is very dubious (read broken), since any
exception taken during that window can lead to rescheduling anyway (or
worse). The IOPL(2) manpage even states that usage of CLI/STI is highly
discouraged and might even crash the system.

Of course, that won't stop people and HP has the dubious honour of
being the first vendor to be found using this in their hp-health
package.

In order to enable this 'software' to still 'work', have the #GP treat
the CLI/STI instructions as NOPs when iopl(3). Warn the user that
their program is doing dubious things.

Fixes: a24ca99768 ("x86/iopl: Remove legacy IOPL option")
Reported-by: Ondrej Zary <linux@zary.sk>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org # v5.5+
Link: https://lkml.kernel.org/r/20210918090641.GD5106@worktop.programming.kicks-ass.net
Signed-off-by: Ondrej Zary <linux@zary.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-21 13:46:36 +01:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-09-30 10:11:07 +02:00
arc ARC: export clear_user_page() for modules 2021-09-22 12:28:04 +02:00
arm ARM: 9156/1: drop cc-option fallbacks for architecture selection 2021-11-18 14:04:28 +01:00
arm64 arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions 2021-11-18 14:04:27 +01:00
c6x arch-cleanup-2020-10-22 2020-10-23 10:06:38 -07:00
csky csky: Fixup regs.sr broken in ptrace 2021-10-20 11:44:58 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:05:53 +02:00
ia64 ia64: don't do IA64_CMPXCHG_DEBUG without CONFIG_PRINTK 2021-11-18 14:03:55 +01:00
m68k m68k: set a default value for MEMORY_RESERVE 2021-11-18 14:04:24 +01:00
microblaze local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
mips MIPS: Fix assembly error from MIPSr2 code used within MIPS_ISA_ARCH_LEVEL 2021-11-18 14:04:29 +01:00
nds32 nds32: fix up stack guard gap 2021-07-28 14:35:46 +02:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-11-02 19:48:23 +01:00
openrisc openrisc: fix SMP tlb flush NULL pointer dereference 2021-11-18 14:04:25 +01:00
parisc parisc: Fix backtrace to always include init funtion names 2021-11-18 14:04:28 +01:00
powerpc powerpc/85xx: fix timebase sync issue when CONFIG_HOTPLUG_CPU=n 2021-11-18 14:04:31 +01:00
riscv riscv: Fix asan-stack clang build 2021-11-02 19:48:25 +01:00
s390 KVM: s390: Fix handle_sske page fault handling 2021-11-18 14:04:11 +01:00
sh signal/sh: Use force_sig(SIGKILL) instead of do_group_exit(SIGKILL) 2021-11-18 14:04:24 +01:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:40:56 +02:00
um um: virtio_uml: fix memory leak on init failures 2021-09-26 14:08:57 +02:00
x86 x86/iopl: Fake iopl(3) CLI/STI usage 2021-11-21 13:46:36 +01:00
xtensa xtensa: xtfpga: Try software restart before simulating CPU reset 2021-10-27 09:56:47 +02:00
.gitignore
Kconfig arch/cc: Introduce a function to check for confidential computing features 2021-11-18 14:04:32 +01:00