[PATCH v3 2/2] nvme-auth: fix data race on ctrl->transaction
Hannes Reinecke
hare at suse.de
Wed Nov 25 00:17:14 PST 2026
On 11/19/26 3:49 AM, Keith Busch wrote:
> 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.
Indeed, that's true. So let's go with this approach; one global counter
less is always a good idea.
Reviewed-by: Hannes Reinecke <hare at kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
More information about the Linux-nvme
mailing list