diff options
author | Nick Bowler <nbowler@draconx.ca> | 2022-07-20 23:57:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-17 15:15:42 +0200 |
commit | 32bf5d3c61f4de402f1b97bca5dfaf8d6c11d10f (patch) | |
tree | b33cb2727817879c125f1b7bbe54b385af3414e6 /drivers/usb/cdns3/cdns3-gadget.c | |
parent | 4e8fee340f1f1285d9673576a852c07fc48c030a (diff) |
nvme: define compat_ioctl again to unbreak 32-bit userspace.
[ Upstream commit a25d4261582cf00dad884c194d21084836663d3d ]
Commit 89b3d6e60550 ("nvme: simplify the compat ioctl handling") removed
the initialization of compat_ioctl from the nvme block_device_operations
structures.
Presumably the expectation was that 32-bit ioctls would be directed
through the regular handler but this is not the case: failing to assign
.compat_ioctl actually means that the compat case is disabled entirely,
and any attempt to submit nvme ioctls from 32-bit userspace fails
outright with -ENOTTY.
For example:
% smartctl -x /dev/nvme0n1
[...]
Read NVMe Identify Controller failed: NVME_IOCTL_ADMIN_CMD: Inappropriate ioctl for device
The blkdev_compat_ptr_ioctl helper can be used to direct compat calls
through the main ioctl handler and makes things work again.
Fixes: 89b3d6e60550 ("nvme: simplify the compat ioctl handling")
Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-gadget.c')
0 files changed, 0 insertions, 0 deletions