Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-21 Thread William Stearns

On Tue, 19 Sep 2000, Jeff Dike wrote:

> [EMAIL PROTECTED] said:
> > I tested vanilla test7 with  ptrace() patch. It breaks uml exactly
> > like I see with any kernel > test7. 
> 
> > 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 
> 
> Yuri, I apologize for doubting you.  That's about the best evidence possible 
> that the test8 ptrace fix is what's breaking UML and not the thread group 
> stuff.
> 
> If anyone has any idea why that fix breaks PTRACE_SYSCALL, I'd love to know.  
> I'm kind of short on time at the moment, so I'm not in a great position to 
> delve into this at the moment.
> 
> Until this is fixed, UML doesn't work on any host kernels beyond test7.

As a further verification that this change is causing problems for
UML, test9-pre5 allows uml to run if the ptrace.c change is
reverted.  I do understand that this is not the correct fix for the
problem, but for those who would like to independently verify this, the
(incorrect) patch is attached.

Cheers,
- Bill

---
Things you Do Not Want To See On IRC: your husband commenting on the
S390 port and in the next comment, announcing that he expects a new toy.
He tells me the two are unrelated. I do hope so. 
- Telsa Gwynn, Alan Cox' wife
--
William Stearns ([EMAIL PROTECTED]).  Mason, Buildkernel, named2hosts, 
and ipfwadm2ipchains are at:http://www.pobox.com/~wstearns
LinuxMonth; articles for Linux Enthusiasts! http://www.linuxmonth.com
--



diff -u --recursive --new-file linux/arch/i386/kernel/ptrace.c.orig 
linux/arch/i386/kernel/ptrace.c
--- linux/arch/i386/kernel/ptrace.c.origThu Sep 21 00:34:03 2000
+++ linux/arch/i386/kernel/ptrace.c Thu Sep 21 11:44:36 2000
@@ -100,10 +100,10 @@
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;
+// 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;



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-21 Thread William Stearns

On Tue, 19 Sep 2000, Jeff Dike wrote:

 [EMAIL PROTECTED] said:
  I tested vanilla test7 with  ptrace() patch. It breaks uml exactly
  like I see with any kernel  test7. 
 
  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 
 
 Yuri, I apologize for doubting you.  That's about the best evidence possible 
 that the test8 ptrace fix is what's breaking UML and not the thread group 
 stuff.
 
 If anyone has any idea why that fix breaks PTRACE_SYSCALL, I'd love to know.  
 I'm kind of short on time at the moment, so I'm not in a great position to 
 delve into this at the moment.
 
 Until this is fixed, UML doesn't work on any host kernels beyond test7.

As a further verification that this change is causing problems for
UML, test9-pre5 allows uml to run if the ptrace.c change is
reverted.  I do understand that this is not the correct fix for the
problem, but for those who would like to independently verify this, the
(incorrect) patch is attached.

Cheers,
- Bill

---
Things you Do Not Want To See On IRC: your husband commenting on the
S390 port and in the next comment, announcing that he expects a new toy.
He tells me the two are unrelated. I do hope so. 
- Telsa Gwynn, Alan Cox' wife
--
William Stearns ([EMAIL PROTECTED]).  Mason, Buildkernel, named2hosts, 
and ipfwadm2ipchains are at:http://www.pobox.com/~wstearns
LinuxMonth; articles for Linux Enthusiasts! http://www.linuxmonth.com
--



diff -u --recursive --new-file linux/arch/i386/kernel/ptrace.c.orig 
linux/arch/i386/kernel/ptrace.c
--- linux/arch/i386/kernel/ptrace.c.origThu Sep 21 00:34:03 2000
+++ linux/arch/i386/kernel/ptrace.c Thu Sep 21 11:44:36 2000
@@ -100,10 +100,10 @@
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;
+// 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;



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-19 Thread Jeff Dike

[EMAIL PROTECTED] said:
> I tested vanilla test7 with  ptrace() patch. It breaks uml exactly
> like I see with any kernel > test7. 

> 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 

Yuri, I apologize for doubting you.  That's about the best evidence possible 
that the test8 ptrace fix is what's breaking UML and not the thread group 
stuff.

If anyone has any idea why that fix breaks PTRACE_SYSCALL, I'd love to know.  
I'm kind of short on time at the moment, so I'm not in a great position to 
delve into this at the moment.

Until this is fixed, UML doesn't work on any host kernels beyond test7.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-19 Thread Yuri Pudgorodsky

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;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-19 Thread Yuri Pudgorodsky

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;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-19 Thread Jeff Dike

[EMAIL PROTECTED] said:
 I tested vanilla test7 with  ptrace() patch. It breaks uml exactly
 like I see with any kernel  test7. 

 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 

Yuri, I apologize for doubting you.  That's about the best evidence possible 
that the test8 ptrace fix is what's breaking UML and not the thread group 
stuff.

If anyone has any idea why that fix breaks PTRACE_SYSCALL, I'd love to know.  
I'm kind of short on time at the moment, so I'm not in a great position to 
delve into this at the moment.

Until this is fixed, UML doesn't work on any host kernels beyond test7.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-18 Thread Yuri Pudgorodsky

Jeff Dike wrote:

> [EMAIL PROTECTED] said:
> > Beeing an active user mode linux user :-) I can say that since
> > 2.4.0-test8 (host kernel) I cannot run uml-linux successfully.
>
> > In contrast with popular feeling that "threaded programes screwed
> > signal handling on test8.", it is actually a  small change to arch/
> > i386/ptrace.c introduced since test8pre4.
>
> I don't see a problem with the ptrace fix.  Before changing EIP, UML saves all
> of the process registers into the thread struct.  So that change to ORIG_EAX
> shouldn't matter as far as UML is concerned.
>
> Jeff

But it does matter, one of user-process threads gets SEGV very early
during uml boot under host kernel >= test8.

I can try to localize this place in case you are not able to reproduce
the crash, but I suppose you can see it yourself.

Did you actually try to run uml on that kernels?


Regards,
Yuri Pudgorodsky


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [User-mode-linux-user] Ptrace broken since 2.4.0-test8pre4?...

2000-09-18 Thread Jeff Dike

[EMAIL PROTECTED] said:
> Beeing an active user mode linux user :-) I can say that since
> 2.4.0-test8 (host kernel) I cannot run uml-linux successfully.

> In contrast with popular feeling that "threaded programes screwed
> signal handling on test8.", it is actually a  small change to arch/
> i386/ptrace.c introduced since test8pre4. 

I don't see a problem with the ptrace fix.  Before changing EIP, UML saves all 
of the process registers into the thread struct.  So that change to ORIG_EAX 
shouldn't matter as far as UML is concerned.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/