Page MenuHomeFreeBSD

laoder.efi: Fix error in download protcol
ClosedPublic

Authored by imp on Jul 7 2026, 4:13 AM.
Tags
None
Referenced Files
F165992161: D58068.diff
Mon, Aug 10, 8:59 PM
Unknown Object (File)
Sat, Aug 8, 6:18 PM
Unknown Object (File)
Fri, Aug 7, 3:20 AM
Unknown Object (File)
Fri, Aug 7, 3:14 AM
Unknown Object (File)
Fri, Aug 7, 1:34 AM
Unknown Object (File)
Thu, Aug 6, 6:19 PM
Unknown Object (File)
Thu, Aug 6, 2:45 AM
Unknown Object (File)
Wed, Aug 5, 11:06 AM
Subscribers

Details

Summary

The download protocol calls download_data with FileOffset and
BufferLength of 0 first to start the download (no data yet
available). Calls it again with BufferLength == 0 and FileOffset the
size of the download (again, no data). It then starts calling with
BufferLength != 0 and FileOffset == 0 to start the download. The
heuristic I used to detect the start was wrong, so we'd allocate the
buffer twice. Fix that by being more explicit and not using the
heuristic that was bogus.

Fixes: afee781523e4 ("loader.efi: Recognize new memdisk=<url> and memcd=<url> options")
Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Jul 7 2026, 4:13 AM
imp added a parent revision: D58067: MINIMAL: Add device md.
This revision was not accepted when it landed; it landed in state Needs Review.Jul 10 2026, 4:18 AM
This revision was automatically updated to reflect the committed changes.