* Mon Mar 06 2023 Miroslav Rezanina <mrezanin@redhat.com> - 7.2.0-11

- kvm-hw-smbios-fix-field-corruption-in-type-4-table.patch [bz#2169904]
- Resolves: bz#2169904
  ([SVVP] job 'Check SMBIOS Table Specific Requirements' failed on win2022)
This commit is contained in:
Miroslav Rezanina 2023-03-06 02:34:27 -05:00
parent c849977b02
commit cbc169813b
2 changed files with 68 additions and 2 deletions

View File

@ -0,0 +1,59 @@
From 8b0c5c6d356fd6cce9092727e20097b70e07bba9 Mon Sep 17 00:00:00 2001
From: Julia Suvorova <jusual@redhat.com>
Date: Thu, 23 Feb 2023 13:57:47 +0100
Subject: [PATCH] hw/smbios: fix field corruption in type 4 table
RH-Author: Julia Suvorova <None>
RH-MergeRequest: 156: hw/smbios: fix field corruption in type 4 table
RH-Bugzilla: 2169904
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: MST <mst@redhat.com>
RH-Acked-by: Ani Sinha <None>
RH-Commit: [1/1] ee6d9bb6dfa0fb2625915947072cb91a0926c4ec
Since table type 4 of SMBIOS version 2.6 is shorter than 3.0, the
strings which follow immediately after the struct fields have been
overwritten by unconditional filling of later fields such as core_count2.
Make these fields dependent on the SMBIOS version.
Fixes: 05e27d74c7 ("hw/smbios: add core_count2 to smbios table type 4")
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2169904
Signed-off-by: Julia Suvorova <jusual@redhat.com>
Message-Id: <20230223125747.254914-1-jusual@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 60d09b8dc7dd4256d664ad680795cb1327805b2b)
---
hw/smbios/smbios.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index c5ad69237e..2d2ece3edb 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -752,14 +752,16 @@ static void smbios_build_type_4_table(MachineState *ms, unsigned instance)
t->core_count = (ms->smp.cores > 255) ? 0xFF : ms->smp.cores;
t->core_enabled = t->core_count;
- t->core_count2 = t->core_enabled2 = cpu_to_le16(ms->smp.cores);
-
t->thread_count = (ms->smp.threads > 255) ? 0xFF : ms->smp.threads;
- t->thread_count2 = cpu_to_le16(ms->smp.threads);
t->processor_characteristics = cpu_to_le16(0x02); /* Unknown */
t->processor_family2 = cpu_to_le16(0x01); /* Other */
+ if (tbl_len == SMBIOS_TYPE_4_LEN_V30) {
+ t->core_count2 = t->core_enabled2 = cpu_to_le16(ms->smp.cores);
+ t->thread_count2 = cpu_to_le16(ms->smp.threads);
+ }
+
SMBIOS_BUILD_TABLE_POST;
smbios_type4_count++;
}
--
2.31.1

View File

@ -148,7 +148,7 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \
Summary: QEMU is a machine emulator and virtualizer
Name: qemu-kvm
Version: 7.2.0
Release: 10%{?rcrel}%{?dist}%{?cc_suffix}
Release: 11%{?rcrel}%{?dist}%{?cc_suffix}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
# Epoch 15 used for RHEL 8
# Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5)
@ -374,6 +374,8 @@ Patch112: kvm-migration-check-magic-value-for-deciding-the-mapping.patch
Patch113: kvm-target-s390x-arch_dump-Fix-memory-corruption-in-s390.patch
# For bz#2168209 - Qemu coredump after do snapshot of mirrored top image and its converted base image(iothread enabled)
Patch114: kvm-block-temporarily-hold-the-new-AioContext-of-bs_top-.patch
# For bz#2169904 - [SVVP] job 'Check SMBIOS Table Specific Requirements' failed on win2022
Patch115: kvm-hw-smbios-fix-field-corruption-in-type-4-table.patch
%if %{have_clang}
BuildRequires: clang
@ -451,7 +453,7 @@ Requires: %{name}-core = %{epoch}:%{version}-%{release}
Requires: %{name}-docs = %{epoch}:%{version}-%{release}
Requires: %{name}-tools = %{epoch}:%{version}-%{release}
Requires: qemu-pr-helper = %{epoch}:%{version}-%{release}
Requires: virtiofsd = %{epoch}:%{version}-%{release}
Requires: virtiofsd >= 1.5.0
%{requires_all_modules}
%description
@ -1404,6 +1406,11 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%endif
%changelog
* Mon Mar 06 2023 Miroslav Rezanina <mrezanin@redhat.com> - 7.2.0-11
- kvm-hw-smbios-fix-field-corruption-in-type-4-table.patch [bz#2169904]
- Resolves: bz#2169904
([SVVP] job 'Check SMBIOS Table Specific Requirements' failed on win2022)
* Tue Feb 21 2023 Miroslav Rezanina <mrezanin@redhat.com> - 7.2.0-10
- kvm-block-temporarily-hold-the-new-AioContext-of-bs_top-.patch [bz#2168209]
- Resolves: bz#2168209