HomeFreeBSD

VirtIO SCSI: validate seg_max on attach

Description

VirtIO SCSI: validate seg_max on attach

Until r349278, bhyve presented a seg_max to the guest that was too large.
Detect this case and clamp it to the virtqueue size. Otherwise, we would
fail the "too many segments to enqueue" assertion in virtqueue_enqueue().

I hit this by running a guest with a MAXPHYS of 256 KB.

Reviewed by: bryanv cem
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20703

Details

Provenance
vangyzenAuthored on
Reviewer
bryanv
Differential Revision
D20703: VirtIO SCSI: validate seg_max from hypervisor
Parents
rS349284: Make ELEMENT INDEX validation more strict.
Branches
Unknown
Tags
Unknown