The stack canary is an 'unsigned long' and should be fully initialized to random data rather than only 32 bits of random data.
Showing the changes to kernel/fork.c (1 of 1 file). Show all
Unified · Split
| @@ -536,7 +536,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) · 535 unmodified lines | ||
| 536 | 536 | set_task_stack_end_magic(tsk); |
| 537 | 537 | |
| 538 | 538 | #ifdef CONFIG_CC_STACKPROTECTOR |
| 539 | − tsk->stack_canary = get_random_int(); | |
| 539 | + tsk->stack_canary = get_random_long(); | |
| 540 | 540 | #endif |
| 541 | 541 | |
| 542 | 542 | /* |