Commit e4c8f85
committed
mm/khugepaged: fix GUP-fast interaction by sending IPI
jira VULN-71586
cve-pre CVE-2025-38085
commit-author Jann Horn <[email protected]>
commit 2ba99c5
upstream-diff Resolved contextual conflicts due to lack of backported
8d3c106
Since commit 70cbc3c ("mm: gup: fix the fast GUP race against THP
collapse"), the lockless_pages_from_mm() fastpath rechecks the pmd_t to
ensure that the page table was not removed by khugepaged in between.
However, lockless_pages_from_mm() still requires that the page table is
not concurrently freed. Fix it by sending IPIs (if the architecture uses
semi-RCU-style page table freeing) before freeing/reusing page tables.
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: ba76149 ("thp: khugepaged")
Signed-off-by: Jann Horn <[email protected]>
Reviewed-by: Yang Shi <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Cc: John Hubbard <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
(cherry picked from commit 2ba99c5)
Signed-off-by: Marcin Wcisło <[email protected]>1 parent 408b318 commit e4c8f85
3 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| 233 | + | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| 1141 | + | |
1141 | 1142 | | |
1142 | 1143 | | |
1143 | 1144 | | |
| |||
1413 | 1414 | | |
1414 | 1415 | | |
1415 | 1416 | | |
| 1417 | + | |
1416 | 1418 | | |
1417 | 1419 | | |
1418 | 1420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | 167 | | |
170 | 168 | | |
171 | 169 | | |
| |||
0 commit comments