aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fsi
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-11-27 12:29:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-28 16:54:00 +0100
commit9a450484089dfa8b6348eff2a918f3c8f38585b9 (patch)
tree91cecd53a41c70f00531226cccf1303a168ca6d1 /drivers/fsi
parentlkdtm: Missing kmalloc check (diff)
downloadlinux-dev-9a450484089dfa8b6348eff2a918f3c8f38585b9.tar.xz
linux-dev-9a450484089dfa8b6348eff2a918f3c8f38585b9.zip
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>
Diffstat (limited to 'drivers/fsi')
0 files changed, 0 insertions, 0 deletions