From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 5/6] tests/plugins: fix use-after-free bug
Date: Wed, 20 Mar 2024 11:32:12 +0100 [thread overview]
Message-ID: <20240320103213.1048405-6-pbonzini@redhat.com> (raw)
In-Reply-To: <20240320103213.1048405-1-pbonzini@redhat.com>
rec->count.score is inside rec, which is freed before rec->count.score is.
Reorder the instructions
Reported by Coverity as CID 1539967.
Cc: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
contrib/plugins/howvec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 2d10c87e0fb..94bbc53820a 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -167,9 +167,9 @@ static gint cmp_exec_count(gconstpointer a, gconstpointer b)
static void free_record(gpointer data)
{
InsnExecCount *rec = (InsnExecCount *) data;
+ qemu_plugin_scoreboard_free(rec->count.score);
g_free(rec->insn);
g_free(rec);
- qemu_plugin_scoreboard_free(rec->count.score);
}
static void plugin_exit(qemu_plugin_id_t id, void *p)
--
2.44.0
next prev parent reply other threads:[~2024-03-20 10:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 10:32 [PULL 0/6] QEMU bug fixes for 20240320 Paolo Bonzini
2024-03-20 10:32 ` [PULL 1/6] target/i386: fix direction of "32-bit MMU" test Paolo Bonzini
2024-03-20 10:32 ` [PULL 2/6] vl: convert qemu_machine_creation_done() to Error ** Paolo Bonzini
2024-03-20 10:32 ` [PULL 3/6] vl: do not assert if sev-guest is used together with TCG Paolo Bonzini
2024-03-20 10:32 ` [PULL 4/6] target/i386: Revert monitor_puts() in do_inject_x86_mce() Paolo Bonzini
2024-03-20 10:32 ` Paolo Bonzini [this message]
2024-03-20 10:32 ` [PULL 6/6] meson: remove dead dictionary access Paolo Bonzini
2024-03-20 16:58 ` [PULL 0/6] QEMU bug fixes for 20240320 Peter Maydell
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=20240320103213.1048405-6-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=philmd@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).