Skip to contentSkip to conversation

nvmet_fc: ensure target queue id within range.

PATCH New James Smart 2 participants 2 messages Sep 19, 2017 – Sep 20, 2017

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

PATCH v2 1/1 nvmet_fc: ensure target queue id within range.

When searching for queue id's ensure they are within the expected range

Signed-off-by James Smart <james.smart at broadcom.com>

---
v2: v1 did a >= check, should be > check only

 drivers/nvme/target/fc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/nvme/target/fc.c +3 -0
index 0d262052a19a..75b1752e8375 100644
@@ -776,6 +776,9 @@ nvmet_fc_find_target_queue(struct nvmet_fc_tgtport *tgtport,
 	u16 qid = nvmet_fc_getqueueid(connection_id);
 	unsigned long flags;
 
+	if (qid > NVMET_NR_QUEUES)
+		return NULL;
+
 	spin_lock_irqsave(&tgtport->lock, flags);
 	list_for_each_entry(assoc, &tgtport->assoc_list, a_list) {
 		if (association_id == assoc->association_id) {
Signature · 1 line
2.13.1
#1 lore raw

PATCH v2 1/1 nvmet_fc: ensure target queue id within range.

Quoted 3 lines · James Smart

When searching for queue id's ensure they are within the expected range

Signed-off-by James Smart <james.smart at broadcom.com>

Looks fine,

Reviewed-by Christoph Hellwig <hch at lst.de>