[PATCH v2 3/5] nvme-auth: fix data race on ctrl->transaction

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sun Nov 8 18:31:34 PST 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] nvme-auth: missing Fixes trailer for ctrl->transaction data race
  fix
--

commit 80e147df824d3b130d9f9eca4a6cd6ae6f4b0f78
Author: Guixin Liu <kanie at linux.alibaba.com>

> nvme-auth: fix data race on ctrl->transaction
>
> nvme_ctrl_auth_work() queues the DH-HMAC-CHAP exchange of every queue
> on nvme-auth-wq without waiting for them, so multiple
> nvme_queue_auth_work() instances run concurrently and all increment
> ctrl->transaction in nvme_queue_auth_work(). The plain increment is a
> data race, and the lost updates hand the same transaction id to
> concurrent queues.
>
> The controller side only echoes the transaction id within a queue, so
> the race has no functional impact today, but the increment is still
> unsynchronized and KCSAN reports it. Use atomic_inc_return(); the
> first transaction id is now 1 instead of 0, which is immaterial as
> the controller only echoes the id within a queue.
>
> Reviewed-by: Hannes Reinecke <hare at kernel.org>
> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>

[Severity: Low]
Since this fixes the unsynchronized increment of ctrl->transaction across
concurrent per-queue authentication work items, should the commit message
include:

  Fixes: f50fff73d620 ("nvme: implement In-Band authentication")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109022646.290792-1-kanie@linux.alibaba.com?part=3



More information about the Linux-nvme mailing list