[PATCH v3] nvme: fix memory corruption for passthrough metadata
Keith Busch
kbusch at kernel.org
Wed Oct 11 10:04:58 PDT 2023
On Wed, Oct 11, 2023 at 07:02:54AM +0200, Christoph Hellwig wrote:
> On Tue, Oct 10, 2023 at 07:09:54PM +0530, Kanchan Joshi wrote:
> >
> > Given the way things are in NVMe, I do not find a better way.
> > Maybe another day for commands that do (or can do) things very
> > differently for nlb and PI representation.
>
> Fixing just a subset of these problems is pointless. If people want
> to use metadata on vendor specific commands they need to work with
> NVMe to figure out a generic way to pass the length.
NVMe already tried to solve that with NDT and NDM fields, but no vendor
implemented it. Maybe just require SGL's for passthrough IO since that
encodes the buffer sizes.
I don't think it's reasonable for the driver to decode every passthrough
command to validate the data lengths, or reject ones that we don't know
how to decode. SG_IO doesn't do that either.
More information about the Linux-nvme
mailing list