Nicolas Dichtel
5b7d4d91c0
ipv{4,6}/raw: fix output xfrm lookup wrt protocol
...
commit 3632679d9e4f879f49949bb5b050e0de553e4739 upstream.
With a raw socket bound to IPPROTO_RAW (ie with hdrincl enabled), the
protocol field of the flow structure, build by raw_sendmsg() /
rawv6_sendmsg()), is set to IPPROTO_RAW. This breaks the ipsec policy
lookup when some policies are defined with a protocol in the selector.
For ipv6, the sin6_port field from 'struct sockaddr_in6' could be used to
specify the protocol. Just accept all values for IPPROTO_RAW socket.
For ipv4, the sin_port field of 'struct sockaddr_in' could not be used
without breaking backward compatibility (the value of this field was never
checked). Let's add a new kind of control message, so that the userland
could specify which protocol is used.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
CC: stable@vger.kernel.org
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20230522120820.1319391-1-nicolas.dichtel@6wind.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-05 08:17:33 +02:00
..
2020-12-30 11:51:35 +01:00
2022-08-25 11:17:47 +02:00
2019-06-05 10:55:30 -04:00
2018-12-16 14:05:58 +00:00
2019-09-07 17:44:25 +02:00
2020-06-07 13:18:48 +02:00
2023-02-06 07:52:47 +01:00
2019-09-25 11:00:46 +02:00
2019-08-14 23:36:27 +02:00
2019-08-14 23:36:27 +02:00
2019-09-10 09:26:33 -04:00
2019-09-13 13:10:06 -07:00
2019-06-24 19:23:46 +02:00
2019-03-18 12:18:28 +00:00
2019-07-09 12:11:59 -07:00
2023-03-11 16:44:15 +01:00
2019-06-26 20:14:13 -04:00
2018-11-19 19:03:43 -07:00
2019-04-25 19:33:34 +02:00
2022-12-08 11:22:57 +01:00
2018-06-07 17:34:39 -07:00
2019-03-07 18:32:01 -08:00
2019-06-27 19:25:05 +02:00
2019-03-25 10:01:13 +01:00
2018-08-11 15:46:41 -06:00
2019-01-04 13:13:47 -08:00
2019-03-07 18:32:01 -08:00
2019-01-24 11:11:42 -07:00
2022-04-15 14:18:32 +02:00
2019-07-25 11:05:10 +02:00
2019-09-19 14:22:44 +02:00
2020-11-05 11:43:27 +01:00
2023-05-17 11:35:55 +02:00
2019-11-05 12:44:34 +01:00
2022-11-25 17:42:05 +01:00
2019-12-31 16:43:43 +01:00
2019-12-17 19:56:20 +01:00
2019-07-16 19:23:23 -07:00
2019-09-25 17:51:39 -07:00
2023-05-17 11:35:48 +02:00
2020-04-08 09:08:42 +02:00
2019-08-02 14:44:02 +10:00
2018-07-29 12:53:54 -07:00
2019-11-11 16:04:21 -08:00
2019-09-16 10:18:01 -04:00
2022-05-25 09:14:35 +02:00
2018-10-04 09:40:52 -07:00
2019-03-20 21:11:22 -04:00
2019-02-01 13:56:58 +00:00
2019-02-14 11:51:51 -05:00
2021-07-19 08:53:11 +02:00
2018-07-15 14:03:06 +02:00
2019-02-07 16:43:23 +01:00
2018-12-20 19:13:07 +01:00
2019-03-20 18:49:06 -04:00
2018-09-06 09:40:59 -06:00
2019-03-27 13:30:07 -07:00
2019-08-05 17:56:46 +02:00
2019-09-21 14:26:33 -07:00
2021-01-06 14:48:35 +01:00
2018-06-18 15:11:53 +10:00
2019-08-12 19:33:50 -07:00
2019-10-23 14:26:37 +02:00
2018-09-24 12:18:42 -07:00
2018-09-13 10:46:24 +02:00
2019-09-04 12:43:54 +02:00
2018-11-16 14:09:40 +08:00
2021-02-03 23:25:55 +01:00
2018-09-05 22:27:11 -07:00
2020-12-30 11:51:00 +01:00
2018-09-21 19:22:32 -07:00
2019-01-22 12:04:14 -08:00
2019-07-31 19:13:40 -04:00
2019-06-05 13:04:29 -07:00
2018-10-15 21:46:06 -07:00
2019-07-04 12:30:48 -07:00
2019-06-29 11:06:17 -07:00
2019-03-21 13:19:15 -07:00
2018-12-19 15:58:01 -08:00
2019-04-19 13:58:17 -07:00
2019-08-31 01:08:26 +02:00
2019-01-22 17:18:09 -08:00
2018-06-29 11:32:55 +09:00
2019-03-03 21:05:10 -08:00
2023-06-05 08:17:33 +02:00
2019-08-31 23:44:28 -07:00
2018-06-27 19:21:25 +02:00
2022-03-08 19:07:50 +01:00
2020-01-14 20:08:24 +01:00
2019-09-18 10:43:22 -06:00
2019-06-18 17:14:35 +02:00
2019-07-04 02:29:49 +02:00
2018-07-29 12:37:06 -07:00
2019-07-25 11:05:10 +02:00
2019-07-25 11:05:10 +02:00
2019-08-22 17:24:51 +02:00
2018-07-26 17:04:37 -07:00
2019-03-05 21:07:14 -08:00
2021-01-06 14:48:37 +01:00
2019-09-08 15:37:04 +02:00
2018-07-07 17:41:38 +02:00
2019-07-10 18:43:43 -07:00
2019-08-07 10:21:38 -05:00
2019-07-02 18:56:01 +02:00
2020-09-23 12:40:38 +02:00
2018-08-03 10:03:57 -07:00
2021-01-06 14:48:37 +01:00
2019-03-07 18:31:59 -08:00
2019-04-22 13:02:53 -04:00
2020-06-24 17:50:35 +02:00
2019-08-19 13:04:45 -07:00
2023-05-17 11:35:36 +02:00
2019-06-21 16:45:38 -04:00
2019-03-28 02:07:54 +09:00
2018-10-05 16:32:04 -07:00
2019-06-06 13:48:51 -07:00
2019-02-18 17:49:30 +01:00
2019-03-20 18:49:06 -04:00
2021-01-06 14:48:37 +01:00
2019-02-21 13:05:05 -08:00
2019-01-04 13:13:47 -08:00
2018-06-20 19:10:06 -06:00
2018-11-17 21:09:49 -08:00
2019-01-29 22:09:31 -08:00
2018-12-16 12:15:25 -08:00
2019-08-23 14:58:07 -07:00
2018-11-27 16:20:20 -08:00
2018-12-18 15:59:29 -08:00
2018-07-29 12:37:06 -07:00
2018-10-25 10:25:22 +02:00
2018-12-01 12:38:32 +01:00
2018-12-01 12:38:32 +01:00
2018-12-01 12:38:32 +01:00
2018-12-01 12:38:32 +01:00
2021-01-06 14:48:37 +01:00
2019-05-28 21:37:30 -07:00
2022-01-05 12:37:45 +01:00
2020-11-05 11:43:31 +01:00
2019-04-25 14:18:14 -04:00
2019-07-12 11:05:40 -07:00
2019-08-30 12:28:44 +02:00
2019-11-06 06:17:38 +09:00
2019-09-06 14:59:18 +02:00
2021-11-17 09:48:50 +01:00
2018-07-19 11:46:57 +01:00
2020-10-29 09:58:00 +01:00
2019-10-02 20:32:27 -06:00
2019-09-06 15:02:16 +02:00
2021-09-22 12:26:45 +02:00
2019-01-22 10:21:45 +01:00
2019-07-30 20:34:34 +02:00
2018-08-11 12:13:49 -07:00
2019-09-16 18:47:53 -07:00
2019-04-16 23:05:21 +02:00
2019-07-25 11:05:10 +02:00
2019-11-15 12:48:32 -08:00
2020-12-21 13:27:03 +01:00
2022-06-22 14:11:03 +02:00
2019-08-24 16:55:25 -07:00
2018-06-03 17:37:16 -07:00
2018-07-10 22:18:52 +02:00
2019-05-28 21:37:30 -07:00
2019-07-25 11:05:10 +02:00
2019-11-05 15:50:14 +01:00
2019-08-27 20:54:14 -07:00
2020-08-19 08:15:58 +02:00
2019-06-29 10:33:57 -06:00
2019-10-04 15:57:51 +02:00
2021-09-22 12:26:29 +02:00
2018-10-02 13:38:55 -07:00
2020-04-01 11:01:57 +02:00
2018-10-05 16:32:04 -07:00
2018-10-07 21:06:28 -07:00
2019-06-17 20:20:36 -07:00
2019-08-03 11:02:46 -07:00
2019-04-19 14:07:40 -07:00
2023-01-18 11:41:29 +01:00
2019-04-17 17:20:01 -05:00
2021-01-06 14:48:37 +01:00
2018-06-18 21:02:52 -04:00
2018-10-26 16:26:32 -07:00
2019-09-16 16:26:11 +02:00
2019-03-05 14:08:26 -08:00
2019-02-14 11:51:51 -05:00
2019-02-07 00:13:28 +01:00
2019-05-20 20:16:08 -04:00
2019-03-19 13:56:17 -07:00
2019-04-19 14:59:05 -07:00
2019-08-31 23:44:28 -07:00
2021-05-14 09:44:22 +02:00
2018-09-03 13:29:38 +02:00
2018-11-07 16:23:04 -08:00
2019-05-22 10:36:35 -07:00
2019-08-14 16:52:13 +02:00
2023-03-11 16:44:14 +01:00
2018-11-20 13:22:40 -05:00
2019-05-29 06:19:12 -04:00
2018-07-24 17:39:28 -04:00
2019-07-25 11:05:10 +02:00
2020-07-22 09:33:11 +02:00
2019-04-24 14:18:51 +02:00
2021-01-17 14:05:30 +01:00
2018-12-19 18:23:49 -05:00
2018-12-19 18:23:49 -05:00
2022-11-03 23:56:56 +09:00
2018-10-24 20:57:55 -04:00
2018-12-19 18:23:49 -05:00
2019-01-24 10:15:42 -05:00
2019-09-18 20:17:50 +02:00
2019-04-11 17:00:10 +02:00
2019-09-18 20:17:50 +02:00
2019-07-22 11:52:27 -04:00
2019-07-25 11:05:10 +02:00
2019-02-05 15:29:48 -05:00
2019-07-25 11:05:10 +02:00
2019-08-01 21:49:46 +02:00
2020-12-02 08:49:45 +01:00
2019-07-25 11:05:10 +02:00
2019-01-25 01:50:03 +01:00
2022-03-08 19:07:47 +01:00