From nobody Tue Nov 26 12:34:26 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1707909575; cv=none; d=zohomail.com; s=zohoarc; b=cc0lgp40Y0DX3yED7VT6iChoOSu72cop7jbGhaegbGu1ZbhWgovHaW4NoE0Paxik4ym1vvewKTMDP3ZlAwVMjiV6sjq8dbOnEWeVNI7E1vbNm3lASLcjBNI6sXpH1r2ZKk15Znn4oHyWzktiSMO4NXiFFD7brOfYaWSUvsBIk70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707909575; h=Content-Type: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=w4ENYhUgFnCI8zatThJ4D45wdZB8M6CEIKjVTDexlIE=; b=MZgz7LeKvY/OS0krDfZVVpG+D33bDid3PKBFkLeBnVq78ZqFmJWkD6Rzqk7uCuOYN+WGOedwCGU0DTuk1F2Dl7igaJgn7TecRZi7Az73xxDL2bq4RLHL4ku3nsdOsNaK7dAzQWFgCGLuA8fFU7tYjcS3yTLvz12flcv0nB3ilZ8= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707909575154679.1175484547458; Wed, 14 Feb 2024 03:19:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raDG3-0006gP-FY; Wed, 14 Feb 2024 06:16:55 -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 1raDFU-0005ns-Ij for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:16:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDFS-0007Sr-9B for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:16:20 -0500 Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-1WSgttgHPmaL8Nhgw1dbFw-1; Wed, 14 Feb 2024 06:16:16 -0500 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2d0908edbd0so48678491fa.2 for ; Wed, 14 Feb 2024 03:16:16 -0800 (PST) Received: from redhat.com ([2.52.26.67]) by smtp.gmail.com with ESMTPSA id c8-20020a0564021f8800b0055d312732dbsm4619551edc.5.2024.02.14.03.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707909377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=w4ENYhUgFnCI8zatThJ4D45wdZB8M6CEIKjVTDexlIE=; b=iJ5oVn8znMhZK/lB+I9H6toAS6aPVAxjepVs+InkNu/hmqBE6S8Tom1iemuoBSo6s3mZeN Ohmvx0kkCffZP4KjITqglWpCeUV1pqQpXTj9pknuNotoFL8qNy9KSqHbmr4WOA/jeYrjvR paI582enO/WJR60pCPp15ROyr4FTmmw= X-MC-Unique: 1WSgttgHPmaL8Nhgw1dbFw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707909374; x=1708514174; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=w4ENYhUgFnCI8zatThJ4D45wdZB8M6CEIKjVTDexlIE=; b=JzWlhWFXQAc4EZjGDSSljVNcJq157RObjdOm5uGs/FG8lprTmyqgUXlqXzu7U5EEOz z04KUwR9U66ABs51eJFVW0EOvHrcdCptIlXJPBmmTZcR5TNbkiToMcK0JxWEdeL4ajB3 yRF4u9223+OdgT03e3h14aCPaVtHdoEh923Ov/tQJ2s61kxCyzq4LfIGxZOFsJc2OmRC 06PVwQzW+1dH9A27SjDIJD1Ka0fuwiftm0bDU94uHSFcNtTmeYLUykdA83DM+JRBgex3 XxE0Zcl7/ty8C1YoWrZxYWuYGz/DNN3d15PhRKooip4E7c0J9sXV9w8NOw7DDHWYyMnk Y/Bw== X-Gm-Message-State: AOJu0YzcO+/TpMZSj5WqGsgJ4yAw13o982Rwietf3pvUMMXatnO989qv iu4Cec553r+67Ems9ZTWwcsrPDhy9W1nn4MQSA5YfasT5tr5Pv+IzsFDUxY+2/65s2gTcNoakIu +wQNi0Vo0hzXyFH20AxXZns1ujsJK6k6C3aBstxoozLDGbo3tsxmsn5390XnBC++I3Ol5o/HYGZ ITMJuzeNAo7rbNZ/3CRFJDJgTMPraEog== X-Received: by 2002:a05:6512:3b9e:b0:511:a4bd:bfef with SMTP id g30-20020a0565123b9e00b00511a4bdbfefmr1957636lfv.4.1707909374455; Wed, 14 Feb 2024 03:16:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFF+OqKZCMfufDjJtx8otkLsPpsc9I1uzpC0KIbXQDoj+mcraCvf7AvXISr3Z187fRjrjceSg== X-Received: by 2002:a05:6512:3b9e:b0:511:a4bd:bfef with SMTP id g30-20020a0565123b9e00b00511a4bdbfefmr1957614lfv.4.1707909374146; Wed, 14 Feb 2024 03:16:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWL1bHQDdLCPwalsrug/6tMZWvvKtH+kiycUoW4UEHDfzuYt8tPKZEJ4VjQH1cK3YERq5i7W1zL+x+dVMKaj8eDLbqdyhTQxcBEf592TezjC2+M6MowNd9eqZw8Hpm7PViYCLlOCzub6fRV6qo5/AI+/MMUuhudElKEmVLMX+AIj+BKLc7EB2F8XdFQUVu196WwUjx1rEWDVcdz Date: Wed, 14 Feb 2024 06:16:11 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Akihiko Odaki , qemu-stable@nongnu.org, Michael Tokarev , Ani Sinha , Igor Mammedov Subject: [PULL 56/60] hw/smbios: Fix port connector option validation Message-ID: <33b081e2947db6117b27f8c76544a756053f5514.1707909001.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.504, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1707909576185100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki 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 Message-Id: <20240129-smbios-v2-2-9ee6fede0d10@daynix.com> Reviewed-by: Ani Sinha Reviewed-by: Michael S. Tsirkin Signed-off-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 a9048c1342..a3c4e52ce9 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -352,6 +352,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, @@ -372,6 +377,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 MST