lkml.org 
[lkml]   [2005]   [Jan]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Patch 4/6 randomize the stack pointer
FromArjan van de Ven <>
DateThu, 27 Jan 2005 21:35:26 +0100
On Thu, 2005-01-27 at 20:32 +0000, Christoph Hellwig wrote:
> > The patch below replaces the existing 8Kb randomisation of the userspace
> > stack pointer (which is currently only done for Hyperthreaded P-IVs) with a
> > more general randomisation over a 64Kb range. 64Kb is not a lot, but it's a
> > start and once the dust settles we can increase this value to a more
> > agressive value.
> Why are we doing this for x86 only, btw?
>
> > +unsigned long arch_align_stack(unsigned long sp)
> > +{
> > + if (randomize_va_space)
> > + sp -= ((get_random_int() % 4096) << 4);
> > + return sp & ~0xf;
> > +}
>
> this looks like it'd work nicely on all architectures.

the problem is that the <<4 is the minimum x86 stack pointer alignment.
That value differs per architecture afaics.....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [from the cache]
©2003-2009