[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73e4914e-f867-c899-954d-4b61ae2b4c33@suse.de>
Date: Sat, 13 Feb 2021 09:46:41 +0100
From: Hannes Reinecke <hare@...e.de>
To: Sagi Grimberg <sagi@...mberg.me>, Keith Busch <kbusch@...nel.org>
Cc: Daniel Wagner <dwagner@...e.de>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
Jens Axboe <axboe@...com>
Subject: Re: [PATCH] nvme-tcp: Check if request has started before processing
it
On 2/12/21 10:49 PM, Sagi Grimberg wrote:
>
>>>> blk_mq_tag_to_rq() will always return a request if the command_id is
>>>> in the valid range. Check if the request has been started. If we
>>>> blindly process the request we might double complete a request which
>>>> can be fatal.
>>>
>>> How did you get to this one? did the controller send a completion for
>>> a completed/bogus request?
>>
>> If that is the case, then that must mean it's possible the driver could
>> have started the command id just before the bogus completion check. Data
>> iorruption, right?
>
> Yes, which is why I don't think this check is very useful..
I actually view that as a valid protection against spoofed frames.
Without it it's easy to crash the machine by injecting fake completions
with random command ids.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
Powered by blists - more mailing lists