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
..
2023-05-31 13:06:57 +02:00
2023-08-16 11:09:17 +01:00
2023-10-13 16:49:32 -07:00
2023-02-13 18:35:15 +08:00
2023-03-15 00:37:32 -07:00
2023-07-18 17:31:10 -07:00
2023-08-16 11:09:17 +01:00
2023-08-20 11:40:49 +01:00
2023-09-08 08:02:17 +01:00
2023-06-22 18:40:38 -07:00
2023-10-25 10:38:07 +01:00
2023-03-16 17:26:31 -07:00
2022-04-30 15:12:58 +01:00
2023-10-18 18:11:31 -07:00
2023-10-03 09:00:40 +02:00
2023-04-12 16:40:39 -07:00
2023-04-12 16:40:39 -07:00
2023-05-26 10:30:14 +01:00
2023-05-26 10:30:14 +01:00
2023-06-10 00:11:41 -07:00
2023-03-31 21:37:06 -07:00
2023-09-05 17:49:40 +01:00
2023-10-13 16:49:32 -07:00
2023-08-16 11:09:18 +01:00
2022-10-31 20:14:27 -07:00
2023-10-13 10:01:49 -07:00
2023-08-16 11:09:17 +01:00
2022-07-08 12:10:33 +01:00
2023-08-30 09:44:09 +01:00
2023-08-15 15:26:18 -07:00
2023-07-19 12:27:09 +01:00
2023-09-01 08:11:51 +01:00
2023-09-01 07:27:33 +01:00
2023-09-01 07:27:33 +01:00
2023-08-04 18:24:52 -07:00
2023-04-13 16:43:38 -07:00
2023-07-11 11:06:08 +02:00
2022-09-29 07:18:00 +02:00
2023-05-22 11:17:55 +01:00
2023-04-12 16:40:39 -07:00
2022-06-24 11:34:38 +01:00
2023-08-30 09:44:09 +01:00
2022-11-16 13:02:04 +00:00
2023-04-12 16:40:39 -07:00
2023-01-23 21:37:25 -08:00
2022-05-16 13:03:29 +02:00
2023-08-15 18:54:53 -07:00
2023-08-16 11:09:17 +01:00
2023-01-26 10:52:18 +01:00
2023-04-06 12:01:20 -07:00
2023-08-16 11:09:17 +01:00
2023-10-04 11:39:36 -07:00
2023-11-20 11:59:01 +01:00
2023-08-15 15:26:18 -07:00
2023-02-02 00:25:14 +01:00
2022-04-06 12:05:41 -07:00
2023-10-18 18:09:31 -07:00
2022-10-16 15:27:07 -07:00
2023-03-22 22:53:00 -07:00
2023-02-02 00:25:14 +01:00
2023-02-02 00:25:14 +01:00
2022-09-20 10:21:49 -07:00
2023-08-16 11:09:18 +01:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2023-11-20 11:58:56 +01:00
2023-10-19 09:10:00 -07:00
2022-04-06 12:05:41 -07:00
2023-11-20 11:58:59 +01:00
2023-08-16 11:09:17 +01:00
2022-04-06 12:05:41 -07:00
2023-06-10 00:11:41 -07:00
2023-10-18 18:06:36 -07:00
2022-12-20 03:13:45 +01:00
2022-04-28 13:02:01 -07:00
2023-10-17 17:25:42 -07:00
2022-04-06 12:05:41 -07:00
2023-08-18 12:44:56 -07:00
2023-01-19 09:26:16 -08:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2023-10-20 17:40:10 -07:00
2023-03-03 17:25:15 +01:00
2022-11-16 09:43:35 +00:00
2023-06-24 15:50:13 -07:00
2023-11-20 11:58:56 +01:00
2023-11-20 11:58:56 +01:00
2022-11-29 08:44:24 -08:00
2023-11-20 11:58:56 +01:00
2023-11-20 11:58:56 +01:00
2023-11-20 11:58:56 +01:00
2023-08-29 17:39:15 -07:00
2022-06-08 10:10:13 -07:00
2022-09-29 07:18:00 +02:00