Commit 7a5d47d5 authored by Nadav Amit's avatar Nadav Amit Committed by Greg Kroah-Hartman
Browse files

mm: respect arch_dup_mmap() return value

commit 1ed0cc5a upstream.

Commit d70f2a14 ("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: d70f2a14 ("include/linux/sched/mm.h: uninline mmdrop_async(), etc")
Signed-off-by: default avatarNadav Amit <namit@vmware.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 153fedc6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment