All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Maurizio Lombardi <mlombard@redhat.com>
Cc: linux-nvme@lists.infradead.org, axboe@fb.com,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Ming Lei <minlei@redhat.com>
Subject: Re: nvme-host: disk corruptions when issuing IDENTIFY commands via ioctl()
Date: Wed, 9 Mar 2022 07:26:30 +0100	[thread overview]
Message-ID: <20220309062630.GA31508@lst.de> (raw)
In-Reply-To: <CAFL455n1WaRxZuqCeQGWt1MVDnK8uUytUsAUVEUV9-LLQYv9gQ@mail.gmail.com>

On Tue, Mar 08, 2022 at 05:45:20PM +0100, Maurizio Lombardi wrote:
> We suspect that the root cause is that the nvme-host driver doesn't
> enforce the 4096 byte limit for the IDENTIFY commands as the
> nvme-target does (see the nvmet_execute_identify() -->
> nvmet_check_transfer_len(req, NVME_IDENTIFY_DATA_SIZE) code).
> So if we pass a 8192-byte buffer not aligned to the page size, it will
> need 3 pages on archs where page size is 4k and the nvme spec says
> that the data buffer may not cross more than one page boundary.
> 
> Does it make sense to you? What's your opinion on this?

Combination of a broken application (does what the spec explicitly
tells it not do) and broken hardware (does the most stupid thing when
fed invalid input), not much the driver can do here.  But we really
should talk to the nvme working group to ECN the text for the single
PRP requirement to spell out the consequence in more detail, and maybe
also mandate how it is handled for the next spec version.


  parent reply	other threads:[~2022-03-09  6:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 16:45 nvme-host: disk corruptions when issuing IDENTIFY commands via ioctl() Maurizio Lombardi
2022-03-08 19:52 ` Keith Busch
2022-03-09  0:18   ` Ming Lei
2022-03-09  0:39     ` Keith Busch
2022-03-09  1:02       ` Ming Lei
2022-03-09  1:14         ` Keith Busch
2022-03-09  2:48           ` Ming Lei
2022-03-09  3:09             ` Keith Busch
2022-03-09  6:26 ` Christoph Hellwig [this message]
2022-03-09 16:23   ` Keith Busch
2022-03-10 16:04     ` Christoph Hellwig
2022-03-10 17:38       ` Keith Busch

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=20220309062630.GA31508@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=minlei@redhat.com \
    --cc=mlombard@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.