<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/MdeModulePkg/Core, branch trunk</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=trunk</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=trunk'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2024-06-04T03:43:08+00:00</updated>
<entry>
<title>Renormalized end-of-lines from master@27b044605cd5f6b33a3d231576003850b3fe305b</title>
<updated>2024-06-04T03:43:08+00:00</updated>
<author>
<name>kx</name>
<email>kx@radix.pro</email>
</author>
<published>2024-06-04T03:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7e2ccccace24636f29ddc210b94606abd4c7e42b'/>
<id>urn:sha1:7e2ccccace24636f29ddc210b94606abd4c7e42b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MdeModulePkg: Update GCD attribute conversion to support SP attribute</title>
<updated>2024-06-02T01:58:12+00:00</updated>
<author>
<name>Du Lin</name>
<email>du.lin@intel.com</email>
</author>
<published>2024-05-09T02:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=de2330450ff71df5a609fe48e2153eb4854d9359'/>
<id>urn:sha1:de2330450ff71df5a609fe48e2153eb4854d9359</id>
<content type='text'>
Add a new entry into GCD attribute conversion table to convert
EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE to EFI_MEMORY_SP.

Signed-off-by: Du Lin &lt;du.lin@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/SMM: Initialize 'WillReturn' variable</title>
<updated>2024-05-30T01:57:35+00:00</updated>
<author>
<name>Zhiguang Liu</name>
<email>zhiguang.liu@intel.com</email>
</author>
<published>2024-04-24T07:24:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=b40c64ec25986d36e1fd02304daa9d72ac863da6'/>
<id>urn:sha1:b40c64ec25986d36e1fd02304daa9d72ac863da6</id>
<content type='text'>
The local variable 'WillReturn' was being used without prior
initialization in some code paths.
This patch ensures that 'WillReturn' is properly initialized
to prevent undefined behavior.

Signed-off-by: Zhiguang Liu &lt;zhiguang.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Use newly defined Unaccepted Memory Type</title>
<updated>2024-05-08T11:34:49+00:00</updated>
<author>
<name>Sachin Ganesh</name>
<email>sachinganesh@ami.com</email>
</author>
<published>2023-11-21T10:03:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=09340de24676ac8d14b5c9f14d4c7e7d03e6f901'/>
<id>urn:sha1:09340de24676ac8d14b5c9f14d4c7e7d03e6f901</id>
<content type='text'>
EFI_RESOURCE_MEMORY_UNACCEPTED has been officially defined in the PI
1.8 specification. So all temporary solutions have been replaced with
the actual definition.

Cc: Felix Polyudov &lt;felixp@ami.com&gt;
Cc: Dhanaraj V &lt;vdhanaraj@ami.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Signed-off-by: Sachin Ganesh &lt;sachinganesh@ami.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/SMM: Support to unregister SMI handler in SMI handlers</title>
<updated>2024-04-16T04:41:27+00:00</updated>
<author>
<name>Zhiguang Liu</name>
<email>zhiguang.liu@intel.com</email>
</author>
<published>2024-03-11T07:32:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=74f6ce67343f81a842e6af3c599e4ae2a07ee51b'/>
<id>urn:sha1:74f6ce67343f81a842e6af3c599e4ae2a07ee51b</id>
<content type='text'>
This patch fix a use-after-free issue where unregistering an
SMI handler could lead to the deletion of the SMI_HANDLER while it is
still in use by SmiManage(). The fix involves modifying
SmiHandlerUnRegister() to detect whether it is being called from
within the SmiManage() stack. If so, the removal of the SMI_HANDLER
is deferred until SmiManage() has finished executing.
Additionally, due to the possibility of recursive SmiManage() calls,
the unregistration and subsequent removal of the SMI_HANDLER are
ensured to occur only after the outermost SmiManage() invocation has
completed.

Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Jiaxin Wu &lt;jiaxin.wu@intel.com&gt;
Reviewed-by: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;

Signed-off-by: Zhiguang Liu &lt;zhiguang.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert ae1079b386a597108a8070652bf7cdaa4ec3dda3</title>
<updated>2024-04-16T04:41:27+00:00</updated>
<author>
<name>Zhiguang Liu</name>
<email>zhiguang.liu@intel.com</email>
</author>
<published>2024-03-08T05:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=da7858117f12846e5c35922e8917fd0da07dcfef'/>
<id>urn:sha1:da7858117f12846e5c35922e8917fd0da07dcfef</id>
<content type='text'>
This reverts "MdeModulePkg/SMM: Support to unregister
SMI handler inside SMI handler" for better design later.

Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Jiaxin Wu &lt;jiaxin.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Reviewed-by: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Sami Mujawar &lt;sami.mujawar@arm.com&gt;
Signed-off-by: Zhiguang Liu &lt;zhiguang.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert 17b28722008eab745ce186b72cd325944cbe6bf0</title>
<updated>2024-04-16T04:41:27+00:00</updated>
<author>
<name>Zhiguang Liu</name>
<email>zhiguang.liu@intel.com</email>
</author>
<published>2024-03-08T05:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=b594fba4ec5e2a9730979060a24d29d9daaa7bbc'/>
<id>urn:sha1:b594fba4ec5e2a9730979060a24d29d9daaa7bbc</id>
<content type='text'>
This reverts commit "MdeModulePkg/SMM: Disallow unregister
 SMI handler in other SMI handler" for better design later.

Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Jiaxin Wu &lt;jiaxin.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Reviewed-by: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Sami Mujawar &lt;sami.mujawar@arm.com&gt;
Signed-off-by: Zhiguang Liu &lt;zhiguang.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: MemoryProtection: Use ImageRecordPropertiesLib</title>
<updated>2024-03-29T23:56:16+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@linux.microsoft.com</email>
</author>
<published>2024-03-29T20:21:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=37f63deeefa89b7ac28285bc59eca22a5c00eb92'/>
<id>urn:sha1:37f63deeefa89b7ac28285bc59eca22a5c00eb92</id>
<content type='text'>
The functionality to create and delete Image Records has been
consolidated in a library and ensured that MemoryProtection.c's
usage is encapsulated there.

