Re: [PATCH] [3/4] i386: Fix overflow in e820_all_mapped

From: Andi Kleen
Date: Fri Apr 28 2006 - 02:08:44 EST


On Friday 28 April 2006 07:39, Linus Torvalds wrote:
>
> On Fri, 28 Apr 2006, Andi Kleen wrote:
> >
> > The 32bit version of e820_all_mapped() needs to use u64 to avoid
> > overflows on PAE systems. Pointed out by Jan Beulich
>
> I don't think that's true.
>
> It can't be called with 64-bit arguments anyway. If the base address
> doesn't fit in 32-bit, we'd be screwed in other places, afaik.

To quote Jan's original description (should have put that in)
I think it's needed.

-Andi

>>>

>> It would seem to me that using 'unsigned long' for start and end is inappropriate on 32bits; at least start should
be
>> 'unsigned long long' as it gets updated from ei->addr + ei->size, which may (truncated to 32 bits) happen to be
zero.
>
>the current user has it 32 bit for sure; once another user appears we certainly can fix this...

The effect is not on the current user's parameter passing, but in the result the function may produce. If, say, for the
PCI mmconfig and BIOS space, there is a (reserved) entry starting at E0000000 and being 20000000 in size, then as far as
I can tell the function will return zero (rather than one).

<<<
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/