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

Rusty Russell rusty at rustcorp.com.au
Wed Sep 5 04:18:17 EST 2007


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		# fake return address for unwinder
> 
> Ok, we should fix that. We should just make it look like all other stack 
> frames.
> 
> There is other code in the kernel that "knows" that all kernel stacks have 
> the fields for the user stack return on it, namely the ptrace code etc. 
> Now, the initial stack is hopefully never *accessed* by that kind of code, 
> but this kind of special-case code is just wrong.

Yes, but -ETIMEDOUT.  Maybe for 2.6.24...

> IOW, how 
> about this one, which just declares a structure that describes the stack 
> frame thing? That just makes everything clearer, since we can then use 
> "sizeof(that structure)" instead of using the magic "2*sizeof(unsigned 
> long)".

Much nicer, thanks.

Rusty.




More information about the Lguest mailing list