[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200328082601.GA7658@infradead.org>
Date: Sat, 28 Mar 2020 01:26:01 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Nick Bowler <nbowler@...conx.ca>
Cc: linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
Sagi Grimberg <sagi@...mberg.me>,
Christoph Hellwig <hch@...radead.org>,
Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCH v2 1/2] nvme: Fix compat NVME_IOCTL_SUBMIT_IO numbering
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@...conx.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.
Powered by blists - more mailing lists