From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8CC877803CD for ; Thu, 19 Oct 2023 06:22:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=wLHuMrR8rT2w2XMZ25bOu9DQxfxhc8P4qjxmWYxVrFM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1697696529; v=1; b=NlrBpFFlFkWMf8YPbjnDRbTkgmy+8CyiULRYhDBtTnyGVMinZ0dtTXvUAG2+760jECUlijva /lVn9uKW9r0YWa2BJyyEHTkgW+Umb5f44DEZjUPhDMCJ8alNs4e+Oco5oj2zqNdVUZ+WM6IrzPf wz0CLU0qqVIZ326XxizInBxk= X-Received: by 127.0.0.2 with SMTP id jlv7YY7687511xo5xgIS3RrM; Wed, 18 Oct 2023 23:22:09 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.21317.1697696528851296879 for ; Wed, 18 Oct 2023 23:22:08 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="365533562" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="365533562" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 23:22:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="900632414" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="900632414" X-Received: from cepingsx-mobl1.ccr.corp.intel.com ([10.239.49.140]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 23:20:01 -0700 From: "sunceping" To: devel@edk2.groups.io Cc: Ceping Sun , Gerd Hoffmann , Jiewen Yao , Min Xu Subject: [edk2-devel] [PATCH V1 1/2] OvmfPkg/AcpiPlatformDxe: Avoid possible NULL pointer dereference Date: Thu, 19 Oct 2023 14:21:41 +0800 Message-Id: <20231019062142.417-2-cepingx.sun@intel.com> In-Reply-To: <20231019062142.417-1-cepingx.sun@intel.com> References: <20231019062142.417-1-cepingx.sun@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,cepingx.sun@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: RKIvClcq7e0lhK1trDu7IoFyx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=NlrBpFFl; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4568 The function InstallCloudHvTablesTdx had an Assert when "DsdtTable == NULL", but this comes into play only in DEBUG mode. In Release mode , there is no handling if the pointer is NULL. To avoid the possible null pointer dereference, it is better to handle it when the pointer is null. Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Min Xu Signed-off-by: Ceping Sun --- OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c index d3e73c155e8f..24c22bb646ca 100644 --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -71,6 +71,7 @@ InstallCloudHvTablesTdx ( if (DsdtTable == NULL) { DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __func__)); ASSERT (FALSE); + CpuDeadLoop (); } Status = AcpiProtocol->InstallAcpiTable ( -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109792): https://edk2.groups.io/g/devel/message/109792 Mute This Topic: https://groups.io/mt/102055424/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-