]> git.baikalelectronics.ru Git - kernel.git/commit
mm: respect arch_dup_mmap() return value
authorNadav Amit <namit@vmware.com>
Tue, 4 Sep 2018 22:45:41 +0000 (15:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 4 Sep 2018 23:45:02 +0000 (16:45 -0700)
commit67c1785f87ab1808fe258d7d848ee03e3665ca68
tree31397f1855959637bd99d734743081ce13e6d1ea
parentb9d93e66ffc63d5d1aa235ad16dd1e92184af810
mm: respect arch_dup_mmap() return value

Commit 1536f4900e33 ("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 using the return value, as it was before the change.

Link: http://lkml.kernel.org/r/20180823051229.211856-1-namit@vmware.com
Fixes: 1536f4900e33a ("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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/fork.c