From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Ani Sinha <anisinha@redhat.com>,
Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org,
Akihiko Odaki <akihiko.odaki@daynix.com>
Subject: [PATCH v2 2/2] hw/smbios: Fix port connector option validation
Date: Mon, 29 Jan 2024 17:03:08 +0900 [thread overview]
Message-ID: <20240129-smbios-v2-2-9ee6fede0d10@daynix.com> (raw)
In-Reply-To: <20240129-smbios-v2-0-9ee6fede0d10@daynix.com>
qemu_smbios_type8_opts did not have the list terminator and that
resulted in out-of-bound memory access. It also needs to have an element
for the type option.
Cc: qemu-stable@nongnu.org
Fixes: fd8caa253c56 ("hw/smbios: support for type 8 (port connector)")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/smbios/smbios.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 522ed1ed9fe3..8a44d3f271de 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -346,6 +346,11 @@ static const QemuOptDesc qemu_smbios_type4_opts[] = {
};
static const QemuOptDesc qemu_smbios_type8_opts[] = {
+ {
+ .name = "type",
+ .type = QEMU_OPT_NUMBER,
+ .help = "SMBIOS element type",
+ },
{
.name = "internal_reference",
.type = QEMU_OPT_STRING,
@@ -366,6 +371,7 @@ static const QemuOptDesc qemu_smbios_type8_opts[] = {
.type = QEMU_OPT_NUMBER,
.help = "port type",
},
+ { /* end of list */ }
};
static const QemuOptDesc qemu_smbios_type11_opts[] = {
--
2.43.0
next prev parent reply other threads:[~2024-01-29 8:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 8:03 [PATCH v2 0/2] hw/smbios: Fix option validation Akihiko Odaki
2024-01-29 8:03 ` [PATCH v2 1/2] hw/smbios: Fix OEM strings table " Akihiko Odaki
2024-01-30 7:06 ` Ani Sinha
2024-01-29 8:03 ` Akihiko Odaki [this message]
2024-01-30 7:04 ` [PATCH v2 2/2] hw/smbios: Fix port connector " Ani Sinha
2024-02-04 4:57 ` [PATCH v2 0/2] hw/smbios: Fix " Michael Tokarev
2024-02-04 12:08 ` Michael S. Tsirkin
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=20240129-smbios-v2-2-9ee6fede0d10@daynix.com \
--to=akihiko.odaki@daynix.com \
--cc=anisinha@redhat.com \
--cc=imammedo@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).