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