On 4/17/2024 7:34 AM, Taylor Beebe wrote:
On 4/17/2024 7:09 AM, Oliver Smith-Denny wrote:
On 4/17/2024 7:05 AM, Taylor Beebe wrote:
On 4/17/2024 6:40 AM, Oliver Smith-Denny wrote:
Aside from this, I wonder if we can be more aspirational here. These
EfiRuntimeServicesCode regions without attributes set are, if I am
understanding correctly, from loaded images.
These EfiRuntimeServicesCode regions without attributes set are
not part of loaded image memory. I think that's what you meant but
wanted to clarify.
Are these regions without attributes from image sections that have
been padded to RUNTIME_PAGE_ALLOCATION_GRANULARITY, i.e. they are
the pads? Or are we saying we don't know what these regions are
at this point? It is true in theory someone could just allocate
an EfiRuntimeServicesCode section.
Good question -- I had not considered the extra padding applied
to these allocations. It could be either. The memory map returned
via GetMemoryMap() will merge descriptors together based on type
so it's possible to mistake an unrelated EfiRuntimeServicesCode
allocation with padding applied to a runtime image memory
allocation if they are contiguous.
Taylor and I had an offline conversation and checked on this, my
recent patch moving ImagePropertiesRecordLib to use VirtualSize
instead of SizeOfRawData fixed this. So we should not see any
padding sections as without attributes.
Now, for the case of ARM64, where you have 64k runtime
granularity and often will end up with the case of many
extra pages in a code section, those pages will be marked
as RO and executable, even though they contain garbage. I think
it would be worthwhile to mark the excess garbage pages, if they
exist for a given section, as RP. Nothing should be using them
in any fashion, they are padding.
Oliver
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117934): https://edk2.groups.io/g/devel/message/117934
Mute This Topic: https://groups.io/mt/105570114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-