From: Christoph Hellwig <hch@infradead.org>
To: Nick Bowler <nbowler@draconx.ca>
Cc: Christoph Hellwig <hch@infradead.org>,
Keith Busch <kbusch@kernel.org>,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH v2 1/2] nvme: Fix compat NVME_IOCTL_SUBMIT_IO numbering
Date: Sat, 28 Mar 2020 01:26:01 -0700 [thread overview]
Message-ID: <20200328082601.GA7658@infradead.org> (raw)
In-Reply-To: <20200328050909.30639-2-nbowler@draconx.ca>
On Sat, Mar 28, 2020 at 01:09:08AM -0400, Nick Bowler wrote:
> When __u64 has 64-bit alignment, the nvme_user_io structure has trailing
> padding. This causes problems in the compat case with 32-bit userspace
> that has less strict alignment because the size of the structure differs.
>
> Since the NVME_IOCTL_SUBMIT_IO macro encodes the structure size itself,
> the result is that this ioctl does not work at all in such a scenario:
>
> # nvme read /dev/nvme0n1 -z 512
> submit-io: Inappropriate ioctl for device
>
> But by the same token, this makes it easy to handle both cases and
> since the structures differ only in unused trailing padding bytes
> we can simply not read those bytes.
>
> Signed-off-by: Nick Bowler <nbowler@draconx.ca>
I think we already have a similar patch titled
"nvme: Add compat_ioctl handler for NVME_IOCTL_SUBMIT_IO" in
linux-next, with the difference of actually implementing the
.compat_ioctl entry point.
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-03-28 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-28 5:09 [PATCH v2 0/2] nvme: compat ioctl fixes Nick Bowler
2020-03-28 5:09 ` [PATCH v2 1/2] nvme: Fix compat NVME_IOCTL_SUBMIT_IO numbering Nick Bowler
2020-03-28 8:26 ` Christoph Hellwig [this message]
2020-03-28 13:56 ` Nick Bowler
2020-03-28 5:09 ` [PATCH v2 2/2] nvme: Fix compat address handling in several ioctls Nick Bowler
2020-03-28 8:26 ` Christoph Hellwig
2020-03-31 14:17 ` Christoph Hellwig
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=20200328082601.GA7658@infradead.org \
--to=hch@infradead.org \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nbowler@draconx.ca \
--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