[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/54] ppc/pnv: Fix check on block device before updating drive co
From: |
David Gibson |
Subject: |
[PULL 26/54] ppc/pnv: Fix check on block device before updating drive contents |
Date: |
Tue, 9 Nov 2021 16:51:36 +1100 |
From: Cédric Le Goater <clg@kaod.org>
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>
Message-Id: <20211102162905.762078-1-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
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 5ef1cf2afb..83ecccca28 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;
}
--
2.33.1
- [PULL 07/54] target/ppc: Implement cntlzdm, (continued)
- [PULL 07/54] target/ppc: Implement cntlzdm, David Gibson, 2021/11/09
- [PULL 05/54] target/ppc: Move LQ and STQ to decodetree, David Gibson, 2021/11/09
- [PULL 10/54] target/ppc: Implement pextd instruction, David Gibson, 2021/11/09
- [PULL 14/54] target/ppc: Implement DCFFIXQQ, David Gibson, 2021/11/09
- [PULL 12/54] target/ppc: Move REQUIRE_ALTIVEC/VECTOR to translate.c, David Gibson, 2021/11/09
- [PULL 11/54] libdecnumber: introduce decNumberFrom[U]Int128, David Gibson, 2021/11/09
- [PULL 16/54] libdecnumber: Introduce decNumberIntegralToInt128, David Gibson, 2021/11/09
- [PULL 28/54] target/ppc: Move vcfuged to vmx-impl.c.inc, David Gibson, 2021/11/09
- [PULL 25/54] target/ppc: Move ddedpd[q], denbcd[q], dscli[q], dscri[q] to decodetree, David Gibson, 2021/11/09
- [PULL 23/54] target/ppc: Move dqua[q], drrnd[q] to decodetree, David Gibson, 2021/11/09
- [PULL 26/54] ppc/pnv: Fix check on block device before updating drive contents,
David Gibson <=
- [PULL 31/54] target/ppc: Implement vsldbi/vsrdbi instructions, David Gibson, 2021/11/09
- [PULL 06/54] target/ppc: Implement PLQ and PSTQ, David Gibson, 2021/11/09
- [PULL 17/54] target/ppc: Implement DCTFIXQQ, David Gibson, 2021/11/09
- [PULL 18/54] target/ppc: Do not update nip on DFP instructions, David Gibson, 2021/11/09
- [PULL 38/54] target/ppc: receive high/low as argument in get/set_cpu_vsr, David Gibson, 2021/11/09
- [PULL 22/54] target/ppc: Move dquai[q], drint{x,n}[q] to decodetree, David Gibson, 2021/11/09
- [PULL 21/54] target/ppc: Move dcmp{u, o}[q], dts{tex, tsf, tsfi}[q] to decodetree, David Gibson, 2021/11/09
- [PULL 24/54] target/ppc: Move dct{dp, qpq}, dr{sp, dpq}, dc{f, t}fix[q], dxex[q] to decodetree, David Gibson, 2021/11/09
- [PULL 33/54] target/ppc: Implement Vector Insert Word from GPR using Immediate insns, David Gibson, 2021/11/09
- [PULL 34/54] target/ppc: Implement Vector Insert from VSR using GPR index insns, David Gibson, 2021/11/09