Skip to content

net: y2038-safe socket timestamps

Deepa Dinamani cluster-devel linux-alpha linux-arch linux-ia64 linux-mips linux-parisc linux-rdma linux-s390 linuxppc-dev lkml netdev sparclinux 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest12 patches 9 repliesIn review
  2. v412 patches 3 repliesSuperseded
  3. v38 patches 8 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches14 repliesSuperseded
v18 patches26 repliesSuperseded

Changes in v5 from the cover letter

* Fixed the typo in calling sock_get_timeout()

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12selftests: add missing include unistdtools/testing/selftests/networking/timestamping/rxtimestamp.c+1 -00 replies
2/12socket: move compat timeout handling into sock.cnet/compat.c net/core/sock.c net/vmw_vsock/af_vsock.c+46 -890 replies
3/12arch: Use asm-generic/socket.h when possiblearch/ia64/include/uapi/asm/Kbuild arch/ia64/include/uapi/asm/socket.h arch/s390/include/uapi/asm/Kbuild +6 more+5 -3660 replies
4/12sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLDarch/alpha/include/uapi/asm/socket.h arch/mips/include/uapi/asm/socket.h arch/parisc/include/uapi/asm/socket.h +9 more+101 -570 replies
5/12arch: sparc: Override struct __kernel_old_timevalarch/sparc/include/uapi/asm/posix_types.h include/uapi/linux/time.h+12 -00 replies
6/12socket: Use old_timeval types for socket timestampsdrivers/isdn/mISDN/socket.c include/linux/skbuff.h net/bluetooth/hci_sock.c +4 more+12 -120 replies
7/12socket: Add struct __kernel_sock_timevalinclude/uapi/linux/time.h+5 -00 replies
8/12socket: Add SO_TIMESTAMP[NS]_NEWarch/alpha/include/uapi/asm/socket.h arch/mips/include/uapi/asm/socket.h arch/parisc/include/uapi/asm/socket.h +9 more+171 -320 replies
9/12socket: Add SO_TIMESTAMPING_NEWarch/alpha/include/uapi/asm/socket.h arch/mips/include/uapi/asm/socket.h arch/parisc/include/uapi/asm/socket.h +9 more+88 -303 replies
10/12socket: Update timestamping DocumentationDocumentation/networking/timestamping.txt+38 -50 replies
11/12socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixesarch/alpha/include/uapi/asm/socket.h arch/mips/include/uapi/asm/socket.h arch/parisc/include/uapi/asm/socket.h +5 more+28 -161 reply
12/12sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEWarch/alpha/include/uapi/asm/socket.h arch/mips/include/uapi/asm/socket.h arch/parisc/include/uapi/asm/socket.h +3 more+83 -255 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchMax FilippovHeiko CarstensWillem de BruijnMichael Ellerman
1/12A-b
2/12A-b
3/12A-b A-b A-b
4/12A-b
5/12A-b
6/12A-b
7/12A-b
8/12A-b
9/12A-b
10/12A-b
11/12A-b A-b
12/12A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v5 thread

Cover letter [PATCH net-next v5 00/12] net: y2038-safe socket timestamps

The series introduces new socket timestamps that are y2038 safe.

The time data types used for the existing socket timestamp
options: SO_TIMESTAMP, SO_TIMESTAMPNS and SO_TIMESTAMPING are not y2038 safe. The series introduces SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW and SO_TIMESTAMPING_NEW to replace these. These new timestamps can be used on all architectures.

The alternative considered was to extend the sys_setsockopt() by using the flags. We did not receive any strong opinions about either of the approaches. Hence, this was chosen, as glibc folks preferred this.

The series does not deal with updating the internal kernel socket calls like rxrpc to make them y2038 safe. This will be dealt with separately.

Note that the timestamps behavior already does not match the man page specific behavior:
SIOCGSTAMP
This ioctl should only be used if the socket option SO_TIMESTAMP
is not set on the socket. Otherwise, it returns the timestamp of the last packet that was received while SO_TIMESTAMP was not set, or it fails if no such packet has been received, (i.e., ioctl(2) returns -1 with errno set to ENOENT).

The recommendation is to update the man page to remove the above statement.

The overview of the socket timestamp series is as below:
1. Delete asm specific socket.h when possible.
2. Support SO/SCM_TIMESTAMP* options only in userspace.
3. Rename current SO/SCM_TIMESTAMP* to SO/SCM_TIMESTAMP*_OLD.
3. Alter socket options so that SOCK_RCVTSTAMPNS does not rely on SOCK_RCVTSTAMP.
4. Introduce y2038 safe types for socket timestamp.
5. Introduce new y2038 safe socket options SO/SCM_TIMESTAMP*_NEW.
6. Intorduce new y2038 safe socket timeout options.

Changes since v4:
* Fixed the typo in calling sock_get_timeout()

