* [RFC v2 2/7] arm: Use generic VDSO unmap and remap [not found] <20161101171101.24704-1-cov@codeaurora.org> @ 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:18 ` Russell King - ARM Linux 2016-11-01 17:10 ` [RFC v2 3/7] arm64: Use unsigned long for VDSO Christopher Covington 2016-11-01 17:10 ` [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions Christopher Covington 2 siblings, 1 reply; 4+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: linux-arm-kernel Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap the VDSO to successfully checkpoint and restore applications in the face of changing VDSO addresses due to Address Space Layout Randomization (ASLR, randmaps). Previously, this was implemented in architecture-specific code for PowerPC and x86. However, a generic version based on Laurent Dufour's PowerPC implementation is now available, so begin using it on ARM. Signed-off-by: Christopher Covington <cov@codeaurora•org> --- arch/arm/mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index c1799dd..1d3312b 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -845,6 +845,7 @@ config VDSO depends on AEABI && MMU && CPU_V7 default y if ARM_ARCH_TIMER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO help Place in the process address space an ELF shared object providing fast implementations of gettimeofday and -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC v2 2/7] arm: Use generic VDSO unmap and remap 2016-11-01 17:10 ` [RFC v2 2/7] arm: Use generic VDSO unmap and remap Christopher Covington @ 2016-11-01 17:18 ` Russell King - ARM Linux 0 siblings, 0 replies; 4+ messages in thread From: Russell King - ARM Linux @ 2016-11-01 17:18 UTC (permalink / raw) To: linux-arm-kernel You know, on its own, this patch is totally meaningless. Sorry, there's nothing more I can say about this. On Tue, Nov 01, 2016 at 11:10:56AM -0600, Christopher Covington wrote: > Checkpoint/Restore In Userspace (CRIU) needs to be able to unmap and remap > the VDSO to successfully checkpoint and restore applications in the face of > changing VDSO addresses due to Address Space Layout Randomization (ASLR, > randmaps). Previously, this was implemented in architecture-specific code > for PowerPC and x86. However, a generic version based on Laurent Dufour's > PowerPC implementation is now available, so begin using it on ARM. > > Signed-off-by: Christopher Covington <cov@codeaurora•org> > --- > arch/arm/mm/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig > index c1799dd..1d3312b 100644 > --- a/arch/arm/mm/Kconfig > +++ b/arch/arm/mm/Kconfig > @@ -845,6 +845,7 @@ config VDSO > depends on AEABI && MMU && CPU_V7 > default y if ARM_ARCH_TIMER > select GENERIC_TIME_VSYSCALL > + select GENERIC_VDSO > help > Place in the process address space an ELF shared object > providing fast implementations of gettimeofday and > -- > Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. > Qualcomm Technologies, Inc. is a member of the > Code Aurora Forum, a Linux Foundation Collaborative Project. > -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC v2 3/7] arm64: Use unsigned long for VDSO [not found] <20161101171101.24704-1-cov@codeaurora.org> 2016-11-01 17:10 ` [RFC v2 2/7] arm: Use generic VDSO unmap and remap Christopher Covington @ 2016-11-01 17:10 ` Christopher Covington 2016-11-01 17:10 ` [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions Christopher Covington 2 siblings, 0 replies; 4+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: linux-arm-kernel Use an unsigned long type for the base address of the VDSO in order to be compatible with the new generic VDSO remap and unmap functions originating from PowerPC and now also used by 32-bit ARM. Signed-off-by: Christopher Covington <cov@codeaurora•org> --- arch/arm64/include/asm/mmu.h | 2 +- arch/arm64/kernel/vdso.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 8d9fce0..5b00198 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -18,7 +18,7 @@ typedef struct { atomic64_t id; - void *vdso; + unsigned long vdso; } mm_context_t; /* diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index a2c2478..4b10e72 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -97,7 +97,7 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp) if (down_write_killable(&mm->mmap_sem)) return -EINTR; - current->mm->context.vdso = (void *)addr; + current->mm->context.vdso = addr; /* Map vectors page at the high address. */ ret = _install_special_mapping(mm, addr, PAGE_SIZE, @@ -178,7 +178,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, goto up_fail; vdso_base += PAGE_SIZE; - mm->context.vdso = (void *)vdso_base; + mm->context.vdso = vdso_base; ret = _install_special_mapping(mm, vdso_base, vdso_text_len, VM_READ|VM_EXEC| VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, @@ -191,7 +191,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, return 0; up_fail: - mm->context.vdso = NULL; + mm->context.vdso = 0; up_write(&mm->mmap_sem); return PTR_ERR(ret); } -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions [not found] <20161101171101.24704-1-cov@codeaurora.org> 2016-11-01 17:10 ` [RFC v2 2/7] arm: Use generic VDSO unmap and remap Christopher Covington 2016-11-01 17:10 ` [RFC v2 3/7] arm64: Use unsigned long for VDSO Christopher Covington @ 2016-11-01 17:10 ` Christopher Covington 2 siblings, 0 replies; 4+ messages in thread From: Christopher Covington @ 2016-11-01 17:10 UTC (permalink / raw) To: linux-arm-kernel Checkpoint/Restore In Userspace (CRIU) must be able to remap and unmap the Virtual Dynamic Shared Object (VDSO) to be able to handle the changing addresses that result from address space layout randomization. Now that generic support is available and arm64 has adopted unsigned long for the type of mm->context.vdso, opt-in to VDSO unmap and remap support. Signed-off-by: Christopher Covington <cov@codeaurora•org> --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 969ef88..534df3f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -50,6 +50,7 @@ config ARM64 select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select GENERIC_TIME_VSYSCALL + select GENERIC_VDSO select HANDLE_DOMAIN_IRQ select HARDIRQS_SW_RESEND select HAVE_ALIGNED_STRUCT_PAGE if SLUB -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-01 17:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20161101171101.24704-1-cov@codeaurora.org>
2016-11-01 17:10 ` [RFC v2 2/7] arm: Use generic VDSO unmap and remap Christopher Covington
2016-11-01 17:18 ` Russell King - ARM Linux
2016-11-01 17:10 ` [RFC v2 3/7] arm64: Use unsigned long for VDSO Christopher Covington
2016-11-01 17:10 ` [RFC v2 4/7] arm64: Use generic VDSO unmap and remap functions Christopher Covington
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox