linux/include
Arnd Bergmann 9a45048408 lp: support 64-bit time_t user space
Once we get a glibc with 64-bit time_t, the LPSETTIMEOUT ioctl stops
working, since the command number and data structure no longer match.

To work around that, this introduces a new command number LPSETTIMEOUT_NEW
that is used whenever the modified user space evaluates the LPSETTIMEOUT
macro.

The trick we use is a bit convoluted but necessary: we cannot check for
any macros set by the C library in linux/lp.h, because this particular
header can be included before including sys/time.h. However, we can assume
that by the time that LPSETTIMEOUT is seen in the code, the definition
for 'timeval' and 'time_t' has been seen as well, so we can use the
sizeof() operator to determine whether we should use the old or the
new definition. We use the old one not only for traditional 32-bit user
space with 32-bit time_t, but also for all 64-bit architectures and x32,
which always use a 64-bit time_t, the new definition will be used only for
32-bit user space with 64-bit time_t, which also requires a newer kernel.

The compat_ioctl() handler now implements both commands, but has to
use a special case for existing x32 binaries. The native ioctl handler
now implements both command numbers on both 32-bit and 64-bit, though
the latter version use the same interpretation for both.

This is based on an earlier patch from Bamvor.

Cc: Bamvor Jian Zhang <bamv2005@gmail.com>
Link: http://www.spinics.net/lists/y2038/msg01162.html
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 16:54:00 +01:00
..
acpi TTY/Serial patches for 4.15-rc1 2017-11-13 21:05:31 -08:00
asm-generic include/asm-generic/topology.h: remove unused parent_node() macro 2017-11-17 16:10:05 -08:00
clocksource arm64 updates for 4.15 2017-11-15 10:56:56 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-11-14 10:52:09 -08:00
drm fixes/cleanups for rc1, non-desktop flags for VR 2017-11-23 21:04:56 -10:00
dt-bindings fixes/cleanups for rc1, non-desktop flags for VR 2017-11-23 21:04:56 -10:00
keys
kvm KVM: arm/arm64: GICv4: Use the doorbell interrupt as an unblocking source 2017-11-10 09:43:22 +01:00
lib
linux fpga: add attribute groups 2017-11-28 16:30:38 +01:00
math-emu
media media updates for v4.15-rc1 2017-11-15 20:30:12 -08:00
memory
misc
net net: accept UFO datagrams from tuntap and packet 2017-11-24 01:37:35 +09:00
pcmcia
ras
rdma Updates for 4.15 kernel merge window 2017-11-15 14:54:53 -08:00
scsi scsi: Use 'blist_flags_t' for scsi_devinfo flags 2017-11-16 17:43:27 -05:00
soc We have two changes to the core framework this time around. The first being a 2017-11-17 20:04:24 -08:00
sound ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization 2017-11-22 12:34:56 +01:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2017-11-24 19:19:20 -10:00
trace Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-26 13:43:25 -08:00
uapi lp: support 64-bit time_t user space 2017-11-28 16:54:00 +01:00
video fbdev changes for v4.15: 2017-11-20 21:50:24 -10:00
xen xen: features and fixes for v4.15-rc1 2017-11-16 13:06:27 -08:00