linux-stable/include
Eric Dumazet 1fa7bf6a0d tcp: fix cookie_init_timestamp() overflows
[ Upstream commit 73ed8e0338 ]

cookie_init_timestamp() is supposed to return a 64bit timestamp
suitable for both TSval determination and setting of skb->tstamp.

Unfortunately it uses 32bit fields and overflows after
2^32 * 10^6 nsec (~49 days) of uptime.

Generated TSval are still correct, but skb->tstamp might be set
far away in the past, potentially confusing other layers.

tcp_ns_to_ts() is changed to return a full 64bit value,
ts and ts_now variables are changed to u64 type,
and TSMASK is removed in favor of shifts operations.

While we are at it, change this sequence:
		ts >>= TSBITS;
		ts--;
		ts <<= TSBITS;
		ts |= options;
to:
		ts -= (1UL << TSBITS);

Fixes: 9a568de481 ("tcp: switch TCP TS option (RFC 7323) to 1ms clock")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:01 +01:00
..
acpi
asm-generic
clocksource
crypto
drm gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET 2023-10-17 20:35:38 -04:00
dt-bindings
keys
kunit
kvm
linux PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() 2023-11-20 11:58:57 +01:00
math-emu
media
memory
misc
net tcp: fix cookie_init_timestamp() overflows 2023-11-20 11:59:01 +01:00
pcmcia
ras
rdma
rv
scsi scsi: sd: Introduce manage_shutdown device flag 2023-10-27 10:00:19 +09:00
soc
sound
target
trace neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section 2023-10-18 11:16:43 +01:00
uapi Including fixes from WiFi and netfilter. 2023-10-26 07:41:27 -10:00
ufs
vdso
video fbdev: uvesafb: Remove uvesafb_exec() prototype from include/video/uvesafb.h 2023-10-16 23:19:34 +02:00
xen