HomeFreeBSD

bhyveload: simplify cb_open() and eliminate minor TOCTOU

Description

bhyveload: simplify cb_open() and eliminate minor TOCTOU

It's not at all clear why I wrote it like this, but we can do better.

I wouldn't think this really has any meaningful security implications
since the hierarchy in question can't really be modified by the guest
scripts, but it would seem to make it a little more robust.

Fixes: 6779d44bd878e3c ("bhyveload: use a dirfd to support -h")
Reviewed by: bnovkov, markj
Differential Revision: https://reviews.freebsd.org/D55379

Details

Provenance
kevansAuthored on Mar 1 2026, 3:23 AM
Reviewer
bnovkov
Differential Revision
D55379: bhyveload: simplify cb_open() and eliminate minor TOCTOU
Parents
rG6099b4600256: amd64 initializecpu(): use 64bit type for rcr4() result
Branches
Unknown
Tags
Unknown