Page MenuHomeFreeBSD

bhyve: Fix truncate_iov()
ClosedPublic

Authored by markj on Feb 22 2026, 4:16 PM.
Tags
None
Referenced Files
F168547651: D55438.id172447.diff
Fri, Aug 28, 11:20 PM
F168547554: D55438.diff
Fri, Aug 28, 11:19 PM
Unknown Object (File)
Wed, Aug 26, 12:01 PM
Unknown Object (File)
Wed, Aug 26, 4:19 AM
Unknown Object (File)
Mon, Aug 24, 9:07 PM
Unknown Object (File)
Mon, Aug 24, 12:14 PM
Unknown Object (File)
Sun, Aug 23, 7:17 PM
Unknown Object (File)
Sat, Aug 22, 10:28 AM

Details

Summary

The implementation was simply wrong. It would always just return the
first entry in the iovec, even if the requested length is larger than
that first entry.

Note, this function will be removed soon, see D53468.

Reported by: Vinod p n <vinod272@gmail.com>

Diff Detail

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

Event Timeline

markj requested review of this revision.Feb 22 2026, 4:16 PM
This revision is now accepted and ready to land.Feb 22 2026, 6:31 PM
des added inline comments.
usr.sbin/bhyve/iov.c
87

I found this slightly confusing...

(personally I would have dropped done and just decremented length until it reached 0)

Take Dag-Erling's suggestions.

This revision now requires review to proceed.Feb 23 2026, 12:50 AM
This revision is now accepted and ready to land.Feb 23 2026, 1:50 AM
This revision was automatically updated to reflect the committed changes.