From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.7371.1686226696181249307 for ; Thu, 08 Jun 2023 05:18:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CNVnkk/f; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A299764CF3 for ; Thu, 8 Jun 2023 12:18:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14A00C4339B for ; Thu, 8 Jun 2023 12:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686226695; bh=UA1LIa21Mo+Qyo+8E2XJKYSp2/Y9Z1n/JaOF9T0sRug=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CNVnkk/fZX8KA4nRNmkxTjYxheBesxjTOanZ6KymiEs85LsuWqoq0LmXDY+20okvj G/LsEDSCrFizapVsfNvbZLBwJpZls22MDDq+3IkkkMfIofOi62mub5OfZIBlkzsmKN xVzv/uLJKc1k9q0bmWk/8vc0HRjGKSqBoglZg0MSmqpA0Scdkm+ztFjxHs0y/EFyxe aOHHONbMx1/Oe2p//B9PrlGQF+MA4RHg6nYiSCcWBGf2Vybu0wJP0OyOfmeHNoDAex 1so4kf52BASU8tEybPwpu/YvILXhYL/jaqyYRy3uZZjCXg0KyROiiEf5govGGLgXW2 IICXXa4lVmj5g== Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2b203891b2cso4782461fa.3 for ; Thu, 08 Jun 2023 05:18:14 -0700 (PDT) X-Gm-Message-State: AC+VfDx2gwAHcsDFxqsPwR7AYyKxWyApIHjW8s37J0WidrzsUgEGmGQw D9wCH4jL7+FhxMyjMYLHVHVMpLYJo0A4V8HZVi0= X-Google-Smtp-Source: ACHHUZ4+vgJGPiaO4HAhAcqDOOVIWmjBOqVMcX8ReHbK0X57jTGTyhv4UmYEaoXOXrrfvOzTAFBy4XjG9rauc2mPBKg= X-Received: by 2002:a2e:9859:0:b0:2b1:bf75:4482 with SMTP id e25-20020a2e9859000000b002b1bf754482mr3134961ljj.36.1686226693172; Thu, 08 Jun 2023 05:18:13 -0700 (PDT) MIME-Version: 1.0 References: <20230608022742.1292-1-dun.tan@intel.com> <20230608022742.1292-3-dun.tan@intel.com> In-Reply-To: <20230608022742.1292-3-dun.tan@intel.com> From: "Ard Biesheuvel" Date: Thu, 8 Jun 2023 14:18:01 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [Patch V5 02/14] MdeModulePkg: Remove RO and NX protection when unset guard page To: devel@edk2.groups.io, dun.tan@intel.com Cc: Liming Gao , Ray Ni , Jian J Wang Content-Type: text/plain; charset="UTF-8" On Thu, 8 Jun 2023 at 04:28, duntan wrote: > > Remove RO and NX protection when unset guard page. > When UnsetGuardPage(), remove all the memory attribute protection > for guarded page. > Why is it acceptable to remove NX protections here? > Signed-off-by: Dun Tan > Cc: Liming Gao > Cc: Ray Ni > Cc: Jian J Wang > --- > MdeModulePkg/Core/PiSmmCore/HeapGuard.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Core/PiSmmCore/HeapGuard.c b/MdeModulePkg/Core/PiSmmCore/HeapGuard.c > index 8f3bab6fee..7daeeccf13 100644 > --- a/MdeModulePkg/Core/PiSmmCore/HeapGuard.c > +++ b/MdeModulePkg/Core/PiSmmCore/HeapGuard.c > @@ -553,7 +553,7 @@ UnsetGuardPage ( > mSmmMemoryAttribute, > BaseAddress, > EFI_PAGE_SIZE, > - EFI_MEMORY_RP > + EFI_MEMORY_RP|EFI_MEMORY_RO|EFI_MEMORY_XP > ); > ASSERT_EFI_ERROR (Status); > mOnGuarding = FALSE; > -- > 2.31.1.windows.1 > > > > > >