Ok, the first thing is the cleanup of PTRACE_SYSEMU_SINGLESTEP. I've carefully
moved the handling to go near to PTRACE_SINGLESTEP. As said, it's needed also
to port this stuff to 2.6.10 easily (wrt the introduction of
The patch is attached both with only my changes, to go on top of the
add-SYSEMU_SINGLESTEP one, and in the merged form. They are both for 2.6.9.
I'm also going to release both 2.6.9-V8-rc2 and 2.6.10-V8-rc2 with this stuff.
I also added a patch about mm->dumpable (still in doubt whether to merge it).
Second thing: I've analyzed sysaudit-singlestep-umlhost.... the important
thing is #2 below.
1) there is some moving around of do_syscall_trace vars, which I've merged in
my cleanup (it's needed for item #3, however it's nice anyway); so I've
modified and reattached it.
2) I guess that the ptrace_disable() change (which clears TIF_SYSCALL_TRACE
and TIF_SYSCALL_EMU) is just cosmetical.
I verified that in kernel/ and arch/i386/kernel the only caller is
ptrace_detach (as the comment says), which later clears child->ptrace through
Since everything (I took this for granted) tests current->ptrace | PT_PTRACED,
correctness should be ok.
It hurts a bit performance, however, because we don't run inside the syscall
fastpath, and do one more conditional jump. We must discuss this with
3) a real fix for TIF_SYSCALL_AUDIT | TIF_SINGLESTEP, which is also correct
when setting TIF_SYSCALL_EMU too (I had doubts about this, since I was
missing that is_singlestep == 1 only for PTRACE_SINGLESTEP and not when doing
I want to merge it before 2.6.11.
We must in fact avoid to do the tracing for syscall entry, since
TIF_SINGLESTEP does not trigger inside entry.S the syscall tracing (see the
marked "testb" line below).
(around line 277 of arch/i386/kernel/entry.S):
pushl %eax # save orig_eax
# system call tracing in operation / emulation
//in the mask _TIF_SINGLESTEP is not set !!! <<<<<<<<<<<<<<
cmpl $(nr_syscalls), %eax
movl %eax,EAX(%esp) # store the return value
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729