From nobody Tue Nov 26 14:48:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1706515474; cv=none; d=zohomail.com; s=zohoarc; b=IQmT6yTudsxbAD4BOrwx0HJ8HlU1EQ6hdaXdvWeW6airRM1YSxvl9Vaq0RfSiqXRlUYbuthV9cSXAZrfYuPwfLSuawxCXfYUvJd/f1csdaSGnnPCpE1/KokdgavialkRLwh29wUH0WwRj/UI4Riz9PjVfT0/DxcA6GkCfYjplRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706515474; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VzVRVHtg9Mk35tPXkbEDWM6r9DNFo9zkJCcDPTPN+mg=; b=YKBsfLcE3iIPcsPrGjUD9a0Ci5mZX4QUFeGP43cFEBUCJladmiQ8PWXu8GDXLPK4nPv+sXGwdk11TgObYiLGUUPXz5mfTyRuSeseN8n9Ch4ttGM2duj7dn+b9eLvGwDN4fanhRYmP5fXc5KXA0d3YgwzJwl/ua2Ghmjlt5FBHYg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706515474180831.3890208794382; Mon, 29 Jan 2024 00:04:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUMcJ-0000Ej-MU; Mon, 29 Jan 2024 03:03:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUMcH-0000E9-7v for qemu-devel@nongnu.org; Mon, 29 Jan 2024 03:03:41 -0500 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUMcF-000567-Np for qemu-devel@nongnu.org; Mon, 29 Jan 2024 03:03:40 -0500 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-59a1a03d09aso739482eaf.3 for ; Mon, 29 Jan 2024 00:03:39 -0800 (PST) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id x22-20020a17090ab01600b00290a270d8bbsm5339584pjq.55.2024.01.29.00.03.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 00:03:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1706515418; x=1707120218; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VzVRVHtg9Mk35tPXkbEDWM6r9DNFo9zkJCcDPTPN+mg=; b=ZeZiBsRqT8pYkAhQ/LyZdThADu3PYc1uQ6Qcv605pABk32q0Eo1OcfzbDuzqTzIro3 NKK9fKzrfRqY4G/YavB34fOv3Kiun7IVEm112T02FwCR0ho3/ZQmdUyT6Uy79b+DYZwg v2Cx3xQF41VX5We2bZ5qp14vl4SnmS1zXM4Lo1kbI03NWHr1RJwLNcqOxlDL920t6+0x EjAFzL+LR6a2PIplXFYMvELjjB9BaX/+YzxPE4ORiFupQ7hDs6x8z2MQvxjltssyFkHk RC8IJAzNsCQcUcnFbVj70ondJedqHsbVcm/OJW+rk8ZLbqVnNBDjFHYDzTznl9YXww0L 3bWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706515418; x=1707120218; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VzVRVHtg9Mk35tPXkbEDWM6r9DNFo9zkJCcDPTPN+mg=; b=AAP+3ErQjq+vhngR6hsO97riDkBw/6kv44XNfvcGvlgADXvNZ2EP/KK+r4MznAAK9L tJlqXccBjaQf2f/VmG5vRFpPDrN0r5sXXJJaGBeRb329GWAbbCP9A4TgDNgiSzAE3Sj2 l1NfCZf+nl7OAhB4lmtFGzEZoBZwn+uZcBMaO70EoXZEQI8HdPoKIFqLF+txfk2zF/Wn tZTmK9d4pgWvLo1Mu0L/Og38YUQgMOcoNLfaK0h5QLfZWclooJbctNuk2+JLTaa8LRzB qPlNkeQAp2sBw777Gv0xOXJ8OwY0ltN65BSHnNB/Mjiuywmt9KpigQRKL2qIhjxp3zzc tVrg== X-Gm-Message-State: AOJu0YyNuTlos5AzQukk6Pdqql+n9PsjXQaZH/XTemQdyoO4BNsGTU4W evZZxy42mpBTprUkIc0nIDClBsF8Lyz0Pj97TcwMCiV/WArWaDA61xsolKpQvYk= X-Google-Smtp-Source: AGHT+IFvz36UbhpYjcsTYr7MBAnVeYjoIlr7WJhjQdfweZtmO1hKOVNlTr+DEDeeN6SBBwtRa/munQ== X-Received: by 2002:a05:6359:4c10:b0:176:5c13:3cb9 with SMTP id kj16-20020a0563594c1000b001765c133cb9mr5524963rwc.3.1706515418534; Mon, 29 Jan 2024 00:03:38 -0800 (PST) From: Akihiko Odaki Date: Mon, 29 Jan 2024 17:03:07 +0900 Subject: [PATCH v2 1/2] hw/smbios: Fix OEM strings table option validation MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240129-smbios-v2-1-9ee6fede0d10@daynix.com> References: <20240129-smbios-v2-0-9ee6fede0d10@daynix.com> In-Reply-To: <20240129-smbios-v2-0-9ee6fede0d10@daynix.com> To: "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Michael Tokarev Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::c2b; envelope-from=akihiko.odaki@daynix.com; helo=mail-oo1-xc2b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1706515476816100001 qemu_smbios_type11_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: 2d6dcbf93fb0 ("smbios: support setting OEM strings table") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev Reviewed-by: Ani Sinha Reviewed-by: Michael S. Tsirkin --- hw/smbios/smbios.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 2a90601ac5d9..522ed1ed9fe3 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -369,6 +369,11 @@ static const QemuOptDesc qemu_smbios_type8_opts[] =3D { }; =20 static const QemuOptDesc qemu_smbios_type11_opts[] =3D { + { + .name =3D "type", + .type =3D QEMU_OPT_NUMBER, + .help =3D "SMBIOS element type", + }, { .name =3D "value", .type =3D QEMU_OPT_STRING, @@ -379,6 +384,7 @@ static const QemuOptDesc qemu_smbios_type11_opts[] =3D { .type =3D QEMU_OPT_STRING, .help =3D "OEM string data from file", }, + { /* end of list */ } }; =20 static const QemuOptDesc qemu_smbios_type17_opts[] =3D { --=20 2.43.0 From nobody Tue Nov 26 14:48:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1706515475; cv=none; d=zohomail.com; s=zohoarc; b=BHm38aSxTBKcIHTP0AifYkcL/fw6x7Bke5B58QcWz4dJfNOY77mRQfEzMafkEruWc6S7vlGATldcmPWvOSJSDzUgLFgzh52CD/TUK0frbLQq/gHr2N5V9esI79I/9nU988tzCJNsDH0KtVqat57Cn8iEKhrZlpW44psY9MuFvBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706515475; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SIxzhhspqMAWnYZrU4WfhbnNIInPUebmookIDK0Fz6g=; b=W0sulMvGzTcLpwZkKj5dq2SfNc4FjxnRRsOeWokyiTudzx/PSd0WDfylf5lbMd3ducdzRfZF20syYX6MOWJNltgz/9Tjus10ZWcTLMI+lOF2hgkh29/dRbBAZbLmi/eTGTxuUmHn77dJK4ZktQz3tI4F3B6T/cJxuZMD3svN5nk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706515475689574.0838164786978; Mon, 29 Jan 2024 00:04:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUMcM-0000FF-0t; Mon, 29 Jan 2024 03:03:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUMcL-0000F0-1r for qemu-devel@nongnu.org; Mon, 29 Jan 2024 03:03:45 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUMcJ-00056o-F9 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 03:03:44 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-29041f26e28so920800a91.0 for ; Mon, 29 Jan 2024 00:03:43 -0800 (PST) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id sh9-20020a17090b524900b0028c5585fb41sm5589015pjb.45.2024.01.29.00.03.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 00:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1706515422; x=1707120222; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SIxzhhspqMAWnYZrU4WfhbnNIInPUebmookIDK0Fz6g=; b=zOTM+J/MjUDd8LVcrmXF4upvr1xdhtgNyTeOdM/WvYLAAMcXELVVANPqfyFNaulUPZ cXn3RSSGr5hWJVRC5QowZw2g2GJ6y6I1/XvA05RRfLzNQg705VOkywmVVKkW7xc4Hz/I zkBxMOLKzAdD6/yzFb8OcZJrYJQ0rxi6PP82L7wFSndE5ptuL6RAZLvQK4rkJB1Z6G7v cXP6FbD4wLRsg9NBMlqUgEsL4fUVdWpe/v6v6TkN3GAyppPBsgfWLhHaIfaUNiuYZJxS QPH+diqaTkwCh4ItTd+UsL/5kTKOF80lufU+1IsuGMpWvYvXxMsoGtfWAl8VeW4i3BY6 4lHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706515422; x=1707120222; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SIxzhhspqMAWnYZrU4WfhbnNIInPUebmookIDK0Fz6g=; b=U+1BNgzWY4LX7Hewes7EMJn17eeqjAdCTWVLAcaJ4/FUUjMZfk4DDHCthNVWUsxqUP cCdq95ibA2l+lkV1KgZ0egRq27gqAhudUThVjIbTzrwmxfkn9Tl7btDCAhgxg2/OzP8e P8BfmY5PpzmfS6fGI5vZhhGU9rbw3OTwnQ+idQoCAhOB+2T07mRbwK8Oi4JNs3oY8vN3 kyR/gos40GlyMetDiEPh9GvRqsXM5zK4j7zIU7+ECNJGiIFeBbG9gf46yzI8lmJscPfP AfLnEAGCjdEXCOaQ/4+2RPRsm3TasnYPkpWjk2cgThI66GQNDV4PnLKZovELdFV7+vYL woiQ== X-Gm-Message-State: AOJu0Yw0YEfLzn/8URruE5atskrAyZQDIq57lvaqutna1Kp5WJoop3kK 9M3XFy2Jz7ibXDQ/7PQdwGICkFcUnD1pItB6WqKlF2S8skHVfU+uP7n1lCSE4d4= X-Google-Smtp-Source: AGHT+IEQq1Z30GAddME/mPXWOsvS4eQO3D5lcT3VbySp+Yo6UU7pAh5C/qFQLnjg9wSxbYLh+EJkgQ== X-Received: by 2002:a17:90a:cc04:b0:28d:70b5:fafb with SMTP id b4-20020a17090acc0400b0028d70b5fafbmr1572192pju.32.1706515422004; Mon, 29 Jan 2024 00:03:42 -0800 (PST) From: Akihiko Odaki Date: Mon, 29 Jan 2024 17:03:08 +0900 Subject: [PATCH v2 2/2] hw/smbios: Fix port connector option validation MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240129-smbios-v2-2-9ee6fede0d10@daynix.com> References: <20240129-smbios-v2-0-9ee6fede0d10@daynix.com> In-Reply-To: <20240129-smbios-v2-0-9ee6fede0d10@daynix.com> To: "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Michael Tokarev Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1029; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1706515477626100007 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 Reviewed-by: Michael Tokarev Reviewed-by: Ani Sinha Reviewed-by: Michael S. Tsirkin --- 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[] =3D { }; =20 static const QemuOptDesc qemu_smbios_type8_opts[] =3D { + { + .name =3D "type", + .type =3D QEMU_OPT_NUMBER, + .help =3D "SMBIOS element type", + }, { .name =3D "internal_reference", .type =3D QEMU_OPT_STRING, @@ -366,6 +371,7 @@ static const QemuOptDesc qemu_smbios_type8_opts[] =3D { .type =3D QEMU_OPT_NUMBER, .help =3D "port type", }, + { /* end of list */ } }; =20 static const QemuOptDesc qemu_smbios_type11_opts[] =3D { --=20 2.43.0