Skip to contentSkip to conversation

mm-respect-arch_dup_mmap-return-value.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 6, 2018 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: respect arch_dup_mmap() return value
has been removed from the -mm tree. Its filename was
mm-respect-arch_dup_mmap-return-value.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Nadav Amit <[email protected]>
Subject: mm: respect arch_dup_mmap() return value

d70f2a14b72a4 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc") ignored the return value of arch_dup_mmap(). As a result, on x86, a failure to duplicate the LDT (e.g., due to memory allocation error), would leave the duplicated memory mapping in an inconsistent state.

Fix by regarding the return value, as it was before the change.

Fixes d70f2a14b72a4 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc")

---

 kernel/fork.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/fork.c renamed from kernel/fork.c~mm-respect-arch_dup_mmap-return-value +1 -2
@@ -550,8 +550,7 @@ static __latent_entropy int dup_mmap(str
 			goto out;
 	}
 	/* a new mm has just been created */
-	arch_dup_mmap(oldmm, mm);
-	retval = 0;
+	retval = arch_dup_mmap(oldmm, mm);
 out:
 	up_write(&mm->mmap_sem);
 	flush_tlb_mm(oldmm);

_

Patches currently in -mm which might be from [email protected] are