[PATCH v2] kexec: Fix off-by-one errors in locate_hole()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 02, 2013 at 10:42:27AM +0200, Geert Uytterhoeven wrote:
> When calling locate_hole() with "hole_size" equal to the size of an
> available memory block, it fails to use that memory block.
> 
> "end" and "hole_max" point to the last byte within the range, hence
>   - "size = end - start" is one less than "hole_size",
>   - "hole_base + hole_size" is one more than "hole_max".
> 
> Subtract one from "hole_size" when doing the comparison (adding 1 to "size"
> could overflow in case of one big range covering the whole address space).
> But explicitly check if "hole_size" is zero first, to handle this case
> without causing underflows.
> 
> Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>

Thanks, applied.



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux