Commit de08eaa
mm: multi-gen LRU: fix crash during cgroup migration
lru_gen_migrate_mm() assumes lru_gen_add_mm() runs prior to itself. This
isn't true for the following scenario:
CPU 1 CPU 2
clone()
cgroup_can_fork()
cgroup_procs_write()
cgroup_post_fork()
task_lock()
lru_gen_migrate_mm()
task_unlock()
task_lock()
lru_gen_add_mm()
task_unlock()
And when the above happens, kernel crashes because of linked list
corruption (mm_struct->lru_gen.list).
Link: https://lore.kernel.org/r/[email protected]/
Link: https://lkml.kernel.org/r/[email protected]
Fixes: bd74fda ("mm: multi-gen LRU: support page table walks")
Signed-off-by: Yu Zhao <[email protected]>
Reported-by: msizanoen <[email protected]>
Tested-by: msizanoen <[email protected]>
Cc: <[email protected]> [6.1+]
Signed-off-by: Andrew Morton <[email protected]>1 parent 55ab834 commit de08eaa
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3323 | 3323 | | |
3324 | 3324 | | |
3325 | 3325 | | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
3326 | 3330 | | |
3327 | 3331 | | |
3328 | 3332 | | |
3329 | 3333 | | |
3330 | 3334 | | |
3331 | 3335 | | |
3332 | | - | |
3333 | 3336 | | |
3334 | 3337 | | |
3335 | 3338 | | |
| |||
0 commit comments