]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nvmet-auth: authenticate on admin queue only
authorHannes Reinecke <hare@kernel.org>
Tue, 22 Apr 2025 09:15:55 +0000 (11:15 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 20 May 2025 03:34:25 +0000 (05:34 +0200)
Do not start authentication on I/O queues as it doesn't really add value,
and secure concatenation disallows it anyway.  Authentication commands on
I/O queues are not aborted, so the host may still run the authentication
protocol on I/O queues.

Signed-off-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/auth.c
drivers/nvme/target/fabrics-cmd.c

index 9429b821840856fb2ffa9a23be62d30366709148..111dfaaa14a7e71c720ff15836031995e92d0b7f 100644 (file)
@@ -280,9 +280,12 @@ void nvmet_destroy_auth(struct nvmet_ctrl *ctrl)
 
 bool nvmet_check_auth_status(struct nvmet_req *req)
 {
-       if (req->sq->ctrl->host_key &&
-           !req->sq->authenticated)
-               return false;
+       if (req->sq->ctrl->host_key) {
+               if (req->sq->qid > 0)
+                       return true;
+               if (!req->sq->authenticated)
+                       return false;
+       }
        return true;
 }
 
index f012bdf898502e1f285cc0079bc81ca64fc59047..14f55192367e1ea3bfc5170353090c9f28cdc684 100644 (file)
@@ -239,8 +239,8 @@ static u32 nvmet_connect_result(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq)
        bool needs_auth = nvmet_has_auth(ctrl, sq);
        key_serial_t keyid = nvmet_queue_tls_keyid(sq);
 
-       /* Do not authenticate I/O queues for secure concatenation */
-       if (ctrl->concat && sq->qid)
+       /* Do not authenticate I/O queues */
+       if (sq->qid)
                needs_auth = false;
 
        if (keyid)