|
From: Blaisorblade <bla...@ya...> - 2004-10-28 23:05:43
|
On Wednesday 27 October 2004 16:21, Bodo Stroesser wrote: > Bodo Stroesser wrote: > > BlaisorBlade wrote: > >> Yes - I forgot it. Does the revised version work? My version did not - > >> it failed the startup test. In fact, PTRACE_CONT is called in the > >> startup test (which fails). I'm recompiling and testing. > > Yes. My system works very fine with it. > Now I've tested with host 2.6.9 and skas3.v6 patch. I adapted my latest > patch and had problems with singlestepping on UML in SKAS with sSYSEMU. > It looped receiving SIGTRAPs without moving forward. EIP of the traced > process was the same for all SIGTRAPs. > What's missing is to handle switching from PTRACE_SYSCALL_EMU to > PTRACE_SINGLESTEP in a way very similar to what is done for the change > from PTRACE_SYSCALL_EMU to PTRACE_SYSCALL_TRACE. > Here is the corresponding patch. Ok, I separated it from the other one. > P.S.: When testing UML 2.6.9 in SAKS on host 2.6.9, UML didn't terminate > after init 0. kernel-process and userspace-process didn't go out at the > end. ps aux shows S+ for kernel and T+ for userspace. I only could kill > them with kill -9 kernel-pid. After having done this, the host can't > unmount its filesystems: "in use". Doesn't that look like a host-bug? No, simply UML should use PTRACE_KILL rather than sending SIGKILL itself. It always just *happened* to work. I was just about to release -v7 - I'll hold on it a bit more to include your fix. Then I'll do releases for 2.6.7 and 2.6.9. > --- a/arch/i386/kernel/ptrace.c 2004-10-27 10:13:55.515622561 +0200 > +++ b/arch/i386/kernel/ptrace.c 2004-10-27 10:21:01.958150451 +0200 > @@ -367,16 +367,21 @@ asmlinkage int sys_ptrace(long request, > ret = -EIO; > if ((unsigned long) data > _NSIG) > break; > + /* If we came here with PTRACE_SYSEMU and now continue with > + * PTRACE_SYSCALL, entry.S used to intercept the syscall return. But it > + * shouldn't! > + * So we don't clear TIF_SYSCALL_EMU, which is always unused in this > + * special case, to remember, we came from SYSEMU. That flag > + * will be cleared by do_syscall_trace(). > + */ I updated this comment. Also, I'm thinking to the PTRACE_CONT case: shouldn't it get the same special treatment? Ok, probably not, because I guess we won't be running do_syscall_trace in that case. After that, it seems there is no other way to wake up a process, right? If there is anything else, then we need to fix that, too. I have idea we need something more robust, i.e. a return path avoiding altogether the 2nd do_syscall_trace call, like it happened in 2.4. Now, My Mighty Bodo, after cleaning up the issues about collecting your patches, could you try to understand also why strace does not work with SYSEMU on? Even switching SYSEMU off through /proc/sysemu avoids that. It seems to be a guest-only problem, since the UML debugger code seems totally unrelated to the syscall interception on the host. Also, something strange is that when not enabling network support, strace printed out some network syscalls, with bogus return values, even with SYSEMU active. Bye and thanks again! -- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 |