From nobody Mon Feb 9 21:36:49 2026 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+50062+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+50062+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573046018; cv=none; d=zoho.com; s=zohoarc; b=oKhnOv/++30CLVYz9YXUTDaRrjr+70TCXTNwBJuKMiOVfz3a8PsEa3P6zbTQs2KNNpHLu0xoO0glvSh/puLWZPBwougTnAalKz9gjXNe3rF3iyIwk5I6W5+X+xKzcd3bdjjU2UNqZlpxp0tzWF/I+A7ydNOfUrPS053ipoqxV3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046018; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=KJvIXGb3F2FPUkrUeKTCJexnj+oBpCEHEShvTfK0tG8=; b=bThD90EUM1mcJQ86uJupfBx8n3clePUQ/viNHqwPuB7ixXdW8n9Oo2+BPs1xAh2AlqcS0g5IjvPI5OUtufzhs6Oj3V1CC868RN/TxnUSgCU0t1/cXSjtXfAhpDqskGyLykhpk4WoSh8fYeczpfRbN+5fOxS80QxPLV/LNK8pX2g= 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+50062+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 1573046018548698.5364761058096; Wed, 6 Nov 2019 05:13:38 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Wed, 06 Nov 2019 05:13:38 -0800 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web11.8258.1573046015437825197 for ; Wed, 06 Nov 2019 05:13:37 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 05:13:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,274,1569308400"; d="scan'208";a="377043506" X-Received: from shwdeopenpsi777.ccr.corp.intel.com ([10.239.158.59]) by orsmga005.jf.intel.com with ESMTP; 06 Nov 2019 05:13:36 -0800 From: "Wang, Jian J" To: devel@edk2.groups.io Cc: Dandan Bi , Liming Gao , Ray Ni , Hao A Wu , Sean Brogan Subject: [edk2-devel] [PATCH 2/2] MdeModulePkg/Core/Dxe: free page 0 after disabling NULL pointer detection Date: Wed, 6 Nov 2019 21:13:33 +0800 Message-Id: <20191106131333.4684-3-jian.j.wang@intel.com> In-Reply-To: <20191106131333.4684-1-jian.j.wang@intel.com> References: <20191106131333.4684-1-jian.j.wang@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,jian.j.wang@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573046018; bh=9cImyaiZTFZFtHS7pTBF16M8nkUwiA+LGJZu/9Z/8tc=; h=Cc:Date:From:Reply-To:Subject:To; b=a5hOopLDVqJukAkUhAwt5hdn/Fisx86F//s22GJGyBCep5OvtXKYyw50tTxV6THrMM2 5DWfoZDG2R3IKnrhWNfWnVZarIX5hivxenXZl2FQ93Fjk88gRQh14PXIlqiY3c01hOWGc RmKSaazxkP1vSfcuUDW9pBy86xnWwR18kxQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To solve access issue reported by BZ1885, page 0 will be allocated to avoid misuses if NULL pointer detection is enabled. It should be better to be freed after EndOfDxe if BIT7 of PcdNullPointerDetectionPropertyMask is set, because NULL pointer detection is no longer available after EndOfDxe and there will be no access conflict. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1885 Cc: Dandan Bi Cc: Liming Gao Cc: Ray Ni Cc: Hao A Wu Cc: Sean Brogan Signed-off-by: Jian J Wang --- MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/C= ore/Dxe/Misc/MemoryProtection.c index 7a24bd0781..47edf86dfb 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -1094,6 +1094,11 @@ DisableNullDetectionAtTheEndOfDxe ( ); ASSERT_EFI_ERROR (Status); =20 + // + // Page 0 might have be allocated to avoid misuses. Free it here anyway. + // + CoreFreePages (0, 1); + CoreCloseEvent (Event); DEBUG ((DEBUG_INFO, "DisableNullDetectionAtTheEndOfDxe(): end\r\n")); =20 --=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 (#50062): https://edk2.groups.io/g/devel/message/50062 Mute This Topic: https://groups.io/mt/44036075/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-