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/kernel/tt/tlb.c | |
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/kernel/tt/tlb.c')
-rw-r--r-- | arch/um/kernel/tt/tlb.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/um/kernel/tt/tlb.c b/arch/um/kernel/tt/tlb.c index 16fc6a28882d..f1d85dbb45b9 100644 --- a/arch/um/kernel/tt/tlb.c +++ b/arch/um/kernel/tt/tlb.c | |||
@@ -17,26 +17,31 @@ | |||
17 | #include "os.h" | 17 | #include "os.h" |
18 | #include "tlb.h" | 18 | #include "tlb.h" |
19 | 19 | ||
20 | static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, | 20 | static int do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, |
21 | int finished, void *flush) | 21 | int finished, void **flush) |
22 | { | 22 | { |
23 | struct host_vm_op *op; | 23 | struct host_vm_op *op; |
24 | int i; | 24 | int i, ret=0; |
25 | 25 | ||
26 | for(i = 0; i <= last; i++){ | 26 | for(i = 0; i <= last && !ret; i++){ |
27 | op = &ops[i]; | 27 | op = &ops[i]; |
28 | switch(op->type){ | 28 | switch(op->type){ |
29 | case MMAP: | 29 | case MMAP: |
30 | os_map_memory((void *) op->u.mmap.addr, op->u.mmap.fd, | 30 | ret = os_map_memory((void *) op->u.mmap.addr, |
31 | op->u.mmap.offset, op->u.mmap.len, | 31 | op->u.mmap.fd, op->u.mmap.offset, |
32 | op->u.mmap.r, op->u.mmap.w, | 32 | op->u.mmap.len, op->u.mmap.r, |
33 | op->u.mmap.x); | 33 | op->u.mmap.w, op->u.mmap.x); |
34 | break; | 34 | break; |
35 | case MUNMAP: | 35 | case MUNMAP: |
36 | os_unmap_memory((void *) op->u.munmap.addr, | 36 | ret = os_unmap_memory((void *) op->u.munmap.addr, |
37 | op->u.munmap.len); | 37 | op->u.munmap.len); |
38 | break; | 38 | break; |
39 | case MPROTECT: | 39 | case MPROTECT: |
40 | ret = protect_memory(op->u.mprotect.addr, | ||
41 | op->u.munmap.len, | ||
42 | op->u.mprotect.r, | ||
43 | op->u.mprotect.w, | ||
44 | op->u.mprotect.x, 1); | ||
40 | protect_memory(op->u.mprotect.addr, op->u.munmap.len, | 45 | protect_memory(op->u.mprotect.addr, op->u.munmap.len, |
41 | op->u.mprotect.r, op->u.mprotect.w, | 46 | op->u.mprotect.r, op->u.mprotect.w, |
42 | op->u.mprotect.x, 1); | 47 | op->u.mprotect.x, 1); |
@@ -47,7 +52,7 @@ static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, | |||
47 | } | 52 | } |
48 | } | 53 | } |
49 | 54 | ||
50 | return NULL; | 55 | return ret; |
51 | } | 56 | } |
52 | 57 | ||
53 | static void fix_range(struct mm_struct *mm, unsigned long start_addr, | 58 | static void fix_range(struct mm_struct *mm, unsigned long start_addr, |