diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-07-03 12:34:44 -0700 |
---|---|---|
committer | Andy Lutomirski <luto@amacapital.net> | 2014-07-03 12:34:44 -0700 |
commit | 2cb30ed696bae0d4bdd882b5be3e05d07beb166e (patch) | |
tree | 37c0277443059a48d0b103b591f4b948e6eec842 | |
parent | 30d35d95f576fb266fc7537fa8c59c04755f7fa0 (diff) | |
download | misc-tests-2cb30ed696bae0d4bdd882b5be3e05d07beb166e.tar.gz |
Add highsys to test syscall high bits
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | highsys.c | 18 |
3 files changed, 20 insertions, 1 deletions
@@ -4,6 +4,7 @@ evil-clock-test context_switch_latency kernel_pf user_visible_state +highpid *~ *_32 *_64 @@ -1,6 +1,6 @@ .PHONY: all clean -SIMPLE_C_TARGETS := dump-vdso dump-vvar dump-vsyscall context_switch_latency kernel_pf user_visible_state null_seccomp +SIMPLE_C_TARGETS := dump-vdso dump-vvar dump-vsyscall context_switch_latency kernel_pf user_visible_state null_seccomp highsys SIMPLE_CC_TARGETS := evil-clock-test diff --git a/highsys.c b/highsys.c new file mode 100644 index 0000000..93eb45e --- /dev/null +++ b/highsys.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <sys/syscall.h> + +static long high_getpid(void) +{ + long ret; + asm volatile ("syscall" : + "=a" (ret) : + "a" (SYS_getpid | 0xbaadf00d00000000ULL) : + "memory", "cc", "rcx", "r11"); + return ret; +} + +int main() +{ + printf("high_getpid says %ld\n", high_getpid()); + return 0; +} |