From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: Shivang Upadhyay <shivangu@linux.ibm.com>,
Aditya Gupta <adityag@linux.ibm.com>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [PULL 2/5] ppc/pnv: Fix uninitialized MpiplProcDumpArea struct
Date: Sat, 23 May 2026 21:57:21 +0530 [thread overview]
Message-ID: <20260523162724.95229-3-harshpb@linux.ibm.com> (raw)
In-Reply-To: <20260523162724.95229-1-harshpb@linux.ibm.com>
From: Shivang Upadhyay <shivangu@linux.ibm.com>
Fix Coverity CID 1658041 by using designated initializers to prevent
uninitialized memory from being written to guest.
Cc: Aditya Gupta <adityag@linux.ibm.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>"
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260508142029.624039-1-shivangu@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/pnv.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 8306754d9a..6a45852174 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -838,18 +838,10 @@ static void pnv_reset(MachineState *machine, ResetType type)
* crash
*/
- MpiplProcDumpArea proc_area;
-
- proc_area.version = PROC_DUMP_AREA_VERSION_P9;
- proc_area.thread_size = cpu_to_be32(sizeof(MpiplPreservedCPUState));
-
- /* These are to be allocated & assigned by the firmware */
- proc_area.alloc_addr = 0;
- proc_area.alloc_size = 0;
-
- /* These get assigned after crash, when QEMU preserves the registers */
- proc_area.dest_addr = 0;
- proc_area.act_size = 0;
+ MpiplProcDumpArea proc_area = {
+ .version = PROC_DUMP_AREA_VERSION_P9,
+ .thread_size = cpu_to_be32(sizeof(MpiplPreservedCPUState)),
+ };
cpu_physical_memory_write(PROC_DUMP_AREA_OFF, &proc_area,
sizeof(proc_area));
--
2.52.0
next prev parent reply other threads:[~2026-05-23 16:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 16:27 [PULL 0/5] PPC Queue for 2026-05-23 Harsh Prateek Bora
2026-05-23 16:27 ` [PULL 1/5] ppc/spapr: Skip system reset for quiesced CPUs Harsh Prateek Bora
2026-05-23 16:27 ` Harsh Prateek Bora [this message]
2026-05-23 16:27 ` [PULL 3/5] target/ppc/kvm: Fix const violation when trimming CPU alias suffix Harsh Prateek Bora
2026-05-23 16:27 ` [PULL 4/5] ppc/pnv: Make PowerNV11 as the default powernv machine Harsh Prateek Bora
2026-05-23 16:27 ` [PULL 5/5] ppc/spapr: Make Power11 as default cpu for pseries Harsh Prateek Bora
2026-05-26 14:58 ` [PULL 0/5] PPC Queue for 2026-05-23 Stefan Hajnoczi
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=20260523162724.95229-3-harshpb@linux.ibm.com \
--to=harshpb@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shivangu@linux.ibm.com \
/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.