From: Hannes Reinecke <hare@suse.de>
To: Keith Busch <kbusch@kernel.org>
Cc: Daniel Wagner <dwagner@suse.de>, Sagi Grimberg <sagi@grimberg.me>,
Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme-tcp: Check if request has started before processing it
Date: Fri, 26 Feb 2021 17:42:46 +0100 [thread overview]
Message-ID: <a42d6285-ff32-3e16-b2b1-808d29f2a743@suse.de> (raw)
In-Reply-To: <20210226161355.GG31593@redsun51.ssa.fujisawa.hgst.com>
On 2/26/21 5:13 PM, Keith Busch wrote:
> On Fri, Feb 26, 2021 at 01:54:00PM +0100, Hannes Reinecke wrote:
>> On 2/26/21 1:35 PM, Daniel Wagner wrote:
>>> On Mon, Feb 15, 2021 at 01:29:45PM -0800, Sagi Grimberg wrote:
>>>> Well, I think we should probably figure out why that is happening first.
>>>
>>> I got my hands on a tcpdump trace. I've trimmed it to this:
>>>
[ .. ]
>>> NVM Express Fabrics TCP
>>> Pdu Type: CapsuleResponse (5)
>>> Pdu Specific Flags: 0x00
>>> .... ...0 = PDU Header Digest: Not set
>>> .... ..0. = PDU Data Digest: Not set
>>> .... .0.. = PDU Data Last: Not set
>>> .... 0... = PDU Data Success: Not set
>>> Pdu Header Length: 24
>>> Pdu Data Offset: 0
>>> Packet Length: 24
>>> Unknown Data: 02000400000000001b0000001f000000
>>>
>>> 0000 00 00 0c 9f f5 a8 b4 96 91 41 16 c0 08 00 45 00 .........A....E.
>>> 0010 00 4c 00 00 40 00 40 06 00 00 0a e4 26 af 0a e4 .L..@.@.....&...
>>> 0020 c2 1e 11 44 88 4f b8 58 90 ec 8e 1b 32 ed 80 18 ...D.O.X....2...
>>> 0030 01 01 fe d3 00 00 01 01 08 0a e6 ed ac be d6 a3 ................
>>> 0040 5d 0c 05 00 18 00 18 00 00 00 02 00 04 00 00 00 ]...............
>>> 0050 00 00 1b 00 00 00 1f 00 00 00 ..........
>>>
>> As I suspected, we did receive an invalid frame.
>> Data digest would have saved us, but then it's not enabled.
>>
>> So we do need to check if the request is valid before processing it.
>
> That's just addressing a symptom. You can't fully verify the request is
> valid this way because the host could have started the same command ID
> the very moment before the code checks it, incorrectly completing an
> in-flight command and getting data corruption.
>
Oh, I am fully aware.
Bad frames are just that, bad frames.
We can only fully validate that when digests are enabled, but I gather
that controllers sending out bad frames wouldn't want to enable digests,
either. So relying on that is possibly not an option.
So really what I'm trying to avoid is the host crashing on a bad frame.
That kind of thing always resonates bad with customers.
And tripping over an uninitialized command is just too stupid IMO.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.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
next prev parent reply other threads:[~2021-02-26 16:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 18:17 Daniel Wagner
2021-02-12 20:58 ` Sagi Grimberg
2021-02-12 21:09 ` Keith Busch
2021-02-12 21:49 ` Sagi Grimberg
2021-02-13 8:46 ` Hannes Reinecke
2021-02-15 10:40 ` Daniel Wagner
2021-02-15 21:29 ` Sagi Grimberg
2021-02-26 12:35 ` Daniel Wagner
2021-02-26 12:54 ` Hannes Reinecke
2021-02-26 16:13 ` Keith Busch
2021-02-26 16:42 ` Hannes Reinecke [this message]
2021-02-26 17:19 ` Keith Busch
2021-03-01 13:26 ` Daniel Wagner
2021-03-01 13:55 ` Hannes Reinecke
2021-03-01 16:05 ` Keith Busch
2021-03-01 16:53 ` Hannes Reinecke
2021-03-01 20:59 ` Keith Busch
2021-03-02 7:18 ` Hannes Reinecke
2021-03-02 18:45 ` Keith Busch
2021-02-15 21:23 ` Sagi Grimberg
2021-02-16 8:51 ` Hannes Reinecke
2021-02-13 8:42 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a42d6285-ff32-3e16-b2b1-808d29f2a743@suse.de \
--to=hare@suse.de \
--cc=axboe@fb.com \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®