The ident string for NVMe and VirtIO block deivces do not contain the
bus, and the various fields can potentially use up to three characters
when printed as unsigned values (full range of uint8_t) even if not
likely in practice.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 48509 Build 45395: arc lint + arc unit
Event Timeline
Comment Actions
GCC still warns about a potential overflow after this, but I think GCC's overflow checking has an off by one error.
usr.sbin/bhyve/pci_nvme.c | ||
---|---|---|
3229 | Have you tried using %u? Maybe gcc warns due to the possible minus sign of signed integers? |
Comment Actions
Yes, %u helps, and there's actually similar bugs in ahci and virtio_blk so I'll update the review to fix all of those.