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
F81200148: D37931.diff
Fri, Apr 12, 10:48 AM
Unknown Object (File)
Thu, Mar 21, 12:33 PM
Unknown Object (File)
Wed, Mar 20, 11:42 AM
Unknown Object (File)
Wed, Mar 20, 11:42 AM
Unknown Object (File)
Wed, Mar 20, 11:30 AM
Unknown Object (File)
Feb 28 2024, 9:38 AM
Unknown Object (File)
Feb 3 2024, 8:17 AM
Unknown Object (File)
Jan 18 2024, 1:17 PM
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 Not Applicable
Unit
Tests Not Applicable

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.