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)
Wed, Oct 23, 5:10 PM
Unknown Object (File)
Oct 7 2024, 11:26 AM
Unknown Object (File)
Oct 2 2024, 12:15 PM
Unknown Object (File)
Sep 3 2024, 3:19 AM
Unknown Object (File)
Jun 28 2024, 4:35 AM
Unknown Object (File)
Jun 19 2024, 1:45 PM
Unknown Object (File)
Jun 8 2024, 4:58 AM
Unknown Object (File)
Jun 1 2024, 11:43 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.