TencentOS-kernel/tools
Andy Lutomirski 3cbbfad519 selftests/x86: Add a syscall_arg_fault_64 test for negative GSBASE
commit a5d25e01c8146ad8846da4760422e12242fceafe upstream.
Backport summary: for 5.4 kernel fsgsbase support.

If the kernel erroneously allows WRGSBASE and user code writes a
negative value, paranoid_entry will get confused. Check for this by
writing a negative value to GSBASE and doing SYSENTER with TF set. A
successful run looks like:

    [RUN]	SYSENTER with TF, invalid state, and GSBASE < 0
    [SKIP]	Illegal instruction

A failed run causes a kernel hang, and I believe it's because we
double-fault and then get a never ending series of page faults and,
when we exhaust the double fault stack we double fault again,
starting the process over.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/f4f71efc91b9eae5e3dae21c9aee1c70cf5f370e.1590620529.git.luto@kernel.org
(cherry picked from commit a5d25e01c8146ad8846da4760422e12242fceafe)
Signed-off-by: Ethan Zhao <Haifeng.Zhao@intel.com>
2021-08-17 06:29:11 +00:00
..
accounting Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arch ia64: tools: remove duplicate definition of ia64_mf() on ia64 2021-05-20 16:07:15 +08:00
bpf bpftool: Fix compilation failure for net.o with older glibc 2021-04-12 12:51:19 +08:00
build tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-04-12 12:51:42 +08:00
cgroup iocost_monitor: drop string wrap around numbers when outputting json 2021-03-16 16:29:27 +08:00
debugging Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
firewire Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
firmware Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gpio tools: gpio-hammer: Avoid potential overflow in main 2021-03-16 16:37:05 +08:00
hv Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
include merge bpf_get_netns_cookie from f318903c0bf42448b4c884732df2bbb0ef7a2284. 2021-03-16 16:43:59 +08:00
io_uring tools/io_uring: fix compile breakage 2021-03-16 16:37:47 +08:00
kvm/kvm_stat Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
laptop Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
leds Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lib libbpf: Fix BTF dump of pointer-to-array-of-struct 2021-04-12 12:53:30 +08:00
memory-model Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nfsd Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
objtool objtool: Fix ".cold" section suffix check for newer versions of GCC 2021-04-12 12:52:25 +08:00
pci Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pcmcia Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
perf perf beauty: Fix fsconfig generator 2021-05-20 16:07:58 +08:00
power tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-04-12 12:51:42 +08:00
scripts tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-04-12 12:51:42 +08:00
spi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
testing selftests/x86: Add a syscall_arg_fault_64 test for negative GSBASE 2021-08-17 06:29:11 +00:00
thermal/tmon Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
time Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
usb usbip: tools: fix build error for multiple definition 2021-04-12 12:52:52 +08:00
virtio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vm tools/vm: fix cross-compile build 2021-03-16 16:26:57 +08:00
wmi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00