1
0
Fork 0
alistair23-linux/include
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
..
acpi cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
asm-generic timekeeping/vsyscall: Update VDSO data unconditionally 2019-11-04 23:02:53 +01:00
clocksource
crypto Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity 2019-09-27 19:37:27 -07:00
drm drm/shmem: Add docbook comments for drm_gem_shmem_object madvise fields 2019-11-06 17:57:42 -06:00
dt-bindings Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
keys
kvm KVM: arm/arm64: vgic: Use a single IO device per redistributor 2019-08-25 11:02:52 +01:00
linux compat_ioctl: add compat_ptr_ioctl() 2019-12-17 19:55:30 +01:00
math-emu nds32: Mark expected switch fall-throughs 2019-08-29 11:06:56 -05:00
media media: v4l2-core: introduce a helper to unregister a i2c subdev 2019-08-26 10:52:06 -03:00
misc
net net/tls: use sg_next() to walk sg entries 2019-12-04 22:31:02 +01:00
pcmcia
ras
rdma RDMA/uverbs: Prevent potential underflow 2019-10-22 15:05:36 -03:00
scsi SCSI fixes on 20191015 2019-10-15 12:19:08 -07:00
soc Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
sound ALSA: hda: Modify stream stripe mask only when needed 2019-12-13 08:42:39 +01:00
target
trace tcp: remove redundant new line from tcp_event_sk_skb 2019-11-09 19:41:50 -08:00
uapi ptp: Introduce strict checking of external time stamp options. 2019-11-15 12:48:32 -08:00
vdso
video fbdev: da8xx: remove panel_power_ctrl() callback from platform data 2019-08-26 17:53:58 +05:30
xen xen: fixes and cleanups for 5.4-rc2 2019-10-04 11:13:09 -07:00
Kbuild - New Drivers 2019-09-23 19:37:49 -07:00