From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>,
"Chris (Christopher) Brand" <chris.brand@broadcom.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] xen: arm: Avoid reading beyond the last module
Date: Tue, 21 Jul 2015 15:49:52 +0100 [thread overview]
Message-ID: <1437490192.8383.47.camel@citrix.com> (raw)
In-Reply-To: <55ACEA63.5040107@citrix.com>
On Mon, 2015-07-20 at 13:32 +0100, Julien Grall wrote:
> Hi Chris,
>
> On 17/07/15 21:48, Chris (Christopher) Brand wrote:
> > nr_mods is set in add_boot_module() to the number of module
> > array elements used. This function also ensures that nr_mods
> > never exceeds MAX_MODULES (the size of the array). When looping
> > through the array, the correct maximum index is "nr_mods-1",
> > not "nr_mods". If the array is full, using the latter will in
> > fact access beyond the end of the array.
> > This was done correctly in boot_module_find_by_kind() and
> > consider_modules() but incorrectly in discard_initial_modules()
> > and next_module().
> >
> > Signed-off-by: Chris Brand <chris.brand@broadcom.com>
>
> Reviewed-by: Julien Grall <julien.grall@citrix.com>
Acked + applied.
Care should be taken when backporting since I think this off-by-one was
the result of us previously not including Xen in nr_mods despite it
being in the array or something like that (i..e the off-by-one used to
be correct).
Ian.
next prev parent reply other threads:[~2015-07-21 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 20:48 [PATCH] xen: arm: Avoid reading beyond the last module Chris (Christopher) Brand
2015-07-20 12:32 ` Julien Grall
2015-07-21 14:49 ` Ian Campbell [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-07-16 21:41 Chris (Christopher) Brand
2015-07-17 10:14 ` Julien Grall
2015-07-17 22:15 ` Chris (Christopher) Brand
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=1437490192.8383.47.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=chris.brand@broadcom.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.