Page MenuHomeFreeBSD

Several iov handling bugs in bhyve virtio-scsi backend
ClosedPublic

Authored by mav on Dec 6 2018, 10:24 PM.
Tags
None
Referenced Files
F169275677: D18465.id.diff
Tue, Sep 1, 2:57 AM
F169131596: D18465.diff
Mon, Aug 31, 1:02 PM
F169113092: D18465.id51737.diff
Mon, Aug 31, 11:04 AM
Unknown Object (File)
Mon, Aug 31, 6:34 AM
Unknown Object (File)
Sun, Aug 30, 2:45 AM
Unknown Object (File)
Sat, Aug 29, 12:22 PM
Unknown Object (File)
Fri, Aug 28, 9:32 AM
Unknown Object (File)
Thu, Aug 27, 12:16 PM
Subscribers

Details

Summary
  • buf_to_iov() does not use buflen parameter, allowing out of bound read.
  • buf_to_iov() leaks memory if seek argument > 0.
  • iov_to_buf() doesn't need to reallocate buffer for every segment.
  • there is no point to use size_t for iov counts, int is more then enough.
  • some iov function arguments can be constified.
  • pci_vtscsi_request_handle() used truncate_iov() incorrectly, allowing getting out of buffer and possibly corrupting data.
  • pci_vtscsi_controlq_notify() written returned status at wrong offset.
  • pci_vtscsi_controlq_notify() leaked one buffer per event.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 21414