-
Notifications
You must be signed in to change notification settings - Fork 75
Rneri/umip exceptions #125
base: master
Are you sure you want to change the base?
Commits on Jan 13, 2017
-
core-image-efi-initramfs: remove unneeded components for UMIP
This is a special flavor of LUV for UMIP. Remove all the unneeded packages. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4d10d5d - Browse repository at this point
Copy the full SHA 4d10d5dView commit details -
live-vm-common: hack: bloat boot partition with a useless file
I need this file to increase the size of the boot partition, whose size is calculated by the files it contains. The extra space created by this file makes it easy to add/replace files that are bigger than the originals. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 865a8a3 - Browse repository at this point
Copy the full SHA 865a8a3View commit details
Commits on Mar 3, 2017
-
meta-luv: add recipe for User-Mode Instruction Prevention
User-Mode Instruction Prevention (UMIP) is a security feature present in new Intel Processors. If enabled, it prevents the execution of certain instructions if the Current Privilege Level (CPL) is greater than 0. If these instructions were executed while in CPL > 0, user space applications could have access to system-wide settings such as the global and local descriptor tables, the task register and the interrupt descriptor table. These are the instructions covered by UMIP: * 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 any of these instructions is executed with CPL > 0, a general protection exception is issued when UMIP is enbled. This recipe adds two sample user-space programs that exercises all the possible combinations of memory and register operands for the aforementioned instructions. This helps to validate the emulation code for such instuctions within the Linux kernel. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d7aa262 - Browse repository at this point
Copy the full SHA d7aa262View commit details -
luv-yocto-efi-test: add kernel selftests for UMIP
Ideally, we might want to add these patches in the vm86-test recipe. Unfortunately, such recipe uses the kernel-source directory to build its artifacts. Thus, we have no option but to apply the patches here. The first patch contains tests that are representative of UMIP use cases. The second patch test UMIP emulation extensively by exercising all the possible combinations of operands and displacement in 16-bit addressing encodings. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a72a7fe - Browse repository at this point
Copy the full SHA a72a7feView commit details -
meta-luv: add recipe for virtual-8086 mode kernel selftests
Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 30e7b0f - Browse repository at this point
Copy the full SHA 30e7b0fView commit details
Commits on Mar 24, 2017
-
umip: umip_test2: correct print size of expected values
When checking for the return values of SMSW, SLDT and STR, we use memory operands. Thus, the expected return values are 16-bit. There is no need to use a long lenght field. This helps us to prevent build warnings such as: umip_test2.c:262:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=] pr_info("====Checking SLDT. Expected value: [0x%lx]====\n", expected_ldt); ^ Signed-off-by: Ricardo Neri <[email protected]> umip_test2.c:262:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=] pr_info("====Checking SLDT. Expected value: [0x%lx]====\n", expected_ldt); ^ Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 883c533 - Browse repository at this point
Copy the full SHA 883c533View commit details -
umip: umip_test2: cast shorts to unsigned longs
The family of macros CHECK_ALLreg and CHECK_ALLmem can use operands of 16, 32 and 64 bits. Thus, the variables we pass should be the largest of them: longs. Otherwise, we see warnings such as: umip_test2.c:252:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘int’ [-Wformat=] CHECK_ALLmem("smsw", val, INIT_MSW, expected_msw); ^ Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2034f42 - Browse repository at this point
Copy the full SHA 2034f42View commit details -
There were many variables that we don't use. Remove them. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3d01575 - Browse repository at this point
Copy the full SHA 3d01575View commit details -
umip: make main functions return an int
Instead of returning nothing, have the main functions of test programs to return an integer. This makes warnings like this go away: normal_pf.c:58:6: warning: return type of ‘main’ is not ‘int’ [-Wmain] void main (void) Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fef1137 - Browse repository at this point
Copy the full SHA fef1137View commit details -
umip: umip_test: remove unneeded function get_mask
This function is not used anywhere. Get rid of it. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5488c56 - Browse repository at this point
Copy the full SHA 5488c56View commit details -
umip: umip_test: utilize %p instead of %lx to print pointers
This makes warning like this go away: umip_test.c:61:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned char *’ [-Wformat=] pr_info("Will issue SGDT and save at [0x%lx]\n", val); ^ Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1ce8f54 - Browse repository at this point
Copy the full SHA 1ce8f54View commit details -
umip: umip_ldt_16: Fix warning about implicit declaration of syscall
Apparently, it is not sufficient to include sys/syscall.h as it cannot find the prototype of syscall. Include also unistd.h and make this warning go away: umip_ldt_16.c:117:2: warning: implicit declaration of function ‘syscall’ [-Wimplicit-function-declaration] ret = syscall(SYS_modify_ldt, 1, &desc, sizeof(desc)); ^ Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 170aeb8 - Browse repository at this point
Copy the full SHA 170aeb8View commit details -
umip: umip_ldt_64: fix printing of uninitialized variable
We meant to check the return value of setup_data_segments. However, we did not save its return value in the variable we use to print the error. Correct this and avoid seeing this warning: umip_test_defs.h:13:23: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] #define pr_error(...) printf(TEST_ERROR __VA_ARGS__) ^ umip_ldt_64.c:97:6: note: ‘ret’ was declared here int ret; ^ gcc -Wall -o umip_ldt_64 test_umip_ldt_64.o umip_ldt_64.o Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 264eab1 - Browse repository at this point
Copy the full SHA 264eab1View commit details -
Old compilers will complain that 32-bit longs are too large to contains 64-bit long values. This is true even when they are OR'ed with a 32-bit mask. Thus, instead of OR'ing the value, take the 32-bit value and use it fill the most significant bytes of a 64-bit long. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 88849df - Browse repository at this point
Copy the full SHA 88849dfView commit details
Commits on Mar 25, 2017
-
umip: umip_test_gen_*: utilize a custom to-hex function
Python appends an L to any long number and Python decides what type of variable use based on its value. In most of the cases we will not implicitly deal with longs (i.e., most of the time our variables will have small values). However, to represent negative numbers we will rely on 2's complements and thus we will need long variables. To avoid the trailing L, use a custom my_hex function to convert a number to its hex representation. Reported-by: Qian Ouyang <[email protected]> Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 42427f4 - Browse repository at this point
Copy the full SHA 42427f4View commit details -
umip: umip_ldt_*: remove mmap MAP_32BIT option
This option only makes sense when buiding in x86_64 builds for 64-bit programs. umip_ldt_32 and umip_ldt_16 are 32-bit programs. Reported-by: Qian Ouyang <[email protected]> Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3f0584 - Browse repository at this point
Copy the full SHA f3f0584View commit details -
umip: umip_ldt_*: do not run tests from main
For reasons beyond my comprehension, certain versions of gcc use esp, not ebp, to refer to automatic variables in main. This is only true for main. This is a problem for these programs as they manipulate the stack. Hence, introduce a new function, called from main, that executes the actual tests. Reported-by: Qian Ouyang <[email protected]> Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2bcdd67 - Browse repository at this point
Copy the full SHA 2bcdd67View commit details
Commits on Apr 30, 2017
-
umip: normal_pf: relocate page fault tests to its own function
We do this for two reasons: a) some versions of gcc use r/esp, not r/ebp, to reference automatic variables. This has shown to cause problems in the past if we need to update r/esp. b) more exception handling tests will be added to this file. This is preparatory work. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0925de9 - Browse repository at this point
Copy the full SHA 0925de9View commit details -
umip: normal_pf: add support for SIGILL signal
Add support in the signal handler for SIGILL. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 645549b - Browse repository at this point
Copy the full SHA 645549bView commit details -
umip: normal_pf: add tests for the LOCK prefix
Add tests to verify that the UMIP-protected instructions generate a SIGILL when the LOCK instruction prefix is used. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4215dbc - Browse repository at this point
Copy the full SHA 4215dbcView commit details -
umip: normal_pf: add tests for SGDT/SIDT with registers as operands
The instructions SGDT and SIDT generate an #UD exception if the operands are registers. Tests that this actually happens. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d6ba694 - Browse repository at this point
Copy the full SHA d6ba694View commit details -
umip: normal_pf: test the use of null segment selectors
In 32-bit programs, the use of null segment selectors should cause a #GP(0) exception. Verify that this indeed happens. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eaa827a - Browse repository at this point
Copy the full SHA eaa827aView commit details -
umip: normal_pf: add tests for effective address outside of segment l…
…imits When the effective address is outside of the segment limits, a general protection fault should be issues. Test that this is the case. Signed-off-by: Ricardo Neri <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2b0d680 - Browse repository at this point
Copy the full SHA 2b0d680View commit details