From nobody Tue Nov 26 14:43:02 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=1706426194; cv=none; d=zohomail.com; s=zohoarc; b=PyDLT54x4W+huccxRMa/e0l8PtGB1394iJRzjgE6l6Tmp0f6sXlOTofaA0ydPwnNcZLVy2e1tQxuiZNeRDdIRDAltfSD3+FSJIdu2wMtMK8EUJg9vlzktu4WwtYG3ivdM119b3xRzAL2rUDJvk49lzSYJwcAp53ecK+xw+PlJPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706426194; 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=V1KoYGLz/4ZfG7upt/fBifSuqVAkdhjRoiQkFAgHFg4=; b=PDudP7Lbg8MVezos5w7lHYrPeMcxGpDAqgPvHA6q0xp5Xkcu3A5Poidm9jS3E1BTKaobgSCa0SFHq/rsXufB0m4hAYla8dbrQ3L6J7ScakpscU2S0HpXZnGBEClIVAxumsGZFIq5h+Kd5yqpGb0T8N7h5x5ufSUm+w00OY8l++8= 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 1706426194780511.6395458591579; Sat, 27 Jan 2024 23:16:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTzOL-00038e-Gs; Sun, 28 Jan 2024 02:15:45 -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 1rTzOG-00036I-9D for qemu-devel@nongnu.org; Sun, 28 Jan 2024 02:15:41 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTzOE-0004AP-05 for qemu-devel@nongnu.org; Sun, 28 Jan 2024 02:15:39 -0500 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso1307463a12.3 for ; Sat, 27 Jan 2024 23:15:37 -0800 (PST) Received: from localhost ([157.82.200.138]) by smtp.gmail.com with UTF8SMTPSA id j2-20020a635942000000b005d5445349edsm3768544pgm.19.2024.01.27.23.15.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Jan 2024 23:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1706426135; x=1707030935; 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=V1KoYGLz/4ZfG7upt/fBifSuqVAkdhjRoiQkFAgHFg4=; b=qcCtPhMEeEACfeV9D1TBUNDMZ5wNnZm3aadHt5UTZyhQdNYHaj4VoNEQY6jmsbE6wI 5287o8pO+UwE8Fj0X8TqhUEGW4kgNIrbyydvZF9p06Udd+N1Bus7GMdP7E7zft88f2eD UpLPdHeANsXt8Yn1bTONxtCmXh421V176EcckZzbNw08ROx/9SgdEGik3iaGzNdyShEn RMIrfmyLT7CD1uWM3/dvvmg06J9rQoDY/kqosp2P1BjpcIZ1UgKU9kfospv/OD7QE5bD KZt+XFl8vqZQrGdkbzKQ5edSP2/YZLbQol8NYsBNXS7MP/w3IFrd8UnH8tUZBVgJYjL9 vbKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706426135; x=1707030935; 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=V1KoYGLz/4ZfG7upt/fBifSuqVAkdhjRoiQkFAgHFg4=; b=s+imsbRuNRiMApGz5GwM0Icfhp46VQNfvj9avfuIkrPZpuf2UT+ioXC0GTPYtHE5w0 AdE98p59957s74SibgaB5ey8mKk+b5R5fQ9aZFa2Tx6BVLp4dm7LUJ+efLywZIb/dDQl rgqOooazTOKndbcfQI0++NNdQXWo/yuR3mgXo8eMcJ6rDBSIx3rMLcyFaRMSNKcmZu+r vZ+R6Z+lh38fxRmCw8mYgdTIsavTlI3OuZyDP+jUh5LOGYhu3yPeA0IsR7dWyQ3YOvlK v5/zwfD5LIZz1MIUCRwJFTSnpDLKf72MsItVPdLtgzRUpVSll8ydbdthDakKMZ/4TLp/ QJPA== X-Gm-Message-State: AOJu0Yw810131YAI7fQzeKU1koTCEPMbzElLqimsswszmMsrBWaiKOr5 yBejHqiobXwXKRarnP4ESYmUQz8eemkrUDZcFwTbF02PAFC/M9oNyPYlc5y46HQ= X-Google-Smtp-Source: AGHT+IH1Gj4h83KVztRR3824U4dHXQZufuERRVW0vyKYzfcesgXCJDY2f61wsZHyphCICBbprzIHsQ== X-Received: by 2002:a05:6a20:2045:b0:19a:ef21:60a0 with SMTP id x5-20020a056a20204500b0019aef2160a0mr2532304pzx.25.1706426135505; Sat, 27 Jan 2024 23:15:35 -0800 (PST) From: Akihiko Odaki Date: Sun, 28 Jan 2024 16:15:28 +0900 Subject: [PATCH 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: <20240128-smbios-v1-1-c3a50499baea@daynix.com> References: <20240128-smbios-v1-0-c3a50499baea@daynix.com> In-Reply-To: <20240128-smbios-v1-0-c3a50499baea@daynix.com> To: "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Cc: qemu-devel@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::52e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52e.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: 1706426195588100004 qemu_smbios_type11_opts did not the list terminator and that resulted in out-of-bound memory access. qemu_smbios_type11_opts also needs to have an element for the type option. Fixes: 2d6dcbf93fb0 ("smbios: support setting OEM strings table") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev --- 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:43:02 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=1706426194; cv=none; d=zohomail.com; s=zohoarc; b=JUp2+TPi3ATFCLSP6VvnsF0vX6rZMbssqHh8zAXTRZXzs4SoK18Opc7/ZLJ8pmHEj7qt5YMysIHVi1apw4pgzrgKYGzkpcH4NJAOk8MkgVhscCVHNOq+HAHfq8bl8stv6LOSbXMoY7tZn3ry/4dkJwUZLE/5TxVCxGjy8Ii7vwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706426194; 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=aLm9YsebySTPKhyLwpQObdZvcROKL7J1ig92T/Jq260=; b=nQjgGmpFShEw2/3yX6Q5Mr+dufDaioppThj4ay0R+Bqogbse9gV/F8Pdbzex1P2XqVPXjcPIDkIuz3EKAXYegH3qhfNCLXmhVmvp13dBmUqK8aM0Z2aA4QY8R/Cq2q+GOl9DaE7h/1/J//ZA1RiGMVss8gY+CdvRpBBJk2lNv/M= 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 1706426194779153.25848064966772; Sat, 27 Jan 2024 23:16:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTzOM-00039G-Bz; Sun, 28 Jan 2024 02:15: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 1rTzOJ-00037b-Kz for qemu-devel@nongnu.org; Sun, 28 Jan 2024 02:15:43 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTzOG-0004BN-OO for qemu-devel@nongnu.org; Sun, 28 Jan 2024 02:15:41 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5d81b08d6f2so1680918a12.0 for ; Sat, 27 Jan 2024 23:15:40 -0800 (PST) Received: from localhost ([157.82.200.138]) by smtp.gmail.com with UTF8SMTPSA id v189-20020a6261c6000000b006ddc77dc4fasm3997916pfb.11.2024.01.27.23.15.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Jan 2024 23:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1706426139; x=1707030939; 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=aLm9YsebySTPKhyLwpQObdZvcROKL7J1ig92T/Jq260=; b=FQ0J096ho7hu3k4flT1E5jzaBkfR2BJam02B+SSkFfV586bFe4tPVP+v/hEDil5WSe gtGmrM3cj8FpGUCtpRFi1Gmvph1M8osrFWAFrgr1x9L5kSs98nW+XXptYz8eCrQugFIY WI0RPGQr5rwOA2ZZ1FxihDWf3w4jTKaLIJV26iO78MbAZs1/KLlZvBsbq3aZjdMl8Jje Akn9Tw0+qwrOcPQblO89Dn1kDjkmALQyjFD+IfRWp54JhOZfo1gd/wIBEewsVfqnXVju 1eI1nxjoYICmC2RsEAMM6Q90mD5vk209hnnTySutdkJ4IxH2fW+7Ud5kdHbgooJ8p0Ju 8wfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706426139; x=1707030939; 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=aLm9YsebySTPKhyLwpQObdZvcROKL7J1ig92T/Jq260=; b=eDh1+Xhsg/fVcbAfdAu9RRuti3EZ+beqEGbxnsjw3Ba6RJN3XPoUljKN3IrNVdVGqu Na43XG4lX1JDK5c2S8ivH4MVjzwTqH0Ginmwt6VydaGZa2GlXN9gM49+fCWC0mXLcPNC cAYnruNr63yxaygLXBKnFHW0w9Z+BIl4xUaimUhzqzIM89+HCjxH+qE9rssCa5zw7Khy bVnKMZz6edODr6ZhLT6RC79uM3yR9IDjZc7xVvJGFie/AQQWD7jDQhaoRxUf3yQ3XNo1 lU8TAWwt32aP+/AgrGzV8R6dE+TVpFCffR4xX5KJ0Jis9EkHIeyU13dtI4skryGb3fT6 PJqA== X-Gm-Message-State: AOJu0YxKP8m73z8Kr+cbNrUn+BD7UBTg8Z/6LzyDo3jI0ooAayYEcKOs ubOmIxR08OmnxdmhNcqb5867CLdya6tro+Mb80RDT8EaxIoPvE6oiQx4b0DerZY= X-Google-Smtp-Source: AGHT+IGe56P6vnPEph9BavikVLhnaZvkmHWEHJD1iYt0IGE9c8TFmcu3lLPppBV4pLjawQK78SbdBA== X-Received: by 2002:a05:6a20:9f8c:b0:19c:5734:b725 with SMTP id mm12-20020a056a209f8c00b0019c5734b725mr2819858pzb.35.1706426139309; Sat, 27 Jan 2024 23:15:39 -0800 (PST) From: Akihiko Odaki Date: Sun, 28 Jan 2024 16:15:29 +0900 Subject: [PATCH 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: <20240128-smbios-v1-2-c3a50499baea@daynix.com> References: <20240128-smbios-v1-0-c3a50499baea@daynix.com> In-Reply-To: <20240128-smbios-v1-0-c3a50499baea@daynix.com> To: "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Cc: qemu-devel@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::532; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x532.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: 1706426195502100001 qemu_smbios_type8_opts did not the list terminator and that resulted in out-of-bound memory access. qemu_smbios_type8_opts also needs to have an element for the type option. Fixes: fd8caa253c56 ("hw/smbios: support for type 8 (port connector)") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev --- 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