]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - mm/mmap.c
ARM: 8683/1: ARM32: Support mremap() for sigpage/vDSO
authorDmitry Safonov <dsafonov@virtuozzo.com>
Mon, 19 Jun 2017 16:32:42 +0000 (17:32 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Wed, 21 Jun 2017 12:02:58 +0000 (13:02 +0100)
commit280e87e98c09b85b617c7b2752c8b504c4ea98f6
tree66ef413e09934ee531cee890a0a911b74d575e6f
parent2d618fee6984c5124f8e66972df5b1262ac7836e
ARM: 8683/1: ARM32: Support mremap() for sigpage/vDSO

CRIU restores application mappings on the same place where they
were before Checkpoint. That means, that we need to move vDSO
and sigpage during restore on exactly the same place where
they were before C/R.

Make mremap() code update mm->context.{sigpage,vdso} pointers
during VMA move. Sigpage is used for landing after handling
a signal - if the pointer is not updated during moving, the
application might crash on any signal after mremap().

vDSO pointer on ARM32 is used only for setting auxv at this moment,
update it during mremap() in case of future usage.

Without those updates, current work of CRIU on ARM32 is not reliable.
Historically, we error Checkpointing if we find vDSO page on ARM32
and suggest user to disable CONFIG_VDSO.
But that's not correct - it goes from x86 where signal processing
is ended in vDSO blob. For arm32 it's sigpage, which is not disabled
with `CONFIG_VDSO=n'.

Looks like C/R was working by luck - because userspace on ARM32 at
this moment always sets SA_RESTORER.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/process.c
arch/arm/kernel/vdso.c
arch/x86/entry/vdso/vma.c
mm/mmap.c