s390/vdso: avoid 64-bit vdso mapping for compat tasks
authorVasily Gorbik <gor@linux.ibm.com>
Fri, 14 Sep 2018 15:29:39 +0000 (17:29 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 20 Sep 2018 11:20:29 +0000 (13:20 +0200)
commitd1befa65823e9c6d013883b8a41d081ec338c489
treee41d581c2cd188884a016bd9f689eb57ae60f1f5
parent1c472d46283263497adccd7a0bec64ee2f9c09e5
s390/vdso: avoid 64-bit vdso mapping for compat tasks

vdso_fault used is_compat_task function (on s390 it tests "current"
thread_info flags) to distinguish compat tasks and map 31-bit vdso
pages. But "current" task might not correspond to mm context.

When 31-bit compat inferior is executed under gdb, gdb does
PTRACE_PEEKTEXT on vdso page, causing vdso_fault with "current" being
64-bit gdb process. So, 31-bit inferior ends up with 64-bit vdso mapped.

To avoid this problem a new compat_mm flag has been introduced into
mm context. This flag is used in vdso_fault and vdso_mremap instead
of is_compat_task.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/mmu.h
arch/s390/include/asm/mmu_context.h
arch/s390/kernel/vdso.c