From: Anthony Liguori <anthony@codemonkey.ws>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/omap_intc.c: Avoid crash on access to nonexistent banked registers
Date: Fri, 11 Nov 2011 13:44:56 -0600 [thread overview]
Message-ID: <4EBD7B38.2000501@codemonkey.ws> (raw)
In-Reply-To: <1320864338-9702-1-git-send-email-peter.maydell@linaro.org>
On 11/09/2011 12:45 PM, Peter Maydell wrote:
> Avoid a crash due to null pointer dereference if a guest attempts
> to access banked registers for a nonexistent bank. Spotted by
> Coverity (see bug 887883).
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> hw/omap_intc.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/hw/omap_intc.c b/hw/omap_intc.c
> index 0f7fd9d..45efa25 100644
> --- a/hw/omap_intc.c
> +++ b/hw/omap_intc.c
> @@ -398,6 +398,9 @@ static uint64_t omap2_inth_read(void *opaque, target_phys_addr_t addr,
> if (bank_no< s->nbanks) {
> offset&= ~0x60;
> bank =&s->bank[bank_no];
> + } else {
> + OMAP_BAD_REG(addr);
> + return 0;
> }
> }
>
> @@ -476,6 +479,9 @@ static void omap2_inth_write(void *opaque, target_phys_addr_t addr,
> if (bank_no< s->nbanks) {
> offset&= ~0x60;
> bank =&s->bank[bank_no];
> + } else {
> + OMAP_BAD_REG(addr);
> + return;
> }
> }
>
prev parent reply other threads:[~2011-11-11 19:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 18:45 [Qemu-devel] [PATCH] hw/omap_intc.c: Avoid crash on access to nonexistent banked registers Peter Maydell
2011-11-11 19:44 ` Anthony Liguori [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=4EBD7B38.2000501@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).