Re: [tip:x86/asm] x86/i386: Make sure stack-protector segment baseis cache aligned

From: Arjan van de Ven
Date: Fri Sep 04 2009 - 10:12:56 EST


On Thu, 3 Sep 2009 23:18:05 +0200
Ingo Molnar <mingo@xxxxxxx> wrote:

>
> * H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
> > On 09/03/2009 01:45 PM, Jeremy Fitzhardinge wrote:
> > >
> > > Two problems:
> > >
> > > * gcc generates %gs: references for stack-protector, but we
> > > use %fs for percpu data (because restoring %fs is faster if it's
> > > a null selector; TLS uses %gs). I guess we could use %fs if
> > > !CONFIG_CC_STACKPROTECTOR, or %gs if we are using it
> > > (though that has some fiddly ramifications for things like
> > > ptrace).
> >
> > Well, by touching two segments we're getting the worst of both
> > worlds, so at least assuming some significant number of real-world
> > deployments use CC_STACKPROTECTOR, we really don't want to
> > pessimize that case too much.
>
> Fedora has stackprotector enabled so it's used in a widespread way.
>
> Ingo

the other issue is that afaik we want the kernel to use the other
register than userspace does...


--
Arjan van de Ven Intel Open Source Technology Centre
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/