]> www.infradead.org Git - users/dwmw2/linux.git/commit
s390/vdso: correct vdso mapping for compat tasks
authorVasily Gorbik <gor@linux.ibm.com>
Wed, 2 Jan 2019 12:43:22 +0000 (13:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:15:38 +0000 (08:15 +0100)
commitf7e56986361dcd3d6f5f6871ece17a011789bcd8
treea777f97a788aa9c6cddd28455450076c77e167c4
parentc6348dd38b7d74de0cb00e5f7c05cbbe8b914a70
s390/vdso: correct vdso mapping for compat tasks

commit 190f056fba230abee80712eb810939ef9a8c462f upstream.

While "s390/vdso: avoid 64-bit vdso mapping for compat tasks" fixed
64-bit vdso mapping for compat tasks under gdb it introduced another
problem. "compat_mm" flag is not inherited during fork and when
31-bit process forks a child (but does not perform exec) it ends up
with 64-bit vdso. To address that, init_new_context (which is called
during fork and exec) now initialize compat_mm based on thread TIF_31BIT
flag. Later compat_mm is adjusted in arch_setup_additional_pages, which
is called during exec.

Fixes: d1befa65823e ("s390/vdso: avoid 64-bit vdso mapping for compat tasks")
Reported-by: Stefan Liebler <stli@linux.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: <stable@vger.kernel.org> # v4.20+
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/include/asm/mmu_context.h
arch/s390/kernel/vdso.c