]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Randomise lower bits of stack address
authorAnton Blanchard <anton@samba.org>
Sun, 22 Feb 2009 01:50:03 +0000 (01:50 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 23 Feb 2009 04:53:20 +0000 (15:53 +1100)
commit2200878903a088c5be9dd6fda439ba261c72b696
treea0489611eb3edce545f7aed98764220e195ef941
parentb51449c0bbb05ea8bedd82cb2d66d30b36751c34
powerpc: Randomise lower bits of stack address

Randomise the lower bits of the stack address. More randomisation is good for
security but the scatter can also help with SMT threads that share an L1. A
quick test case shows this working:

int main()
{
int sp;
printf("%x\n", (unsigned long)&sp & 4095);
}

before:
80
80
80
80
80

after:
610
490
300
6b0
d80

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/system.h
arch/powerpc/kernel/process.c