fork,random: use get_random_canary() to set tsk->stack_canary
Subsystems (3)
[email protected]
maintainerPATCH 66/96 fork,random: use get_random_canary() to set tsk->stack_canary
From: Rik van Riel <[email protected]>
Subject: fork,random: use get_random_canary() to set tsk->stack_canary
Use the ascii-armor canary to prevent unterminated C string overflows from being able to successfully overwrite the canary, even if they somehow obtain the canary value.
Inspired by execshield ascii-armor and Daniel Micay's linux-hardened tree.
Signed-off-by Rik van Riel <[email protected]>
Acked-by Kees Cook <[email protected]>
Cc Daniel Micay <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Yoshinori Sato <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/fork.c renamed from kernel/fork.c~forkrandom-use-get_random_canary-to-set-tsk-stack_canary +1 -1
@@ -554,7 +554,7 @@ static struct task_struct *dup_task_struset_task_stack_end_magic (tsk);#ifdef CONFIG_CC_STACKPROTECTOR - tsk->stack_canary =get_random_long (); + tsk->stack_canary =get_random_canary ();#endif /*
_