Willy Tarreau
40d20f3186
secure_seq: use the 64 bits of the siphash for port offset calculation
...
commit b2d057560b8107c633b39aabe517ff9d93f285e3 upstream.
SipHash replaced MD5 in secure_ipv{4,6}_port_ephemeral() via commit
7cd23e5300c1 ("secure_seq: use SipHash in place of MD5"), but the output
remained truncated to 32-bit only. In order to exploit more bits from the
hash, let's make the functions return the full 64-bit of siphash_3u32().
We also make sure the port offset calculation in __inet_hash_connect()
remains done on 32-bit to avoid the need for div_u64_rem() and an extra
cost on 32-bit systems.
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Moshe Kol <moshe.kol@mail.huji.ac.il>
Cc: Yossi Gilad <yossi.gilad@mail.huji.ac.il>
Cc: Amit Klein <aksecurity@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[SG: Adjusted context]
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06 08:20:56 +02:00
..
2017-07-11 06:08:58 -04:00
2022-05-15 19:40:26 +02:00
2021-06-10 12:43:51 +02:00
2017-11-02 11:10:55 +01:00
2022-03-08 19:01:56 +01:00
2019-06-17 19:52:44 +02:00
2021-12-08 08:46:52 +01:00
2019-03-23 14:35:16 +01:00
2022-01-05 12:33:49 +01:00
2019-05-04 09:15:20 +02:00
2020-06-03 08:17:33 +02:00
2020-08-21 09:48:00 +02:00
2017-08-29 10:55:20 +01:00
2021-08-04 12:22:14 +02:00
2019-08-04 09:31:59 +02:00
2017-11-02 11:10:55 +01:00
2019-06-11 12:21:51 +02:00
2017-11-02 11:10:55 +01:00
2022-04-27 13:15:32 +02:00
2022-02-23 11:57:34 +01:00
2020-12-08 10:17:33 +01:00
2021-08-04 12:22:14 +02:00
2017-07-04 22:35:16 +01:00
2021-06-03 08:36:13 +02:00
2022-03-02 11:33:55 +01:00
2017-07-04 01:29:04 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-31 14:42:19 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-05 11:53:34 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2022-02-16 12:44:51 +01:00
2020-01-04 14:00:14 +01:00
2020-07-22 09:22:20 +02:00
2017-08-22 14:29:30 -07:00
2022-03-28 08:22:26 +02:00
2017-09-01 20:33:42 -07:00
2020-03-20 10:54:10 +01:00
2017-11-02 11:10:55 +01:00
2020-03-11 18:02:48 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-11-10 11:25:37 +01:00
2019-11-10 11:25:37 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-07-22 09:22:19 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-03-03 18:22:57 +01:00
2017-07-04 01:29:04 -07:00
2018-04-29 11:33:13 +02:00
2017-08-07 11:39:22 -07:00
2017-11-02 11:10:55 +01:00
2020-08-21 09:48:14 +02:00
2020-12-11 13:39:03 +01:00
2019-04-27 09:35:40 +02:00
2022-06-06 08:20:56 +02:00
2018-10-18 09:16:21 +02:00
2018-05-16 10:10:24 +02:00
2019-02-23 09:06:42 +01:00
2019-06-11 12:21:47 +02:00
2021-07-28 11:12:15 +02:00
2019-07-21 09:04:28 +02:00
2019-01-31 08:13:42 +01:00
2017-11-02 11:10:55 +01:00
2020-08-21 09:48:08 +02:00
2022-02-08 18:16:26 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-09-16 08:20:44 +02:00
2020-05-20 08:17:02 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-06 17:31:33 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-11-06 12:43:36 +01:00
2021-08-04 12:22:17 +02:00
2021-11-26 11:40:36 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:51:58 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-01-09 10:17:59 +01:00
2019-04-17 08:37:50 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-07-01 07:39:09 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-16 10:10:23 +02:00
2021-12-08 08:46:48 +01:00
2017-08-29 15:16:52 -07:00
2017-11-02 11:10:55 +01:00
2017-11-09 10:03:09 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-01 03:55:47 +01:00
2021-08-26 08:37:02 -04:00
2017-11-02 11:10:55 +01:00
2017-08-07 11:39:21 -07:00
2017-11-02 11:10:55 +01:00
2021-04-16 11:57:49 +02:00
2018-05-30 07:52:01 +02:00
2020-01-27 14:46:50 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:52:14 +02:00
2021-03-30 14:40:12 +02:00
2022-01-27 09:01:01 +01:00
2017-11-02 11:10:55 +01:00
2022-06-06 08:20:56 +02:00
2017-08-25 17:10:23 -07:00
2018-04-19 08:56:16 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2022-04-20 09:08:28 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 10:37:11 +09:00
2017-08-07 14:48:48 -07:00
2022-05-12 12:17:07 +02:00
2018-12-05 19:41:10 +01:00
2018-06-26 08:06:28 +08:00
2017-11-02 11:10:55 +01:00
2017-08-29 15:16:52 -07:00
2017-11-02 11:10:55 +01:00
2018-06-26 08:06:28 +08:00
2018-03-08 22:41:10 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2022-04-20 09:08:31 +02:00