diff options
| author | Shao Mingyin <shao.mingyin@zte.com.cn> | 2026-11-14 02:02:55 +0800 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-11-16 07:42:48 -0800 |
| commit | 153eac284ebf68be74993643e9b2fe2f9b2b1d88 (patch) | |
| tree | f1dfb711c40304ea4b69d188c2b4305dbe80f8cf /tools/perf/scripts/python | |
| parent | 8c1f99419b6cc51892e259497c8e10a5d079621a (diff) | |
nvmet-fc: reject duplicate queue IDs on Create Connection
nvmet_fc_alloc_target_queue() stores the new queue with
WARN_ON(assoc->queues[qid]);
assoc->queues[qid] = queue;
The queue ID comes straight from the Create Connection LS and is only
checked against NVMET_NR_QUEUES. A remote initiator can send a second
Create Connection for a queue ID that already exists, or send queue ID 0
which was already created as the admin queue by Create Association. The
WARN fires and the old pointer is overwritten: the old queue's base
reference is never put, so its workqueue, nvmet_sq and nvmet_cq are
never released. For the admin queue this also leaves the controller
reference unreachable from nvmet_fc_delete_target_assoc(), so the
controller and its subsystem reference leak permanently.
Publish the queue with cmpxchg() and destroy the newly created queue if
the slot is already taken, returning the normal queue allocation error
to the initiator. This keeps the existing error path and makes both
duplicate and admin queue IDs fail cleanly.
Fixes: c53432030d86 ("nvme-fabrics: Add target support for FC transport")
Cc: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
