linux-stable/arch/x86
Peter Zijlstra b968e84b50 x86/iopl: Fake iopl(3) CLI/STI usage
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
2021-09-21 13:52:18 +02:00
..
boot Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
configs configs: remove the obsolete CONFIG_INPUT_POLLDEV 2021-09-08 11:50:28 -07:00
crypto crypto: aesni - xts_crypt() return if walk.nbytes is 0 2021-08-27 16:30:19 +08:00
entry compat: remove some compat entry points 2021-09-08 15:32:35 -07:00
events perf/x86/amd/ibs: Add bitfield definitions in new <asm/amd-ibs.h> header 2021-08-26 09:14:36 +02:00
hyperv
ia32 binfmt: remove in-tree usage of MAP_DENYWRITE 2021-09-03 18:42:01 +02:00
include x86/iopl: Fake iopl(3) CLI/STI usage 2021-09-21 13:52:18 +02:00
kernel x86/iopl: Fake iopl(3) CLI/STI usage 2021-09-21 13:52:18 +02:00
kvm ARM: 2021-09-07 13:40:51 -07:00
lib x86/iopl: Fake iopl(3) CLI/STI usage 2021-09-21 13:52:18 +02:00
math-emu
mm Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
net
pci pci-v5.15-changes 2021-09-07 19:13:42 -07:00
platform
power x86/power: Fix kernel-doc warnings in cpu.c 2021-08-12 10:15:40 +02:00
purgatory
ras
realmode memblock: make memblock_find_in_range method private 2021-09-03 09:58:17 -07:00
tools - Remove cc-option checks which are old and already supported by the 2021-08-30 13:27:16 -07:00
um um: fix stub location calculation 2021-08-26 22:28:03 +02:00
video
xen xen: remove stray preempt_disable() from PV AP startup code 2021-09-01 10:39:27 +02:00
.gitignore
Kbuild
Kconfig Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
Makefile.um
Makefile_32.cpu x86: remove cc-option-yn test for -mtune= 2021-09-03 08:17:20 +09:00