Page MenuHomeFreeBSD

laoder.efi: Fix error in download protcol
ClosedPublic

Authored by imp on Jul 7 2026, 4:13 AM.
Tags
None
Referenced Files
F170585800: D58068.diff
Sat, Sep 5, 12:53 PM
Unknown Object (File)
Fri, Sep 4, 10:15 PM
Unknown Object (File)
Fri, Sep 4, 7:08 PM
Unknown Object (File)
Thu, Sep 3, 5:27 PM
Unknown Object (File)
Thu, Sep 3, 5:09 PM
Unknown Object (File)
Thu, Sep 3, 9:53 AM
Unknown Object (File)
Thu, Sep 3, 8:42 AM
Unknown Object (File)
Tue, Sep 1, 4:21 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.