Re: [PATCH] Fix out-by-one error in traps.c

2007-09-04 Thread Rusty Russell
On Fri, 2007-08-31 at 11:24 -0700, Linus Torvalds wrote: > > On Sat, 1 Sep 2007, Rusty Russell wrote: > > > > This is only for the initial booting stack (init_thread_union); see > > arch/i386/kernel/head.S: > > /* Set up the stack pointer */ > > lss stack_start,%esp > > ... > >

Re: [PATCH] Fix out-by-one error in traps.c

2007-09-04 Thread Rusty Russell
On Fri, 2007-08-31 at 11:24 -0700, Linus Torvalds wrote: On Sat, 1 Sep 2007, Rusty Russell wrote: This is only for the initial booting stack (init_thread_union); see arch/i386/kernel/head.S: /* Set up the stack pointer */ lss stack_start,%esp ... pushl $0

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Linus Torvalds
On Sat, 1 Sep 2007, Rusty Russell wrote: > > This is only for the initial booting stack (init_thread_union); see > arch/i386/kernel/head.S: > /* Set up the stack pointer */ > lss stack_start,%esp > ... > pushl $0# fake return address for unwinder Ok, we

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Rusty Russell
On Fri, 2007-08-31 at 00:51 -0700, Linus Torvalds wrote: > > On Fri, 31 Aug 2007, Rusty Russell wrote: > > head.S pushes a "$0" on the stack to stop the unwinder, lguest doesn't. > > The unwinder should stop when it sees an invalid frame pointer, and even > without the push 0 I'd have expected

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Linus Torvalds
On Fri, 31 Aug 2007, Rusty Russell wrote: > On Thu, 2007-08-30 at 21:44 -0700, Linus Torvalds wrote: > > > > Hmm.. This *really* cannot happen with a normal kernel - it implies that > > the stack has crossed into an invalid page. > > AFAICT, a corrupt stack could lead us to touch a page

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Rusty Russell
On Thu, 2007-08-30 at 21:44 -0700, Linus Torvalds wrote: > > On Fri, 31 Aug 2007, Rusty Russell wrote: > > > > We don't care if ebp is on the stack, we care about ebp + 4. Without > > this, lguest (with CONFIG_DEBUG_LOCKDEP) can touch a page unmapped by > > CONFIG_DEBUG_PAGEALLOC. > > Hmm..

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Rusty Russell
On Fri, 2007-08-31 at 00:51 -0700, Linus Torvalds wrote: On Fri, 31 Aug 2007, Rusty Russell wrote: head.S pushes a $0 on the stack to stop the unwinder, lguest doesn't. The unwinder should stop when it sees an invalid frame pointer, and even without the push 0 I'd have expected it to be

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Linus Torvalds
On Sat, 1 Sep 2007, Rusty Russell wrote: This is only for the initial booting stack (init_thread_union); see arch/i386/kernel/head.S: /* Set up the stack pointer */ lss stack_start,%esp ... pushl $0# fake return address for unwinder Ok, we should

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Rusty Russell
On Thu, 2007-08-30 at 21:44 -0700, Linus Torvalds wrote: On Fri, 31 Aug 2007, Rusty Russell wrote: We don't care if ebp is on the stack, we care about ebp + 4. Without this, lguest (with CONFIG_DEBUG_LOCKDEP) can touch a page unmapped by CONFIG_DEBUG_PAGEALLOC. Hmm.. This *really*

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-31 Thread Linus Torvalds
On Fri, 31 Aug 2007, Rusty Russell wrote: On Thu, 2007-08-30 at 21:44 -0700, Linus Torvalds wrote: Hmm.. This *really* cannot happen with a normal kernel - it implies that the stack has crossed into an invalid page. AFAICT, a corrupt stack could lead us to touch a page which isn't

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-30 Thread Linus Torvalds
On Fri, 31 Aug 2007, Rusty Russell wrote: > > We don't care if ebp is on the stack, we care about ebp + 4. Without > this, lguest (with CONFIG_DEBUG_LOCKDEP) can touch a page unmapped by > CONFIG_DEBUG_PAGEALLOC. Hmm.. This *really* cannot happen with a normal kernel - it implies that the

[PATCH] Fix out-by-one error in traps.c

2007-08-30 Thread Rusty Russell
We don't care if ebp is on the stack, we care about ebp + 4. Without this, lguest (with CONFIG_DEBUG_LOCKDEP) can touch a page unmapped by CONFIG_DEBUG_PAGEALLOC. Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> diff -r b0b1ab8ecf48 arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c Fri

[PATCH] Fix out-by-one error in traps.c

2007-08-30 Thread Rusty Russell
We don't care if ebp is on the stack, we care about ebp + 4. Without this, lguest (with CONFIG_DEBUG_LOCKDEP) can touch a page unmapped by CONFIG_DEBUG_PAGEALLOC. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r b0b1ab8ecf48 arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c Fri Aug

Re: [PATCH] Fix out-by-one error in traps.c

2007-08-30 Thread Linus Torvalds
On Fri, 31 Aug 2007, Rusty Russell wrote: We don't care if ebp is on the stack, we care about ebp + 4. Without this, lguest (with CONFIG_DEBUG_LOCKDEP) can touch a page unmapped by CONFIG_DEBUG_PAGEALLOC. Hmm.. This *really* cannot happen with a normal kernel - it implies that the stack