From nobody Tue May 7 21:53:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43739+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43739+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563223204; cv=none; d=zoho.com; s=zohoarc; b=KVmjfUtJPmaMQC7U5P9cUUK/1hI+xZt2IPuPQ52zzuBFjCz/0jsl/NNHB/9+81sDZjvDrWWlEtEvL12ckFGyFEVNgk4a8nN5kyUoLDN6A/GnYpS0Ut7y0MlcshscSLjfNwVFY3M6XDJheWClSQfyUt1Mr8lFrdVBRODWFuKmXO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563223204; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=LezUJ9NmRhWG4xWCpVOCNmFPw32DoVD9JrqturwZgX8=; b=WZE35CYjf3+eUrcpKfaKa1FbYIXcLI3p7LAGf9e1qPsgK07Tb4ZNoo7vFX+70QQREaa355BBevFAptGuX4WVmvG3fjrpxUMIvfkf9cFi/0dTlIbgonNg160aGfdbq3vLn1v3glsg49GAPur77QsADs8p8euA3430wTGF0FtW+dw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43739+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563223204722457.69942084522154; Mon, 15 Jul 2019 13:40:04 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Mon, 15 Jul 2019 13:39:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 13:39:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,494,1557212400"; d="scan'208";a="318784580" X-Received: from nldesimo-desk1.amr.corp.intel.com ([10.7.159.63]) by orsmga004.jf.intel.com with ESMTP; 15 Jul 2019 13:39:56 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Chasel Chiu , Michael A Kubacki , Sai Chaganty Subject: [edk2-devel] [edk2-platforms] [PATCH] KabylakeSiliconPkg: Possible out-of-bounds memory writes Date: Mon, 15 Jul 2019 13:39:33 -0700 Message-Id: <20190715203933.29256-1-nathaniel.l.desimone@intel.com> Precedence: Bulk List-Unsubscribe: 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,nathaniel.l.desimone@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563223204; bh=uVlwWskRmwu90ewX4/y9mSY6V+Wnqli3JSdktNnpaOQ=; h=Cc:Date:From:Reply-To:Subject:To; b=GtLPA91rVnAitYru31cH8bTb/OIa7klQA6FobXY/BEOREwKhFpIfuyNt8jSkYEjtfpy Hl2Bm0InUx9Skr+nKQznIcpBOUrhwZ8n6mObyCVHzvnztl13YjdkIAMt7kp1tx2tXfhEi 6Ix7o7nO1SGvCj8di/LqGIwRCP8mlP8tN/A= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" - Add check for the DSDT not existing. - Fixed logic errors in loop boundary check. Cc: Chasel Chiu Cc: Michael A Kubacki Cc: Sai Chaganty Co-authored-by: John Mathews Signed-off-by: Nate DeSimone --- .../Library/DxeAslUpdateLib/DxeAslUpdateLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAs= lUpdateLib.c b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/Dxe= AslUpdateLib.c index e6ab43db6d..a9611f750f 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdate= Lib.c +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdate= Lib.c @@ -59,6 +59,7 @@ InitializeAslUpdateLib ( @param[in] Length - length of data to be overwritten =20 @retval EFI_SUCCESS - The function completed successfully. + @retval EFI_NOT_FOUND - Failed to locate AcpiTable. **/ EFI_STATUS UpdateNameAslCode ( @@ -99,11 +100,14 @@ UpdateNameAslCode ( /// Point to the beginning of the DSDT table /// CurrPtr =3D (UINT8 *) Table; + if (CurrPtr =3D=3D NULL) { + return EFI_NOT_FOUND; + } =20 /// /// Loop through the ASL looking for values that we must fix up. /// - for (DsdtPointer =3D CurrPtr; DsdtPointer <=3D (CurrPtr + ((EFI_ACPI_COM= MON_HEADER *) CurrPtr)->Length); DsdtPointer++) { + for (DsdtPointer =3D CurrPtr; DsdtPointer < (CurrPtr + ((EFI_ACPI_COMMON= _HEADER *) CurrPtr)->Length); DsdtPointer++) { /// /// Get a pointer to compare for signature /// --=20 2.17.1.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43739): https://edk2.groups.io/g/devel/message/43739 Mute This Topic: https://groups.io/mt/32482901/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-