Skip to contentSkip to conversation

nvmet: for nvme admin set_features cmd, call nvmet_check_data_len_lte()

PATCH Applied [email protected] 2 participants 2 messages Jan 4, 2023 – Jan 23, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet: for nvme admin set_features cmd, call nvmet_check_data_len_lte()

From: Amit Engel <[email protected]>

This is due to the fact that the host is allowed to pass the controller an sgl describing a buffer that is larger than the payload itself

---
 drivers/nvme/target/admin-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/admin-cmd.c +1 -1
index 6a54ed6fb121..80099df37314 100644
@@ -840,7 +840,7 @@ void nvmet_execute_set_features(struct nvmet_req *req)
 	u16 nsqr;
 	u16 ncqr;
 
-	if (!nvmet_check_transfer_len(req, 0))
+	if (!nvmet_check_data_len_lte(req, 0))
 		return;
 
 	switch (cdw10 & 0xff) {
Signature · 1 line
2.31.1