Page MenuHomeFreeBSD

bhyve nvme: Add NQN value
ClosedPublic

Authored by chuck on Oct 2 2023, 11:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 4:17 PM
Unknown Object (File)
Tue, Apr 30, 4:11 PM
Unknown Object (File)
Tue, Apr 30, 4:07 PM
Unknown Object (File)
Tue, Apr 30, 4:07 PM
Unknown Object (File)
Tue, Apr 30, 9:07 AM
Unknown Object (File)
Tue, Apr 23, 8:21 PM
Unknown Object (File)
Mar 12 2024, 1:03 PM
Unknown Object (File)
Jan 11 2024, 11:26 AM
Subscribers

Details

Summary

Add a NVMe Qualified Name (NQN) to the Controller Data structure using
the "first format" (i.e., "... used by any organization that owns a
domain name" Section 7.9 NVM-Express 1.4c 2021.06.28 Ratified).

This avoids a Linux kernel warning about a missing or invalid NQN.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

chuck requested review of this revision.Oct 2 2023, 11:01 PM
jhb added inline comments.
usr.sbin/bhyve/pci_nvme.c
592

This is a buffer overflow (can read off the end of data), you would need strncpy or the like instead. A direct snprintf is probably simpler.

593

Could you just snprintf(cd->subnqn, sizeof(cd->subnqn), "... and avoid the allocation?

This revision is now accepted and ready to land.Oct 10 2023, 4:40 PM

Updated per review comments

This revision now requires review to proceed.Oct 11 2023, 4:33 PM
jhb added inline comments.
usr.sbin/bhyve/pci_nvme.c
588–591

style(9) is a 4 space indent for continuations, you can just fix it as part of the commit though, no need to update the review

This revision is now accepted and ready to land.Oct 12 2023, 5:11 PM
This revision was automatically updated to reflect the committed changes.