Page MenuHomeFreeBSD

stand/efi/loader/copy.c: make sure kernel image is executable
ClosedPublic

Authored by fuz on Jan 2 2023, 9:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 12:48 PM
Unknown Object (File)
Sat, Nov 2, 5:44 PM
Unknown Object (File)
Oct 4 2024, 6:01 PM
Unknown Object (File)
Oct 4 2024, 10:31 AM
Unknown Object (File)
Oct 1 2024, 9:27 AM
Unknown Object (File)
Sep 30 2024, 9:34 AM
Unknown Object (File)
Sep 28 2024, 3:35 AM
Unknown Object (File)
Sep 27 2024, 12:55 AM
Subscribers

Details

Summary

The Windows Dev Kit 2023 (Volterra) has an UEFI implementation that maps
EfiLoaderData pages as non-executable. Map the kernel as EfiLoaderCode
to ensure that it can be executed.

With this change, FreeBSD boots to the mountroot prompt if
hw.pac.enable = 0 is set in loader.conf(5).

Revisions D37765, D37766, and D37767 are needed for this one to work.

Sponsored by: Berliner Linux User Group e.V.
Sponsored by: spline / FU-Berlin

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 48938
Build 45827: arc lint + arc unit

Event Timeline

fuz requested review of this revision.Jan 2 2023, 9:27 PM

If I revert D37766, it still boots the same, so I guess it is not.

I have also not exhaustively checked if all four changes are needed. @andrew advised me to bulk-replace EfiLoaderData with EfiLoaderCode and that worked.

These are the only ones I think we need, since none of the others are for executable code.... at least based on my quick grep...

stand/efi/loader/copy.c
333

This is good.

401

This is good.

418

This is good.

441

This is good.

This revision is now accepted and ready to land.Jan 4 2023, 9:28 PM

@imp if you could do the honours and commit this, that would be great. I do not have any bits.

I'll push later today

This revision was automatically updated to reflect the committed changes.