diff options
author | Bodo Stroesser <bstroesser@fujitsu-siemens.com> | 2005-09-03 18:57:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:06:24 -0400 |
commit | 07bf731e4b95d7c9ea9dbacd1fc4a041120dfffb (patch) | |
tree | 25ae7f2000421d45e484abac0b7252809476c0d0 /arch/um/sys-i386/stub.S | |
parent | 8b51304ed3184826fb262c1e9d3e58b0b00fd083 (diff) |
[PATCH] uml: skas0 stubs now check system call return values
Change syscall-stub's data to include a "expected retval".
Stub now checks syscalls retval and aborts execution of syscall list, if
retval != expected retval.
run_syscall_stub prints the data of the failed syscall, using the data pointer
and retval written by the stub to the beginning of the stack.
one_syscall_stub is removed, to simplify code, because only some instructions
are saved by one_syscall_stub, no host-syscall.
Using the stub with additional data (modify_ldt via stub)
is prepared also.
Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/sys-i386/stub.S')
-rw-r--r-- | arch/um/sys-i386/stub.S | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/arch/um/sys-i386/stub.S b/arch/um/sys-i386/stub.S index a0f9506312d1..6a70d9ab5c29 100644 --- a/arch/um/sys-i386/stub.S +++ b/arch/um/sys-i386/stub.S | |||
@@ -2,24 +2,50 @@ | |||
2 | 2 | ||
3 | .globl syscall_stub | 3 | .globl syscall_stub |
4 | .section .__syscall_stub, "x" | 4 | .section .__syscall_stub, "x" |
5 | syscall_stub: | ||
6 | int $0x80 | ||
7 | mov %eax, UML_CONFIG_STUB_DATA | ||
8 | int3 | ||
9 | 5 | ||
10 | .globl batch_syscall_stub | 6 | .globl batch_syscall_stub |
11 | batch_syscall_stub: | 7 | batch_syscall_stub: |
12 | mov $UML_CONFIG_STUB_DATA, %esp | 8 | /* load pointer to first operation */ |
13 | again: pop %eax | 9 | mov $(UML_CONFIG_STUB_DATA+8), %esp |
10 | |||
11 | again: | ||
12 | /* load length of additional data */ | ||
13 | mov 0x0(%esp), %eax | ||
14 | |||
15 | /* if(length == 0) : end of list */ | ||
16 | /* write possible 0 to header */ | ||
17 | mov %eax, UML_CONFIG_STUB_DATA+4 | ||
14 | cmpl $0, %eax | 18 | cmpl $0, %eax |
15 | jz done | 19 | jz done |
20 | |||
21 | /* save current pointer */ | ||
22 | mov %esp, UML_CONFIG_STUB_DATA+4 | ||
23 | |||
24 | /* skip additional data */ | ||
25 | add %eax, %esp | ||
26 | |||
27 | /* load syscall-# */ | ||
28 | pop %eax | ||
29 | |||
30 | /* load syscall params */ | ||
16 | pop %ebx | 31 | pop %ebx |
17 | pop %ecx | 32 | pop %ecx |
18 | pop %edx | 33 | pop %edx |
19 | pop %esi | 34 | pop %esi |
20 | pop %edi | 35 | pop %edi |
21 | pop %ebp | 36 | pop %ebp |
37 | |||
38 | /* execute syscall */ | ||
22 | int $0x80 | 39 | int $0x80 |
40 | |||
41 | /* check return value */ | ||
42 | pop %ebx | ||
43 | cmp %ebx, %eax | ||
44 | je again | ||
45 | |||
46 | done: | ||
47 | /* save return value */ | ||
23 | mov %eax, UML_CONFIG_STUB_DATA | 48 | mov %eax, UML_CONFIG_STUB_DATA |
24 | jmp again | 49 | |
25 | done: int3 | 50 | /* stop */ |
51 | int3 | ||