From nobody Sat Feb 7 06:55:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106803+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106803+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1689086247; cv=none; d=zohomail.com; s=zohoarc; b=Tyx1XEjwLpQikpNopGdgLgovz4rHYTZ4WJv/EPMJ1lv68BtoKmlLG7NhlHx08yJzLEmFwJD3c6zbm2F+UzHMnyy0VGggESm5vnQz92VVJYVIqm6/2E9YuSO9SRePB6sWmrCeuKuEZ+/MAOen21gxY+FHLqQtHF8/w272I9VjBIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689086247; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=GfRze4OMdBJTnYxE9K68deBT5CcsZzfTD0xX2OxcWx0=; b=UZ/EM0gCwRPw9FPHf55HicC5HRjRxKEN9EpdYOxs95M/FCQZu7QPX7jqMYm+C+Lg1V18FC/4IRpn6k0in8ZM/yMszpHmWODnaCVl9A3ufolLCIGiBNpWZoaIxBzPpeCVIJX1zEVNq3WWGr6y29ns0jUE87UTuoO7pajkB4uDX/Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106803+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1689086247553122.50619770313597; Tue, 11 Jul 2023 07:37:27 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=f64OS4HKk2bNpjQIKASAT3TkdqfcfE/4od+1IIKIk54=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1689086247; v=1; b=mMwWTheAWk2KmVmjvvAPFDr0a8dhClGh33b9FzvsKsw4vYoPEMLB1wtr/umh76SMOxEpHYG+ XGEKXJ6DvN0PvwAe1+NaFxDKEnz3xx9PQXI3P8UpDYT65w/KBeilxKcGAVmRsD6MsTEeqfBJ6KD vq8RqNp2aKe8bCeDG+dbfFfk= X-Received: by 127.0.0.2 with SMTP id nzFwYY1788612xrvQYhzHrf6; Tue, 11 Jul 2023 07:37:27 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1274.1689086246420024141 for ; Tue, 11 Jul 2023 07:37:26 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5882EC15; Tue, 11 Jul 2023 07:38:08 -0700 (PDT) X-Received: from usa.arm.com (iss-desktop02.cambridge.arm.com [10.1.196.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3AF423F740; Tue, 11 Jul 2023 07:37:25 -0700 (PDT) From: "Nishant Sharma" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta Subject: [edk2-devel] [edk2-platforms][PATCH V1 11/20] StandaloneMmPkg: Skip zero sized sections while tweaking page permissions Date: Tue, 11 Jul 2023 15:36:49 +0100 Message-Id: <20230711143658.781597-12-nishant.sharma@arm.com> In-Reply-To: <20230711143658.781597-1-nishant.sharma@arm.com> References: <20230711143658.781597-1-nishant.sharma@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,nishant.sharma@arm.com X-Gm-Message-State: OzJMw30wvM8iP9rPvS2zVJRRx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689086249388100047 Content-Type: text/plain; charset="utf-8" From: Achin Gupta This patch skips zero sized sections in the StMM SP image e.g. .reloc since there is no point in attempting to change their permissions. Signed-off-by: Achin Gupta Signed-off-by: Nishant Sharma --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c | = 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPerm= issions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermi= ssions.c index 5c6bd0e1d7d2..891e79b32b6f 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions= .c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions= .c @@ -2,7 +2,7 @@ Locate, get and update PE/COFF permissions during Standalone MM Foundation Entry point on ARM platforms. =20 -Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.
+Copyright (c) 2017 - 2023, Arm Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -118,6 +118,22 @@ UpdateMmFoundationPeCoffPermissions ( ImageContext->ImageAddress, SectionHeader.PointerToRawData )); + DEBUG (( + DEBUG_INFO, + "%a: Section %d of image at 0x%lx has %d bytes size\n", + __func__, Index, + ImageContext->ImageAddress, + SectionHeader.Misc.VirtualSize + )); + + // Skip sections with a size of 0 + if (SectionHeader.Misc.VirtualSize =3D=3D 0) { + DEBUG (( + DEBUG_INFO, + "%a: Skipping section %a \n", __func__, SectionHeader.Name + )); + continue; + } =20 // // If the section is marked as XN then remove the X attribute. Further= more, --=20 2.34.1 -=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 (#106803): https://edk2.groups.io/g/devel/message/106803 Mute This Topic: https://groups.io/mt/100079883/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-