Page MenuHomeFreeBSD

bhyve: fix boot device ordering
ClosedPublic

Authored by novel on Sun, Sep 20, 2:51 PM.
Tags
None
Referenced Files
F174041393: D59859.id.diff
Wed, Sep 30, 4:12 AM
F174037831: D59859.id187279.diff
Wed, Sep 30, 3:43 AM
F174036147: D59859.id187347.diff
Wed, Sep 30, 3:28 AM
Unknown Object (File)
Tue, Sep 29, 3:59 AM
Unknown Object (File)
Mon, Sep 28, 5:10 PM
Unknown Object (File)
Mon, Sep 28, 10:54 AM
Unknown Object (File)
Mon, Sep 28, 1:30 AM
Unknown Object (File)
Mon, Sep 28, 12:51 AM
Subscribers

Details

Summary

EDK2's QemuBootOrderLib inspects the bootorder file provided
via fw_cfg and requires it to be NUL-terminated. Otherwise,
it rejects the supplied bootorder and falls back to its
default boot order.

Currently, bhyve registers bootorder with qemu_fwcfg_add_file()
using bootorder_len returned by open_memstream(), which excludes
the trailing NUL byte.

Fix that by passing bootorder_len + 1 to qemu_fwcfg_add_file() so
the fw_cfg payload is properly NUL-terminated.

PR: 279720
Found with: codex (gpt-5.6-sol)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Test Plan

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77115
Build 73998: arc lint + arc unit