Commit ffe4dfe
mm/slab_common: Replace invocation of weak PRNG
The Slab allocator randomization inside slab_common.c
uses the prandom_u32 PRNG. That was added to prevent attackers to obtain
information on the heap state.
However, this PRNG turned out to be weak, as noted in commit c51f8f8
To fix it, we have changed the invocation of prandom_u32_state to get_random_u32
to ensure the PRNG is strong.
Since a modulo operation is applied right after that,
in the Fisher-Yates shuffle, we used get_random_u32_below, to achieve uniformity.
Signed-off-by: David Keisar Schmidt <david.keisarschm@mail.huji.ac.il>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent f7e466e commit ffe4dfe
1 file changed
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | | - | |
| 1144 | + | |
1145 | 1145 | | |
1146 | 1146 | | |
1147 | 1147 | | |
| |||
1152 | 1152 | | |
1153 | 1153 | | |
1154 | 1154 | | |
1155 | | - | |
1156 | | - | |
| 1155 | + | |
1157 | 1156 | | |
1158 | 1157 | | |
1159 | 1158 | | |
| |||
1162 | 1161 | | |
1163 | 1162 | | |
1164 | 1163 | | |
1165 | | - | |
1166 | 1164 | | |
1167 | 1165 | | |
1168 | 1166 | | |
| |||
1171 | 1169 | | |
1172 | 1170 | | |
1173 | 1171 | | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
| 1172 | + | |
1178 | 1173 | | |
1179 | 1174 | | |
1180 | 1175 | | |
| |||
0 commit comments