From nobody Tue Nov 26 13:37:14 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=1707909546; cv=none; d=zohomail.com; s=zohoarc; b=Lh4cwYdH9/L5N6xZ3rb7s2CrpMKBF2Ix4IuGbVswqXWg6a5F4MZs1thYbHwbOykebgtq6bAW1U5GifOqafZLZz9O9gy7tus4/jpa04z2rRxapApiqqTX69wsaKz/vAc9RwySd6ec4ZKKRU0d6JiO3xMDXP5NSDicQ3U2hsGJ7r4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707909546; 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=TmDYJ4T8Bz+NoOI3p2PmjP8oPOJZM9WBKm2EH3ooem4=; b=WZo1rF7GmXyOQkGJABSO2by1v/Bar1C4dvDSlqTWKW4i6NmmcUIydZlZMeNgNxIzO3sEwZ58gF7AIwEF1NRovawNDEScWEdMSAN7SZTzx2ENtxElPVB7Nqt1oAijGLu+p9LkL9Z/hLsqP5mptOdxrjoQCIsf9C1p72S0cdD6/YI= 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 170790954679113.34966224202708; Wed, 14 Feb 2024 03:19:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raDG1-0006bo-IF; Wed, 14 Feb 2024 06:16:53 -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 1raDFQ-0005gZ-Fx for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:16:16 -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 1raDFO-0007PV-Ot for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:16:16 -0500 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-KrpTwIqNNvKaxNxvuKPPcQ-1; Wed, 14 Feb 2024 06:16:12 -0500 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-55fee28d93dso3093902a12.2 for ; Wed, 14 Feb 2024 03:16:12 -0800 (PST) Received: from redhat.com ([2.52.26.67]) by smtp.gmail.com with ESMTPSA id sa9-20020a1709076d0900b00a379be71a84sm2201854ejc.219.2024.02.14.03.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707909374; 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=TmDYJ4T8Bz+NoOI3p2PmjP8oPOJZM9WBKm2EH3ooem4=; b=GQiml0jOQNnKsC1IJBDG8lZ/UnC7aq4eTO7L/oux8QuNYYwfIO0LFZ4M+Gy+gZjGdIJKeD j5agX0CXdsE3T9UWv2xdnukaC27HResP5e4z3iGlT9/ue01JKi8WoQle7hdS5ssIDcL0VU uObjSzcARxr2Tm3HzdNEQTUaUl43Rws= X-MC-Unique: KrpTwIqNNvKaxNxvuKPPcQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707909371; x=1708514171; 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=TmDYJ4T8Bz+NoOI3p2PmjP8oPOJZM9WBKm2EH3ooem4=; b=IbAB4dcu4P/e+dX+ZiNRsI7yQtV6nI7CMmniBInvvy3pqtgwOECfHqbUg2zohlR5jM SY8GuMNiGsC6R5sM2dBYaZMduUudkXnOVdy9bKXGj67yhiFEKVLVWDJ9NmF+HC1XmEg/ u+CIWsSDOhpM+rDcv/VZE94QltkEp864UrS4iQWiyBfVNahLyE5fXGEW9nhAKP+FiuoC ow5EkkK1euZdY92CHxKjPynTmMzZ7huuXBH/7iMYS2t5Tcw3C0A2FoaQ31n4CP3As6ca V4ujC5B+HkRQ2WjVglcOuUABFZrOGojefPL0fXqsTg5VzVwQObzhwoVXL3Lu5yV4neZy E6Mw== X-Gm-Message-State: AOJu0YzqtDs24iX75dmeeE8AxeeUgwxZ+WLaI3JbAWjepCb9uHt/ssTj xHv92GzXyaCF5Ei7n/aRwOrtH+HyNu5FfiiVU6m8A/tr81JVsZcd+wiTq5nCBtfh4QX8BDmGVXp gjaO8NBOEoUKFiHxYoXmRiz9T2X7DxW8W6mI3pe3EtxwIcYdeU1kQOjworhzjGA4LwwNAFTAcUp cWCBp9ttP6S1qt5hOZBObr1GzAhgiAjQ== X-Received: by 2002:a17:906:6812:b0:a3d:967:eab6 with SMTP id k18-20020a170906681200b00a3d0967eab6mr1541431ejr.41.1707909371202; Wed, 14 Feb 2024 03:16:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfSfux0Ajn4HD//6r9kG0i49vcP75ZK0Rox31i0IvPwZ3FGH0d26JuBlCKSkCKmXfiAa9L4A== X-Received: by 2002:a17:906:6812:b0:a3d:967:eab6 with SMTP id k18-20020a170906681200b00a3d0967eab6mr1541413ejr.41.1707909370987; Wed, 14 Feb 2024 03:16:10 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUyAWQoEhiNWMaOP08T7ia0XHrwBo5JKfQZA/Te/QGeyuDOBBv7RQ95OKItvlsFoAjaIhj/8jcMF/W+fExPeaiIAw8rmmomX88Nd2FJAMCau0h2hUKhUnu82hZHidDBWk8jsLM7cUStYEJRZzubUWgY/5rfBuRs/ZJra+FWINHc9bzLBtBv5AHJMPvt/FP3g/Bgsn4zNwyJFrLB Date: Wed, 14 Feb 2024 06:16:08 -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 55/60] hw/smbios: Fix OEM strings table option validation Message-ID: 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=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 @redhat.com) X-ZM-MESSAGEID: 1707909548146100010 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki 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 Message-Id: <20240129-smbios-v2-1-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 c0c5a81e66..a9048c1342 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -375,6 +375,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, @@ -385,6 +390,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 MST