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)
Sat, Jun 22, 5:32 PM
Unknown Object (File)
Fri, May 31, 4:17 PM
Unknown Object (File)
Wed, May 29, 7:30 PM
Unknown Object (File)
Wed, May 29, 7:30 PM
Unknown Object (File)
Wed, May 29, 7:30 PM
Unknown Object (File)
Tue, May 28, 4:18 AM
Unknown Object (File)
May 1 2024, 4:17 PM
Unknown Object (File)
Apr 22 2024, 8:35 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.