]> git.baikalelectronics.ru Git - kernel.git/commit
vsock: Enable y2038 safe timeval for timeout
authorRichard Palethorpe <rpalethorpe@suse.com>
Fri, 8 Oct 2021 10:00:53 +0000 (11:00 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Oct 2021 15:21:53 +0000 (16:21 +0100)
commitfcf21e48876b9f4261d48bfb2a02d7998d175ece
tree50daee13053ceb1ae7fd31f9580edd7c6b5a9966
parent5c67d14e8a568794bd4b05515737a5379d6f9ebd
vsock: Enable y2038 safe timeval for timeout

Reuse the timeval compat code from core/sock to handle 32-bit and
64-bit timeval structures. Also introduce a new socket option define
to allow using y2038 safe timeval under 32-bit.

The existing behavior of sock_set_timeout and vsock's timeout setter
differ when the time value is out of bounds. vsocks current behavior
is retained at the expense of not being able to share the full
implementation.

This allows the LTP test vsock01 to pass under 32-bit compat mode.

Fixes: 26e1a35ad6cd ("socket: move compat timeout handling into sock.c")
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Cc: Richard Palethorpe <rpalethorpe@richiejp.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
include/uapi/linux/vm_sockets.h
net/core/sock.c
net/vmw_vsock/af_vsock.c