1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-18 12:31:11 +00:00
Arnd Bergmann 98aaaec4a1 compat_ioctl: reimplement SG_IO handling
There are two code locations that implement the SG_IO ioctl: the old
sg.c driver, and the generic scsi_ioctl helper that is in turn used by
multiple drivers.

To eradicate the old compat_ioctl conversion handler for the SG_IO
command, I implement a readable pair of put_sg_io_hdr() /get_sg_io_hdr()
helper functions that can be used for both compat and native mode,
and then I call this from both drivers.

For the iovec handling, there is already a compat_import_iovec() function
that can simply be called in place of import_iovec().

To avoid having to pass the compat/native state through multiple
indirections, I mark the SG_IO command itself as compatible in
fs/compat_ioctl.c and use in_compat_syscall() to figure out where
we are called from.

As a side-effect of this, the sg.c driver now also accepts the 32-bit
sg_io_hdr format in compat mode using the read/write interface, not
just ioctl. This should improve compatiblity with old 32-bit binaries,
but it would break if any application intentionally passes the 64-bit
data structure in compat mode here.

Steffen Maier helped debug an issue in an earlier version of this patch.

Cc: Steffen Maier <maier@linux.ibm.com>
Cc: linux-scsi@vger.kernel.org
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-10-23 17:23:46 +02:00
..
2019-09-05 12:17:50 +02:00
2019-09-17 10:27:46 -07:00
2019-09-19 14:14:28 -07:00
2019-09-16 09:56:27 -07:00
2019-09-23 19:37:49 -07:00
2019-09-19 13:27:23 -07:00
2019-09-21 10:26:24 -07:00
2019-09-19 16:24:24 -07:00
2019-09-27 17:00:27 -07:00
2019-09-18 10:33:46 -07:00
2019-08-28 21:17:12 -06:00
2019-09-17 19:15:14 -07:00
2019-09-23 11:21:04 -07:00
2019-09-18 10:33:46 -07:00
2019-09-19 13:27:23 -07:00
2019-09-05 19:52:33 -06:00
2019-09-22 10:34:46 -07:00
2019-09-25 09:55:59 -07:00
2019-10-23 17:15:56 +02:00
2019-09-05 11:40:54 +02:00
2019-09-29 10:33:41 -07:00
2019-09-24 15:54:08 -07:00
2019-09-07 04:28:05 -03:00
2019-09-02 11:43:54 +01:00
2019-09-05 12:32:05 +02:00
2019-09-29 10:33:41 -07:00
2019-09-23 19:16:01 -07:00
2019-09-23 19:16:01 -07:00
2019-10-04 18:11:08 -07:00
2019-09-18 10:33:46 -07:00
2019-09-25 17:51:41 -07:00
2019-09-07 21:42:25 +02:00
2019-09-04 13:37:17 +02:00
2019-08-30 07:27:17 -07:00