Page MenuHomeFreeBSD

laoder.efi: Fix error in download protcol
ClosedPublic

Authored by imp on Tue, Jul 7, 4:13 AM.
Tags
None
Referenced Files
F162326325: D58068.id.diff
Sun, Jul 12, 2:15 AM
F162281176: D58068.diff
Sat, Jul 11, 4:18 PM
Unknown Object (File)
Fri, Jul 10, 10:34 PM
Unknown Object (File)
Fri, Jul 10, 6:36 PM
Unknown Object (File)
Fri, Jul 10, 6:32 PM
Unknown Object (File)
Thu, Jul 9, 7:09 PM
Unknown Object (File)
Wed, Jul 8, 8:37 PM
Unknown Object (File)
Wed, Jul 8, 12:03 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.Tue, Jul 7, 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.Fri, Jul 10, 4:18 AM
This revision was automatically updated to reflect the committed changes.