Skip to content

Commit

Permalink
x86, boot, kaslr: Fix nuisance warning on 32-bit builds
Browse files Browse the repository at this point in the history
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 <keescook@chromium.org>
Link: http://lkml.kernel.org/r/20141001183632.GA11431@www.outflux.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Kees Cook authored and H. Peter Anvin committed Oct 1, 2014
1 parent fe82dce commit 20cc288
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/boot/compressed/aslr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 20cc288

Please sign in to comment.