From: Simon Horman <horms@verge.net.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v2] kexec: Fix off-by-one errors in locate_hole()
Date: Thu, 3 Oct 2013 10:15:53 +0900 [thread overview]
Message-ID: <20131003011553.GH13111@verge.net.au> (raw)
In-Reply-To: <1380703348-5877-1-git-send-email-geert@linux-m68k.org>
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@linux-m68k.org>
Thanks, applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2013-10-03 1:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-02 8:42 [PATCH v2] kexec: Fix off-by-one errors in locate_hole() Geert Uytterhoeven
2013-10-03 1:15 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131003011553.GH13111@verge.net.au \
--to=horms@verge.net.au \
--cc=geert@linux-m68k.org \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox