All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-respect-arch_dup_mmap-return-value.patch added to -mm tree
@ 2018-08-23 22:57 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2018-08-23 22:57 UTC (permalink / raw)
  To: mm-commits, stable, mhocko, namit


The patch titled
     Subject: mm: respect arch_dup_mmap() return value
has been added to the -mm tree.  Its filename is
     mm-respect-arch_dup_mmap-return-value.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-respect-arch_dup_mmap-return-value.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-respect-arch_dup_mmap-return-value.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Nadav Amit <namit@vmware.com>
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.

Link: http://lkml.kernel.org/r/20180823051229.211856-1-namit@vmware.com
Fixes: d70f2a14b72a4 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc")
Signed-off-by: Nadav Amit <namit@vmware.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/fork.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/kernel/fork.c~mm-respect-arch_dup_mmap-return-value
+++ a/kernel/fork.c
@@ -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 namit@vmware.com are

mm-respect-arch_dup_mmap-return-value.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-24  2:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 22:57 + mm-respect-arch_dup_mmap-return-value.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.