From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-ppc@nongnu.org, Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH] ppc/pnv: Fix check on block device before updating drive contents
Date: Wed, 3 Nov 2021 11:11:15 +1100 [thread overview]
Message-ID: <YYHTo6XJq/4KNrj0@yekko> (raw)
In-Reply-To: <20211102162905.762078-1-clg@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
On Tue, Nov 02, 2021 at 05:29:05PM +0100, Cédric Le Goater wrote:
> Test is wrong and the backend can never updated. It could have led to
> a QEMU crash but since the firmware deactivates flash access if a valid
> layout is not detected, it went unnoticed.
>
> Reported-by: Coverity CID 1465223
> Fixes: 35dde5766211 ("ppc/pnv: Add a PNOR model")
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Applied to ppc-for-6.2, thanks.
> ---
> hw/ppc/pnv_pnor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv_pnor.c b/hw/ppc/pnv_pnor.c
> index 5ef1cf2afbe1..83ecccca28df 100644
> --- a/hw/ppc/pnv_pnor.c
> +++ b/hw/ppc/pnv_pnor.c
> @@ -36,7 +36,7 @@ static void pnv_pnor_update(PnvPnor *s, int offset, int size)
> int offset_end;
> int ret;
>
> - if (s->blk) {
> + if (!s->blk || !blk_is_writable(s->blk)) {
> return;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-11-03 0:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 16:29 [PATCH] ppc/pnv: Fix check on block device before updating drive contents Cédric Le Goater
2021-11-03 0:11 ` David Gibson [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=YYHTo6XJq/4KNrj0@yekko \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).