tmp_suning_uos_patched/arch/x86/lib
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
..
.gitignore
atomic64_32.c
atomic64_386_32.S
atomic64_cx8_32.S
cache-smp.c
checksum_32.S i386: propagate the calling conventions change down to csum_partial_copy_generic() 2020-08-20 15:45:18 -04:00
clear_page_64.S
cmdline.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cmpxchg8b_emu.S
cmpxchg16b_emu.S
copy_mc_64.S x86/copy_mc: Introduce copy_mc_enhanced_fast_string() 2020-10-06 11:37:36 +02:00
copy_mc.c x86/copy_mc: Introduce copy_mc_enhanced_fast_string() 2020-10-06 11:37:36 +02:00
copy_page_64.S
copy_user_64.S x86/mce: Avoid tail copy when machine check terminated a copy from user 2020-10-07 11:26:56 +02:00
cpu.c
csum-copy_64.S amd64: switch csum_partial_copy_generic() to new calling conventions 2020-08-20 15:45:22 -04:00
csum-partial_64.c
csum-wrappers_64.c amd64: switch csum_partial_copy_generic() to new calling conventions 2020-08-20 15:45:22 -04:00
delay.c
error-inject.c
getuser.S Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-22 09:59:21 -07:00
hweight.S
inat.c
insn-eval.c x86/iopl: Fake iopl(3) CLI/STI usage 2021-11-21 13:46:36 +01:00
insn.c
iomap_copy_64.S
iomem.c
kaslr.c
Makefile * Extend the recovery from MCE in kernel space also to processes which 2020-10-12 10:14:38 -07:00
memcpy_32.c
memcpy_64.S x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S 2020-11-04 12:30:20 +01:00
memmove_64.S x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S 2020-11-04 12:30:20 +01:00
memset_64.S x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S 2020-11-04 12:30:20 +01:00
misc.c
mmx_32.c x86/mmx: Use KFPU_387 for MMX string operations 2021-01-27 11:55:13 +01:00
msr-reg-export.c
msr-reg.S
msr-smp.c x86/msr: Fix wr/rdmsr_safe_regs_on_cpu() prototypes 2021-05-22 11:40:51 +02:00
msr.c
putuser.S Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-22 09:59:21 -07:00
retpoline.S
string_32.c
strstr_32.c
usercopy_32.c
usercopy_64.c * Extend the recovery from MCE in kernel space also to processes which 2020-10-12 10:14:38 -07:00
usercopy.c
x86-opcode-map.txt