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