]> mj.ucw.cz Git - eval.git/commit
Syscall handling reform
authorMartin Mares <mj@ucw.cz>
Sun, 5 Apr 2009 16:35:07 +0000 (18:35 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 5 Apr 2009 16:35:07 +0000 (18:35 +0200)
commitda21fed34b0cec9654e62188553f754a4bca9b1d
tree25c9d480279422deb705da25356b515b322ccfc1
parent60df4f1d5b7aa59fdf47d87e8352e108b35ffca2
Syscall handling reform

The previous code did not work with syscalls that do not return a value -- e.g.,
sysreturn(). In such cases, the kernel reports the exit from the syscall with
orig_eax == -1, which cannot be easily distinguished from a breakpoint.

I have rewritten the syscall checker to use the PTRACE_O_TRACESYSGOOD switch,
which causes the kernel to report syscalls in a slightly different way. Also,
the code now tests whether the syscall number on exit matched the one recorded
on entry (purely as a guard against possible silly bugs in synchronization
of syscall enter/exit reports with the kernel) and it also avoids suppresses
the meaningless return value of the sysreturn-like syscalls.
box/box.c