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 85B54740034 for ; Thu, 19 Oct 2023 06:22:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3S/VvR3z5UEvI+9Pa4GEe/Pzp648zf0J841E6czy+lI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id: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=1697696522; v=1; b=l6BN6vQXa0w/VikMm7cf+5dBFivEMolzCt0xUA9fPjiyJ7jZjXSFq3SQplcieQfvPoKvGs0I vcjmy4DkTlJ97X4d8LQKEr4dgL4+UHr55+20JJxHetVVhbb9+5dcro3XXuJ1jFvEABk2BIn16gD CmypaLC0vc1hpcRL0s/jX4Cw= X-Received: by 127.0.0.2 with SMTP id eCVpYY7687511xvq586MBow9; Wed, 18 Oct 2023 23:22:02 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.21311.1697696521226996686 for ; Wed, 18 Oct 2023 23:22:01 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="365533541" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="365533541" 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:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="900632396" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="900632396" 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:19:53 -0700 From: "sunceping" To: devel@edk2.groups.io Cc: sunceping , Gerd Hoffmann , Jiewen Yao , Min Xu Subject: [edk2-devel] [PATCH V1 0/2] OvmfPkg/AcpiPlatformDxe: Fix the coverity errors Date: Thu, 19 Oct 2023 14:21:40 +0800 Message-Id: <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: JmhMViptRbpIKizLOK4bbcfEx7686176AA= 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=l6BN6vQX; 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 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4568 Coverity report 2 issues in OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c. In the function InstallCloudHvTablesTdx, the pointer is already checked. if (DsdtTable == NULL) { DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __func__)); ASSERT (FALSE); } But this comes into play only in DEBUG mode, in Release mode, that would be an error with dereferencing null pointer. Fix this by adding CpuDeadLoop() after assert. In addition, the status of "AcpiProtocol->InstallAcpiTable" is overwritten before it can be used in the function, it is better to check it before overwriting. code: https://github.com/sunceping/edk2/tree/fixcoverityerrors.v1 Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Min Xu Signed-off-by: Ceping Sun Ceping Sun (2): OvmfPkg/AcpiPlatformDxe: Avoid possible NULL pointer dereference OvmfPkg/AcpiPlatformDxe: Check the status to ensure no error OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109791): https://edk2.groups.io/g/devel/message/109791 Mute This Topic: https://groups.io/mt/102055422/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-