From nobody Tue Nov 26 16:22:09 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