aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-04-16 12:31:58 -0700
committerAndrew Morton <akpm@linux-foundation.org>2023-04-16 12:31:58 -0700
commite492cd61b986590a45c674ede7dd1c4dbf94cf24 (patch)
tree37dc59ea66842b5b7e57f32aba6cbce5143c1282 /kernel/fork.c
parentd46031f40e0f7f7bf63914bb3f2e404ad3886ecd (diff)
parent2ff559f31a5d50c31a3f9d849f8af90dc36c7105 (diff)
downloadlinux-e492cd61b986590a45c674ede7dd1c4dbf94cf24.tar.gz
sync mm-stable with mm-hotfixes-stable to pick up depended-upon upstream changes
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 2bde99037652a..9051bc07b6001 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -683,6 +683,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
if (retval)
goto out;
+ mt_clear_in_rcu(vmi.mas.tree);
for_each_vma(old_vmi, mpnt) {
struct file *file;
@@ -766,6 +767,8 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
retval = arch_dup_mmap(oldmm, mm);
loop_out:
vma_iter_free(&vmi);
+ if (!retval)
+ mt_set_in_rcu(vmi.mas.tree);
out:
mmap_write_unlock(mm);
flush_tlb_mm(oldmm);