Files
linux/include/linux
Arnd Bergmann 8896dd968b compat_ioctl: add compat_ptr_ioctl()
commit 2952db0fd5 upstream.

Many drivers have ioctl() handlers that are completely compatible between
32-bit and 64-bit architectures, except for the argument that is passed
down from user space and may have to be passed through compat_ptr()
in order to become a valid 64-bit pointer.

Using ".compat_ptr = compat_ptr_ioctl" in file operations should let
us simplify a lot of those drivers to avoid #ifdef checks, and convert
additional drivers that don't have proper compat handling yet.

On most architectures, the compat_ptr_ioctl() just passes all arguments
to the corresponding ->ioctl handler. The exception is arch/s390, where
compat_ptr() clears the top bit of a 32-bit pointer value, so user space
pointers to the second 2GB alias the first 2GB, as is the case for native
32-bit s390 user space.

The compat_ptr_ioctl() function must therefore be used only with
ioctl functions that either ignore the argument or pass a pointer to a
compatible data type.

If any ioctl command handled by fops->unlocked_ioctl passes a plain
integer instead of a pointer, or any of the passed data types is
incompatible between 32-bit and 64-bit architectures, a proper handler
is required instead of compat_ptr_ioctl.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-17 19:55:30 +01:00
..
2019-08-09 09:15:05 +02:00
2019-09-17 10:27:46 -07:00
2019-09-16 09:56:27 -07:00
2019-05-31 11:13:10 +02:00
2019-11-29 10:10:10 +01:00
2018-05-26 09:16:44 +02:00
2019-08-20 22:09:52 +02:00
2019-05-14 19:52:50 -07:00
2019-07-01 08:18:54 -06:00
2019-08-28 21:17:12 -06:00
2018-11-07 13:44:59 -07:00
2018-11-07 13:44:59 -07:00
2019-04-09 17:05:46 -07:00
2018-06-15 18:10:01 -03:00
2019-06-12 20:27:13 +02:00
2018-08-22 10:52:48 -07:00
2019-09-05 19:52:33 -06:00
2019-02-28 03:28:53 -05:00
2019-08-05 21:52:53 +02:00
2019-02-28 08:24:23 -07:00
2018-12-19 10:42:08 +01:00
2019-12-17 19:55:30 +01:00
2019-11-29 10:10:13 +01:00
2019-04-22 09:48:12 -06:00
2019-02-15 16:54:38 +01:00
2019-09-05 11:40:54 +02:00
2019-09-24 15:54:08 -07:00
2019-10-02 06:36:50 -07:00
2019-07-05 21:34:50 +02:00
2019-06-26 13:19:46 -07:00
2018-11-19 19:03:46 -07:00
2018-06-22 13:43:27 +09:00
2019-06-10 13:00:24 +02:00
2019-04-08 22:56:14 +02:00
2019-09-07 04:28:05 -03:00
2019-12-13 08:42:53 +01:00
2019-09-02 11:43:54 +01:00
2018-07-12 21:35:28 +02:00
2018-11-30 13:29:04 +00:00
2019-03-07 18:32:03 -08:00
2019-09-05 12:32:05 +02:00
2018-06-07 17:34:35 -07:00
2019-12-13 08:43:18 +01:00
2019-08-14 15:30:35 +02:00
2019-08-08 09:09:25 +02:00
2018-10-17 13:56:58 -07:00
2019-07-08 19:25:19 -07:00
2019-06-13 09:02:33 -04:00
2019-02-20 07:22:17 -07:00
2019-02-20 07:22:10 -07:00
2018-12-06 15:45:46 +01:00
2019-02-08 15:02:49 -08:00
2018-07-10 17:22:35 +02:00
2019-07-26 17:01:29 -06:00
2018-06-07 17:34:36 -07:00
2018-10-21 10:46:39 -04:00
2019-07-16 19:23:25 -07:00
2019-10-04 18:11:08 -07:00
2019-08-01 21:49:46 +02:00
2018-10-08 22:53:10 +11:00
2019-06-12 11:42:13 +02:00
2019-06-15 12:25:49 +02:00
2019-05-14 19:52:48 -07:00
2018-07-20 01:11:45 +02:00
2019-08-23 16:39:26 +01:00
2018-05-11 17:28:45 -07:00
2019-07-31 19:03:35 +02:00
2019-05-08 22:14:36 +02:00
2018-09-25 20:17:35 -07:00
2019-11-29 10:10:13 +01:00
2019-05-31 12:37:46 -07:00
2019-05-16 15:51:55 -07:00
2018-07-07 17:25:23 +02:00
2019-10-31 14:01:40 -07:00
2019-02-07 16:38:35 +01:00
2018-06-20 11:35:56 +02:00
2019-09-25 17:51:41 -07:00
2019-09-07 21:42:25 +02:00
2019-10-02 10:06:45 +02:00
2018-10-11 09:16:44 -07:00
2019-02-07 00:13:27 +01:00
2019-08-30 07:27:17 -07:00
2019-08-01 20:51:22 +02:00
2019-08-20 17:05:05 +02:00
2019-07-31 19:03:35 +02:00
2018-12-10 10:17:45 +01:00
2019-01-11 18:05:40 -08:00
2018-09-11 14:11:51 +02:00
2019-05-15 17:35:54 +01:00
2018-12-22 12:15:29 +01:00
2019-10-14 15:04:01 -07:00
2018-05-14 09:51:34 -04:00