Changes since v3:
* Rebased onto net-next and fixups as per review comments
* Merged the socket timeout series
* Integrated Arnd's patch to simplify compat handling of timeout syscalls

Changes since v2:
* Removed extra functions to reduce diff churn as per code review

Changes since v1:
* Dropped the change to disentangle sock flags
* Renamed sock_timeval to __kernel_sock_timeval
* Updated a few comments
* Added documentation changes

Arnd Bergmann (1):
socket: move compat timeout handling into sock.c

Deepa Dinamani (11):
selftests: add missing include unistd
arch: Use asm-generic/socket.h when possible
sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD
arch: sparc: Override struct __kernel_old_timeval
socket: Use old_timeval types for socket timestamps
socket: Add struct __kernel_sock_timeval
socket: Add SO_TIMESTAMP[NS]_NEW
socket: Add SO_TIMESTAMPING_NEW
socket: Update timestamping Documentation
socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW

 Documentation/networking/timestamping.txt     |  43 ++++-
 arch/alpha/include/uapi/asm/socket.h          |  47 ++++--
 arch/ia64/include/uapi/asm/Kbuild             |   1 +
 arch/ia64/include/uapi/asm/socket.h           | 122 --------------
 arch/mips/include/uapi/asm/socket.h           |  47 ++++--
 arch/parisc/include/uapi/asm/socket.h         |  46 ++++--
 arch/powerpc/include/uapi/asm/socket.h        |   4 +-
 arch/s390/include/uapi/asm/Kbuild             |   1 +
 arch/s390/include/uapi/asm/socket.h           | 119 --------------
 arch/sparc/include/uapi/asm/posix_types.h     |  10 ++
 arch/sparc/include/uapi/asm/socket.h          |  49 ++++--
 arch/x86/include/uapi/asm/Kbuild              |   1 +
 arch/x86/include/uapi/asm/socket.h            |   1 -
 arch/xtensa/include/asm/Kbuild                |   1 +
 arch/xtensa/include/uapi/asm/Kbuild           |   1 +
 arch/xtensa/include/uapi/asm/socket.h         | 124 --------------
 drivers/isdn/mISDN/socket.c                   |   2 +-
 fs/dlm/lowcomms.c                             |   4 +-
 include/linux/skbuff.h                        |  24 ++-
 include/linux/socket.h                        |   8 +
 include/net/sock.h                            |   1 +
 include/uapi/asm-generic/socket.h             |  48 ++++--
 include/uapi/linux/errqueue.h                 |   4 +
 include/uapi/linux/time.h                     |   7 +
 net/bluetooth/hci_sock.c                      |   4 +-
 net/compat.c                                  |  78 +--------
 net/core/scm.c                                |  27 ++++
 net/core/sock.c                               | 151 +++++++++++++-----
 net/ipv4/tcp.c                                |  61 ++++---
 net/rds/af_rds.c                              |  10 +-
 net/rds/recv.c                                |  18 ++-
 net/rxrpc/local_object.c                      |   2 +-
 net/smc/af_smc.c                              |   3 +-
 net/socket.c                                  |  50 ++++--
 net/vmw_vsock/af_vsock.c                      |   4 +-
 .../networking/timestamping/rxtimestamp.c     |   1 +
 36 files changed, 541 insertions(+), 583 deletions(-)
 delete mode 100644 arch/ia64/include/uapi/asm/socket.h
 delete mode 100644 arch/s390/include/uapi/asm/socket.h
 delete mode 100644 arch/x86/include/uapi/asm/socket.h
 delete mode 100644 arch/xtensa/include/uapi/asm/socket.h
Signature · 30 lines
2.17.1

Cc: ccaulfie at redhat.com
Cc: chris at zankel.net
Cc: cluster-devel at redhat.com
Cc: davem at davemloft.net
Cc: deller at gmx.de
Cc: dhowells at redhat.com
Cc: fenghua.yu at intel.com
Cc: isdn at linux-pingi.de
Cc: jejb at parisc-linux.org
Cc: linux-afs at lists.infradead.org
Cc: linux-alpha at vger.kernel.org
Cc: linux-arch at vger.kernel.org
Cc: linux-ia64 at vger.kernel.org
Cc: linux-mips at linux-mips.org
Cc: linux-mips at vger.kernel.org
Cc: linux-parisc at vger.kernel.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-rdma at vger.kernel.org
Cc: linux-s390 at vger.kernel.org
Cc: linux-xtensa at linux-xtensa.org
Cc: netdev at vger.kernel.org
Cc: paulus at samba.org
Cc: ralf at linux-mips.org
Cc: rth at twiddle.net
Cc: schwidefsky at de.ibm.com
Cc: sparclinux at vger.kernel.org
Cc: tglx at linutronix.de
Cc: ubraun at linux.ibm.com