[03/11] parasite-vdso: Add ugly casts for arm32

Submitted by Dmitry Safonov on May 22, 2019, 6:18 p.m.

Details

Message ID 20190522181825.15064-4-dima@arista.com
State New
Series "vdso: arm32 support"
Headers show

Commit Message

Dmitry Safonov May 22, 2019, 6:18 p.m.
criu/pie/parasite-vdso.c: In function 'remap_rt_vdso':
criu/pie/parasite-vdso.c:144:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if (sys_munmap((void *)vma_vdso->start, vma_entry_len(vma_vdso))) {
                 ^
criu/pie/parasite-vdso.c:154:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if (sys_munmap((void *)vma_vvar->start, vma_entry_len(vma_vvar))) {
                 ^
cc1: all warnings being treated as errors

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 criu/pie/parasite-vdso.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/pie/parasite-vdso.c b/criu/pie/parasite-vdso.c
index dc73fb53e1ea..90e20f767c33 100644
--- a/criu/pie/parasite-vdso.c
+++ b/criu/pie/parasite-vdso.c
@@ -127,11 +127,17 @@  static int remap_rt_vdso(VmaEntry *vma_vdso, VmaEntry *vma_vvar,
 {
 	unsigned long rt_vvar_addr = vdso_rt_parked_at;
 	unsigned long rt_vdso_addr = vdso_rt_parked_at;
+	void *remap_addr;
 	int ret;
 
 	pr_info("Runtime vdso/vvar matches dumpee, remap inplace\n");
 
-	if (sys_munmap((void *)vma_vdso->start, vma_entry_len(vma_vdso))) {
+	/*
+	 * Ugly casts for 32bit platforms, which don't like uint64_t
+	 * cast to (void *)
+	 */
+	remap_addr = (void *)(uintptr_t)vma_vdso->start;
+	if (sys_munmap(remap_addr, vma_entry_len(vma_vdso))) {
 		pr_err("Failed to unmap dumpee vdso\n");
 		return -1;
 	}
@@ -141,7 +147,8 @@  static int remap_rt_vdso(VmaEntry *vma_vdso, VmaEntry *vma_vvar,
 				vma_vdso->start, sym_rt->vdso_size);
 	}
 
-	if (sys_munmap((void *)vma_vvar->start, vma_entry_len(vma_vvar))) {
+	remap_addr = (void *)(uintptr_t)vma_vvar->start;
+	if (sys_munmap(remap_addr, vma_entry_len(vma_vvar))) {
 		pr_err("Failed to unmap dumpee vvar\n");
 		return -1;
 	}