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/skas/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/skas/tlb.c')
-rw-r--r-- | arch/um/kernel/skas/tlb.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/um/kernel/skas/tlb.c b/arch/um/kernel/skas/tlb.c index 4b5fd2049547..6e84963dfc29 100644 --- a/arch/um/kernel/skas/tlb.c +++ b/arch/um/kernel/skas/tlb.c | |||
@@ -18,30 +18,31 @@ | |||
18 | #include "os.h" | 18 | #include "os.h" |
19 | #include "tlb.h" | 19 | #include "tlb.h" |
20 | 20 | ||
21 | static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, | 21 | static int do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, |
22 | int finished, void *flush) | 22 | int finished, void **flush) |
23 | { | 23 | { |
24 | struct host_vm_op *op; | 24 | struct host_vm_op *op; |
25 | int i; | 25 | int i, ret = 0; |
26 | 26 | ||
27 | for(i = 0; i <= last; i++){ | 27 | for(i = 0; i <= last && !ret; i++){ |
28 | op = &ops[i]; | 28 | op = &ops[i]; |
29 | switch(op->type){ | 29 | switch(op->type){ |
30 | case MMAP: | 30 | case MMAP: |
31 | flush = map(&mmu->skas.id, op->u.mmap.addr, | 31 | ret = map(&mmu->skas.id, op->u.mmap.addr, |
32 | op->u.mmap.len, op->u.mmap.r, op->u.mmap.w, | 32 | op->u.mmap.len, op->u.mmap.r, op->u.mmap.w, |
33 | op->u.mmap.x, op->u.mmap.fd, | 33 | op->u.mmap.x, op->u.mmap.fd, |
34 | op->u.mmap.offset, finished, flush); | 34 | op->u.mmap.offset, finished, flush); |
35 | break; | 35 | break; |
36 | case MUNMAP: | 36 | case MUNMAP: |
37 | flush = unmap(&mmu->skas.id, (void *) op->u.munmap.addr, | 37 | ret = unmap(&mmu->skas.id, |
38 | op->u.munmap.len, finished, flush); | 38 | (void *) op->u.munmap.addr, |
39 | op->u.munmap.len, finished, flush); | ||
39 | break; | 40 | break; |
40 | case MPROTECT: | 41 | case MPROTECT: |
41 | flush = protect(&mmu->skas.id, op->u.mprotect.addr, | 42 | ret = protect(&mmu->skas.id, op->u.mprotect.addr, |
42 | op->u.mprotect.len, op->u.mprotect.r, | 43 | op->u.mprotect.len, op->u.mprotect.r, |
43 | op->u.mprotect.w, op->u.mprotect.x, | 44 | op->u.mprotect.w, op->u.mprotect.x, |
44 | finished, flush); | 45 | finished, flush); |
45 | break; | 46 | break; |
46 | default: | 47 | default: |
47 | printk("Unknown op type %d in do_ops\n", op->type); | 48 | printk("Unknown op type %d in do_ops\n", op->type); |
@@ -49,7 +50,7 @@ static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, | |||
49 | } | 50 | } |
50 | } | 51 | } |
51 | 52 | ||
52 | return flush; | 53 | return ret; |
53 | } | 54 | } |
54 | 55 | ||
55 | extern int proc_mm; | 56 | extern int proc_mm; |