[PATCH v3 2/2] nvme-auth: fix data race on ctrl->transaction
Keith Busch
kbusch at kernel.org
Wed Nov 18 18:49:50 PST 2026
On Tue, Nov 17, 2026 at 08:23:38AM +0100, Hannes Reinecke wrote:
> On 11/16/26 4:37 PM, Keith Busch wrote:
>
> It's somewhat ambiguous.
> Spec says 'carrying the same transaction identifier value for the entire
> authentication transaction' (for AUTH_negotiate), and later on 'carrying
> the same transaction identifier' (for any other AUTH message).
> So actually we just have to make sure they are identical.
> (The random number is '4' ...)
>
> But the overall idea here is to distinguish transactions, so the implication
> is that each transaction should carry different identifiers.
> And my issue here is precisely 'each transaction'. Surely within each
> queue, but I'd really would want to distinguish _across_ queues, too.
> (And possibly with a random starting value to boot).
> Just to avoid any fuzzers trying to be clever with guessing the
> authentication ID (or bugs setting the transaction ID to 0 for every
> queue ... same reason why we introduced the 'genctr' for the command
> ID).
>
> But if you don't feel that's an issue, fine, I'll be shutting up.
I'd normally defer to you on this feature since you've more hands-on
experience here. I just think the qid:t_id pair already distinguishes
transactions on the wire; each queue is its own connection after all.
Regarding genctr, I thought that was because some intermediary switch
was replaying packets, but the commit message doesn't appear to support
that recollection. Regardless, the value is per-request, so it's on an
even more finer granularity than per-queue.
More information about the Linux-nvme
mailing list