From: Yuri P. <yu...@as...> - 2000-09-19 20:07:06
|
Hello Jeff, I tested vanilla test7 with ptrace() patch. It breaks uml exactly like I see with any kernel > test7. Seems like the ORIG_EAX != -1 is needed to correctly restart syscall after PTRACE_SYSCALL, but I did not check this codepath thoroughly. Following what is going with uml, just for the very first exec: [lots of trap_user.c:228, trap_user.c:149 skipped] start_syscall(): process.c:181 ptrace(PTRACE_GETREGS, 4901, 0, 501242c0) = 0 finish_exec(): exec_user.c:26 ptrace(PTRACE_POKEUSER, 4901, UESP, bf7fff20) = 0 exec_user.c:27 ptrace(PTRACE_POKEUSER, 4901, EIP, 400019a0) = 0 exec_user.c:28 ptrace(PTRACE_POKEUSER, 4901, EDX, 0) = 0 exec_user.c:29 ptrace(PTRACE_SYSCALL, 4901, 0, 0) = 0 And voila, we got SIGSEGV instead of happy running child: Child 4901 exited with signal 11 > Have you tried putting that ptrace patch into test7 and seeing if UML stops > working with that as the host? > > test8 is a known bad platform for UML, so I'm going to consider that the > ptrace patch is OK unless it's possible to turn a good host into a bad one by > adding that ptrace fix. --- v2.4.0-test7/linux/arch/i386/kernel/ptrace.c Fri Jun 23 21:55:07 2000 +++ linux/arch/i386/kernel/ptrace.c Sat Sep 2 12:00:02 2000 @@ -99,6 +99,11 @@ case EFL: value &= FLAG_MASK; value |= get_stack_long(child, EFL_OFFSET) & ~FLAG_MASK; + break; + case EIP: + /* Mark us as not being in a system call, so that no restart issues happen */ + put_stack_long(child, 4*ORIG_EAX - sizeof(struct pt_regs), -1); + break; } if (regno > GS*4) regno -= 2*4; |