From: Kees Cook Date: Wed, 1 Oct 2014 18:36:32 +0000 (-0700) Subject: x86, boot, kaslr: Fix nuisance warning on 32-bit builds X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~9452^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=20cc28882bf4a8c9a2605a9a76a7952e696aaece;p=mirror_ubuntu-artful-kernel.git x86, boot, kaslr: Fix nuisance warning on 32-bit builds Building 32-bit threw a warning on kASLR enabled builds: arch/x86/boot/compressed/aslr.c: In function ‘mem_avoid_overlap’: arch/x86/boot/compressed/aslr.c:198:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] avoid.start = (u64)ptr; ^ This fixes the warning; unsigned long should have been used here. Signed-off-by: Kees Cook Link: http://lkml.kernel.org/r/20141001183632.GA11431@www.outflux.net Signed-off-by: H. Peter Anvin --- diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c index d39189ba7f8e..f302dc45ce08 100644 --- a/arch/x86/boot/compressed/aslr.c +++ b/arch/x86/boot/compressed/aslr.c @@ -195,7 +195,7 @@ static bool mem_avoid_overlap(struct mem_vector *img) while (ptr) { struct mem_vector avoid; - avoid.start = (u64)ptr; + avoid.start = (unsigned long)ptr; avoid.size = sizeof(*ptr) + ptr->len; if (mem_overlaps(img, &avoid))