]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32: Change the stack protector canary value per task
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 22 Nov 2016 10:49:32 +0000 (11:49 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 23 Nov 2016 11:57:20 +0000 (22:57 +1100)
commit941c884404b5513610a0f7ce543dc632b9e6fbbb
treed90f4d8be8f76eabed3ee9fae0cef5d13fc1077f
parent477615116f770d370e7bbd402c323812acddeec4
powerpc/32: Change the stack protector canary value per task

Partially copied from commit 8b499865a0929 ("ARM: stack protector:
change the canary value per task")

A new random value for the canary is stored in the task struct whenever
a new task is forked.  This is meant to allow for different canary values
per task.  On powerpc, GCC expects the canary value to be found in a global
variable called __stack_chk_guard.  So this variable has to be updated
with the value stored in the task struct whenever a task switch occurs.

Because the variable GCC expects is global, this cannot work on SMP
unfortunately.  So, on SMP, the same initial canary value is kept
throughout, making this feature a bit less effective although it is still
useful.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/entry_32.S