| .. | .. |
|---|
| 65 | 65 | */ |
|---|
| 66 | 66 | static __always_inline void boot_init_stack_canary(void) |
|---|
| 67 | 67 | { |
|---|
| 68 | | - u64 canary = 0; |
|---|
| 68 | + u64 canary; |
|---|
| 69 | 69 | u64 tsc; |
|---|
| 70 | 70 | |
|---|
| 71 | 71 | #ifdef CONFIG_X86_64 |
|---|
| .. | .. |
|---|
| 76 | 76 | * of randomness. The TSC only matters for very early init, |
|---|
| 77 | 77 | * there it already has some randomness on most systems. Later |
|---|
| 78 | 78 | * on during the bootup the random pool has true entropy too. |
|---|
| 79 | | - * For preempt-rt we need to weaken the randomness a bit, as |
|---|
| 80 | | - * we can't call into the random generator from atomic context |
|---|
| 81 | | - * due to locking constraints. We just leave canary |
|---|
| 82 | | - * uninitialized and use the TSC based randomness on top of it. |
|---|
| 83 | 79 | */ |
|---|
| 84 | | -#ifndef CONFIG_PREEMPT_RT |
|---|
| 85 | 80 | get_random_bytes(&canary, sizeof(canary)); |
|---|
| 86 | | -#endif |
|---|
| 87 | 81 | tsc = rdtsc(); |
|---|
| 88 | 82 | canary += tsc + (tsc << 32UL); |
|---|
| 89 | 83 | canary &= CANARY_MASK; |
|---|