Page MenuHomeFreeBSD

laoder.efi: Fix error in download protcol
ClosedPublic

Authored by imp on Jul 7 2026, 4:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 29, 6:07 PM
Unknown Object (File)
Tue, Sep 29, 4:04 PM
Unknown Object (File)
Tue, Sep 29, 1:53 PM
Unknown Object (File)
Wed, Sep 16, 6:36 AM
Unknown Object (File)
Mon, Sep 14, 5:01 AM
Unknown Object (File)
Mon, Sep 14, 4:32 AM
Unknown Object (File)
Fri, Sep 11, 7:06 AM
Unknown Object (File)
Thu, Sep 10, 5:14 PM
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.