]> 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)
commit4c3ab1a7022312516c210fea5ca0e04b35d430fd
tree31397f1855959637bd99d734743081ce13e6d1ea
parent6462e7897c70700aaedba3c49a2f428d066f0b83
mm: respect arch_dup_mmap() return value

Commit 932233a6114f ("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: 932233a6114fa ("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