From 3f1c8df053642ac030805a2a61245d16924711bb Mon Sep 17 00:00:00 2001 From: Gaurav Singh Date: Wed, 25 May 2016 18:15:10 +0530 Subject: [PATCH] Fix the casting issue Allow a 64 bit pointer to be cast and put into a 32-bit integer, when that pointer points to a location within a 32 bit userspace. Normally this is a very bad thing to do, the compiler is right to warn us about this, but in this very specific case, it is OK. In file included from fs/compat_binfmt_elf.c:128:0: fs/binfmt_elf.c: In function 'create_elf_tables': /cuba/jak/tegra/r23.1/a/arch/arm64/include/asm/elf.h:143:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (elf_addr_t)current->mm->context.vdso); fs/binfmt_elf.c:216:26: note: in definition of macro 'NEW_AUX_ENT' elf_info[ei_index++] = val; fs/binfmt_elf.c:226:2: note: in expansion of macro 'ARCH_DLINFO' ARCH_DLINFO; Bug 200187768 Change-Id: Ia9086a0b43c608e672d04cec209ea7edc1d3a806 Signed-off-by: Joe Korty Signed-off-by: Gaurav Singh Reviewed-on: http://git-master/r/1163935 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu --- arch/arm64/include/asm/elf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 5469b9fcf41..ec180682b05 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -140,7 +140,7 @@ extern unsigned long randomize_et_dyn(unsigned long base); #define ARCH_DLINFO \ do { \ NEW_AUX_ENT(AT_SYSINFO_EHDR, \ - (elf_addr_t)current->mm->context.vdso); \ + (elf_addr_t)(long)current->mm->context.vdso); \ } while (0) #define ARCH_HAS_SETUP_ADDITIONAL_PAGES -- 2.39.2