Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177570542
D61559.1794767820.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61559.1794767820.diff
View Options
diff --git a/sys/dev/nvmf/controller/nvmft_controller.c b/sys/dev/nvmf/controller/nvmft_controller.c
--- a/sys/dev/nvmf/controller/nvmft_controller.c
+++ b/sys/dev/nvmf/controller/nvmft_controller.c
@@ -815,6 +815,9 @@
struct nvme_completion cqe;
uint8_t fid;
+ if (NVMEV(NVME_FEAT_SET_SV, le32toh(cmd->cdw10)) != 0)
+ goto error;
+
fid = NVMEV(NVME_FEAT_SET_FID, le32toh(cmd->cdw10));
switch (fid) {
case NVME_FEAT_NUMBER_OF_QUEUES:
@@ -822,6 +825,9 @@
uint32_t num_queues;
struct nvmft_io_qpair *io_qpairs;
+ if (cmd->nsid != htole32(0))
+ goto not_ns_specifc;
+
num_queues = le32toh(cmd->cdw11) & 0xffff;
/* 5.12.1.7: 65535 is invalid. */
@@ -862,6 +868,9 @@
{
uint32_t aer_mask;
+ if (cmd->nsid != htole32(0))
+ goto not_ns_specifc;
+
aer_mask = le32toh(cmd->cdw11);
/* Check for any reserved or unimplemented feature bits. */
@@ -884,6 +893,13 @@
error:
nvmft_send_generic_error(ctrlr->admin, nc, NVME_SC_INVALID_FIELD);
nvmf_free_capsule(nc);
+ return;
+
+not_ns_specifc:
+ nvmft_send_error(ctrlr->admin, nc, NVME_SCT_COMMAND_SPECIFIC,
+ NVME_SC_FEATURE_NOT_NS_SPECIFIC);
+ nvmf_free_capsule(nc);
+ return;
}
static bool
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 6:37 PM (23 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41746171
Default Alt Text
D61559.1794767820.diff (1 KB)
Attached To
Mode
D61559: nvmft: Add additional error checking for SET_FEATURES commands
Attached
Detach File
Event Timeline