From nobody Fri Mar 29 13:51:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600265143; cv=none; d=zohomail.com; s=zohoarc; b=TTi5FpSRZ+HRC6sQQkgk5p1HxTgJhYsThSA+Eu2Idb3qKUWQjhdMwOyQ79GTwOAvHQFwWxlJsvFfPxbNzfy+hw6euVONM+ZC2c8mpbiiTgJMkqeBsvXYP6Ce+SMfj3PzyynYBHTTCcVi16PxEflGuznMKtffcw6wWmkQOvvJOYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600265143; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=spes70wtRxtdTrcsgJaD3iqBO0Btd1aOtLaRW5v7QV8=; b=hngPiTwVGi9iyHgVb/fJ1OpbO2lJmPajGB3cEUqm9/a1CJ5vTM1Nxc/VDcI7LvhWC0N2ZZtCUcgJxjzTSoT9aPgOjaIx6OcmqvsCFpdLLQVQ2VcDxcef16AcfjOcYAXeGyMSwLP0LWGhKNMsZdwp9SmqV7Eq/OZXcFYehZREwDs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600265143920623.4270756171379; Wed, 16 Sep 2020 07:05:43 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-P8I9E5ZbPQiRHDNvZZx0oQ-1; Wed, 16 Sep 2020 10:05:39 -0400 Received: by mail-wm1-f70.google.com with SMTP id l26so863360wmg.7 for ; Wed, 16 Sep 2020 07:05:39 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id h2sm34287479wrp.69.2020.09.16.07.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 07:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600265141; 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: content-transfer-encoding:content-transfer-encoding; bh=spes70wtRxtdTrcsgJaD3iqBO0Btd1aOtLaRW5v7QV8=; b=f/8/jRN51aO9WMxELV1dgqzJUXHTxnTq6cCjp1YLX1BAkPgdL/+ImYQUJvAVFZijXspoLq xyvfmeBE/w6q+r/JmeMUgbjite7pvVVoIEvvjz0IhOdVyH7OVfcTTPHhoPOD/9F9GcMw9p 2Y79j2wozGyuQfunM4k8sWbCoydWRd0= X-MC-Unique: P8I9E5ZbPQiRHDNvZZx0oQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=spes70wtRxtdTrcsgJaD3iqBO0Btd1aOtLaRW5v7QV8=; b=p8K3jmcZJbDhdbNfoWxMbfthuTr5GOJDFnyxlSEKVUskuU8yLkxd0NsabLvX74HIzp /7vrN06H6zIv7R6hrYhtRlGpCU6MVZtUXtR3ub8JOmNCH8nie+oFqNUL9VwnKzQo/emN LJ07kDqqoi7W8yI3YlpX916M1b3IOTIlwYiFyHTFVFqnmIdohNlhU6WuGLXfRFe+hKKk Xvf8XK+kh6DfB2We2b/+N/6OOKm0wfeSJFvvSNRWWMklcbhGeJiInyHiJuqU+m8nnrqH bhQ0GPgrPhjqwbQAQ47jEdrdcRcYnDgA5968ab6WQ0zv18cr6DSoU26Eixpur4M//gSL nlAw== X-Gm-Message-State: AOAM533FWXw/2thpoeXcYxut49XpoC6mKC/E8vTVUiGcOCEPgQJIG9Kk uMDxmmKM4x7bZInpyan9bTH6dEjVXwazAOFUnOMR3hP5SUr3oNl+pRp+AnXdRmG15PtaySwhH3J dc3CPJ7JyxW+bcw== X-Received: by 2002:a1c:f415:: with SMTP id z21mr4928678wma.88.1600265138313; Wed, 16 Sep 2020 07:05:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfES5XFnVH5c+U5/0Ym5qbYmcb+SSSvr6TS2UjqsDODxUKrz16b2X33C5Qw+AwEGAv6Fws2Q== X-Received: by 2002:a1c:f415:: with SMTP id z21mr4928656wma.88.1600265138118; Wed, 16 Sep 2020 07:05:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laszlo Ersek , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH] hw/nvram/fw_cfg: Assert linked data is not NULL Date: Wed, 16 Sep 2020 16:05:35 +0200 Message-Id: <20200916140535.1451663-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The linked data passed to the fw_cfg device must not be NULL. Add an assertion. Reported-by: Laszlo Ersek Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/nvram/fw_cfg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index f3a4728288e..40dcc08b57b 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -711,6 +711,7 @@ static void fw_cfg_add_bytes_callback(FWCfgState *s, ui= nt16_t key, =20 key &=3D FW_CFG_ENTRY_MASK; =20 + assert(data); assert(key < fw_cfg_max_entry(s) && len < UINT32_MAX); assert(s->entries[arch][key].data =3D=3D NULL); /* avoid key conflict = */ =20 --=20 2.26.2