This patch moves MemoryProtection.c to reuse the code in the lib
and to prevent issues in the future where code is updated in one
place but not the other.

Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;

Acked-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Oliver Smith-Denny &lt;osde@linux.microsoft.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: DxeCore: Do Not Apply Guards to Unsupported Types</title>
<updated>2024-03-14T16:29:22+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@linux.microsoft.com</email>
</author>
<published>2024-03-09T19:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e7486b50646d6a645706b61d2f8d74b3dca23ce0'/>
<id>urn:sha1:e7486b50646d6a645706b61d2f8d74b3dca23ce0</id>
<content type='text'>
Currently, there are multiple issues when page or pool guards are
allocated for runtime memory regions that are aligned to
non-EFI_PAGE_SIZE alignments. Multiple other issues have been fixed for
these same systems (notably ARM64 which has a 64k runtime page
allocation granularity) recently. The heap guard system is only built to
support 4k guard pages and 4k alignment.

Today, the address returned to a caller of AllocatePages will not be
aligned correctly to the runtime page allocation granularity, because
the heap guard system does not take non-4k alignment requirements into
consideration.

However, even with this bug fixed, the Memory Allocation Table cannot be
produced and an OS with a larger than 4k page granularity will not have
aligned memory regions because the guard pages are reported as part of
the same memory allocation. So what would have been, on an ARM64 system,
a 64k runtime memory allocation is actually a 72k memory allocation as
tracked by the Page.c code because the guard pages are tracked as part
of the same allocation. This is a core function of the current heap
guard architecture.

This could also be fixed with rearchitecting the heap guard system to
respect alignment requirements and shift the guard pages inside of the
outer rounded allocation or by having guard pages be the runtime
granularity. Both of these approaches have issues. In the former case,
we break UEFI spec 2.10 section 2.3.6 for AARCH64, which states that
each 64k page for runtime memory regions may not have mixed memory
attributes, which pushing the guard pages inside would create. In the
latter case, an immense amount of memory is wasted to support such large
guard pages, and with pool guard many systems could not support an
additional 128k allocation for all runtime memory.

The simpler and safer solution is to disallow page and pool guards for
runtime memory allocations for systems that have a runtime granularity
greater than the EFI_PAGE_SIZE (4k). The usefulness of such guards is
limited, as OSes do not map guard pages today, so there is only boot
time protection of these ranges. This also prevents other bugs from
being exposed by using guards for regions that have a non-4k alignment
requirement, as again, multiple have cropped up because the heap guard
system was not built to support it.

This patch adds both a static assert to ensure that either the runtime
granularity is the EFI_PAGE_SIZE or that the PCD bits are not set to
enable heap guard for runtime memory regions. It also adds a check in
the page and pool allocation system to ensure that at runtime we are not
allocating a runtime region and attempt to guard it (the PCDs are close
to being removed in favor of dynamic heap guard configurations).

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4674
Github PR: https://github.com/tianocore/edk2/pull/5382

Cc: Leif Lindholm &lt;quic_llindhol@quicinc.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Sami Mujawar &lt;sami.mujawar@arm.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;

Signed-off-by: Oliver Smith-Denny &lt;osde@linux.microsoft.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: DxeCore: Correct Runtime Granularity Memory Type</title>
<updated>2024-03-14T16:29:22+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@linux.microsoft.com</email>
</author>
<published>2024-03-09T19:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=68461c2c37afe11c7dda2769efc10bf20d2a7b23'/>
<id>urn:sha1:68461c2c37afe11c7dda2769efc10bf20d2a7b23</id>
<content type='text'>
Per the UEFI spec 2.10, section 2.3.6 (for the AARCH64 arch, other
architectures in section two confirm the same) the memory types that
need runtime page allocation granularity are EfiReservedMemoryType,
EfiACPIMemoryNVS, EfiRuntimeServicesCode, and EfiRuntimeServicesData.
However, legacy code was setting runtime page allocation granularity for
EfiACPIReclaimMemory and not EfiReservedMemoryType. This patch fixes
that error.

Cc: Leif Lindholm &lt;quic_llindhol@quicinc.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Sami Mujawar &lt;sami.mujawar@arm.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;

Signed-off-by: Oliver Smith-Denny &lt;osde@linux.microsoft.com&gt;
Suggested-by: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
</feed>
