Re: StackProtector Oopses - Re: 2.6.25-mm1

From: Arjan van de Ven
Date: Tue Apr 22 2008 - 10:30:31 EST


On Tue, 22 Apr 2008 10:34:08 +0200
Ingo Molnar <mingo@xxxxxxx> wrote:

>
> * Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:
>
> > > yeah. Arjan - any new patches to try that might fix the bootup
> > > test?
> >
> > I've looked at the disassembly and compared it to mine, and the gcc
> > is doing something... rather unexpected. The only thing I can think
> > of is the patch below, it should make it a ton more robust...
>
> > - memset(&foo, 0, 2*sizeof(foo)); /* deliberate buffer
> > overflow */
> > + if (current->stack_canary == *(((unsigned long *)&foo)+1))
> > + *(((unsigned long *)&foo)+1) = 0;
> > + else
> > + printk(KERN_ERR "No -ftack-protector canary
> > found\n");
>
> ok, i queued this up. (with the typo that Valdis noticed fixed)
>
> but ... this bug needs to be figured out, not worked around.

well what I figured out was that the stack layout was "different".
Why/how I don't know, but being more robust against that is a good idea
in general.


--
If you want to reach me at my work email, use arjan@xxxxxxxxxxxxxxx
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/