Add Intel umip(User Mode Instruction Prevention) basic function tests
PATCH v6 1/1 Add Intel umip(User Mode Instruction Prevention) basic function tests
umip is a security feature present in new Intel Processors. Intel CPU like ICE lake or newer is required.
When umip enabled, it prevents the execution of certain instructions and situation as below:
when Current Privilege Level (CPL) is greater than 0, user space applications could not access to system-wide settings such as the global and local descriptor tables, the segment selectors to the current task state and the local descriptor table.
umip is enabled by default at boot.
umip will protect below instructions in user mode:
* SGDT - Store Global Descriptor Table
* SIDT - Store Interrupt Descriptor Table
* SLDT - Store Local Descriptor Table
* SMSW - Store Machine Status Word
* STR - Store Task Register
If CPU not support umip, you still could comment cpuinfo check code to verify anyway.
--- runtest/secure_umip | 2 + testcases/kernel/security/umip/.gitignore | 1 + testcases/kernel/security/umip/Makefile | 7 + testcases/kernel/security/umip/umip_basic_test.c | 174 +++++++++++++++++++++++ 4 files changed, 184 insertions(+) create mode 100644 runtest/secure_umip create mode 100644 testcases/kernel/security/umip/.gitignore create mode 100644 testcases/kernel/security/umip/Makefile create mode 100644 testcases/kernel/security/umip/umip_basic_test.c
runtest/secure_umip new file +2 -0
@@ -0,0 +1,2 @@ +#DESCRIPTION: CPU security feature UMIP test +umip_instruction_test umip_basic_test
testcases/kernel/security/umip/.gitignore new file +1 -0
@@ -0,0 +1 @@ +umip_basic_test
testcases/kernel/security/umip/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/security/umip/umip_basic_test.c new file +174 -0
174 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v6 1/1 Add Intel umip(User Mode Instruction Prevention) basic function tests
Hi!
Pushed with a few changes, thanks!
* added the kconfig requirement to the tst_test structure
* the whole test is now in #ifdef __x86_64__ (otherwise the asm statements would fail to compile on other architectures)
* moved the runtest entry to kernel_misc
(in order to avoid having runtest files with just one entry)
Signature · 2 lines
Cyril Hrubis [email protected]