Arnd Bergmann 78ed001d9e compat: scsi: sg: fix v3 compat read/write interface
In the v5.4 merge window, a cleanup patch from Al Viro conflicted
with my rework of the compat handling for sg.c read(). Linus Torvalds
did a correct merge but pointed out that the resulting code is still
unsatisfactory.

I later noticed that the sg_new_read() function still gets the compat
mode wrong, when the 'count' argument is large enough to pass a
compat_sg_io_hdr object, but not a nativ sg_io_hdr.

To address both of these, move the definition of compat_sg_io_hdr
into a scsi/sg.h to make it visible to sg.c and rewrite the logic
for reading req_pack_id as well as the size check to a simpler
version that gets the expected results.

Fixes: c35a5cfb4150 ("scsi: sg: sg_read(): simplify reading ->pack_id of userland sg_io_hdr_t")
Fixes: 98aaaec4a150 ("compat_ioctl: reimplement SG_IO handling")
Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-01-03 09:32:54 +01:00
..
2019-07-11 15:14:01 -07:00
2019-09-30 23:59:53 -04:00
2019-12-27 17:28:41 -08:00
2019-12-02 13:37:02 -08:00
2019-11-07 06:43:18 -07:00
2019-12-02 13:37:02 -08:00
2019-09-21 10:50:15 -07:00
2019-11-06 00:04:02 -05:00
2019-09-21 10:50:15 -07:00
2019-12-27 17:28:41 -08:00
2019-12-08 12:23:42 -08:00
2019-12-08 12:23:42 -08:00
2019-12-14 12:51:57 -08:00
2019-03-02 11:39:54 -08:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2019-11-12 22:21:35 -05:00
2018-12-18 23:19:21 -05:00
2019-07-11 15:17:41 -07:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2019-07-11 15:14:01 -07:00
2019-11-07 06:43:18 -07:00
2019-06-18 19:46:18 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-11-06 21:31:28 -05:00
2019-11-07 06:43:18 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2018-12-28 14:48:06 -08:00
2019-05-20 10:56:43 -04:00
2019-08-16 11:33:56 -07:00
2019-08-16 11:33:56 -07:00
2019-12-02 13:37:02 -08:00
2019-12-02 13:37:02 -08:00
2019-07-11 15:14:01 -07:00
2019-12-02 13:37:02 -08:00
2019-12-08 12:23:42 -08:00
2019-12-08 12:23:42 -08:00
2019-12-08 12:23:42 -08:00
2019-07-11 15:14:01 -07:00
2018-12-18 23:19:21 -05:00
2019-05-21 06:16:23 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:14:01 -07:00