Page MenuHomeFreeBSD

bhyve: check upper bounds for value from qsz
ClosedPublic

Authored by tsoome on Fri, Jul 17, 8:14 AM.
Tags
None
Referenced Files
F163555997: D58293.id182354.diff
Fri, Jul 24, 11:06 AM
F163551403: D58293.diff
Fri, Jul 24, 9:45 AM
F163541243: D58293.id182218.diff
Fri, Jul 24, 7:19 AM
F163540872: D58293.id182218.diff
Fri, Jul 24, 7:14 AM
F163533491: D58293.id182354.diff
Fri, Jul 24, 5:28 AM
F163521371: D58293.diff
Fri, Jul 24, 2:18 AM
F163510735: D58293.id182107.diff
Thu, Jul 23, 11:30 PM
F163510482: D58293.id182107.diff
Thu, Jul 23, 11:26 PM

Details

Summary

The max_qentries in pci_nvme_softc is uint16_t and
too large int may get truncated to invalid value.
While there, use local declarations for val.

Suggested by: Bill Sommerfeld

Diff Detail

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

Event Timeline

bnovkov added inline comments.
usr.sbin/bhyve/pci_nvme.c
3188

Why aren't we defining val at the start of the function anymore?

chuck added a subscriber: chuck.

Assuming you restore the declaration of val as @bnovkov suggested, LGTM.

This revision is now accepted and ready to land.Sat, Jul 18, 10:26 PM

declare val at the beginning of function.

This revision now requires review to proceed.Sun, Jul 19, 1:27 PM
This revision is now accepted and ready to land.Sun, Jul 19, 3:38 PM
This revision was automatically updated to reflect the committed changes.