From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Volker Rümelin" <vr_qemu@t-online.de>,
"Sunil Muthuswamy" <sunilmut@microsoft.com>,
"Reinoud Zandijk" <reinoud@netbsd.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 2/2] accel/nvmm: Fix NULL dereference in nvmm_init_vcpu()
Date: Mon, 29 Apr 2024 11:19:18 +0200 [thread overview]
Message-ID: <20240429091918.27429-3-philmd@linaro.org> (raw)
In-Reply-To: <20240429091918.27429-1-philmd@linaro.org>
When mechanically moving the @dirty field to AccelCPUState
in commit 79f1926b2d, we neglected cpu->accel is still NULL
when we want to dereference it.
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Suggested-by: Volker Rümelin <vr_qemu@t-online.de>
Fixes: 79f1926b2d ("accel/nvmm: Use accel-specific per-vcpu @dirty field")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/i386/nvmm/nvmm-all.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
index f9cced53b3..65768aca03 100644
--- a/target/i386/nvmm/nvmm-all.c
+++ b/target/i386/nvmm/nvmm-all.c
@@ -982,7 +982,7 @@ nvmm_init_vcpu(CPUState *cpu)
}
}
- cpu->accel->dirty = true;
+ qcpu->dirty = true;
cpu->accel = qcpu;
return 0;
--
2.41.0
next prev parent reply other threads:[~2024-04-29 9:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 9:19 [PATCH 0/2] accel: Fix NULL deref in NVMM / WHPX vCPU init Philippe Mathieu-Daudé
2024-04-29 9:19 ` [PATCH 1/2] accel/whpx: Fix NULL dereference in whpx_init_vcpu() Philippe Mathieu-Daudé
2024-04-29 9:19 ` Philippe Mathieu-Daudé [this message]
2024-04-29 12:24 ` [PATCH 0/2] accel: Fix NULL deref in NVMM / WHPX vCPU init Richard Henderson
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=20240429091918.27429-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=reinoud@netbsd.org \
--cc=richard.henderson@linaro.org \
--cc=sunilmut@microsoft.com \
--cc=vr_qemu@t-online.de \
/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).