Paolo Abeni
fcf4692fa3
mptcp: prevent BPF accessing lowat from a subflow socket.
...
Alexei reported the following splat:
WARNING: CPU: 32 PID: 3276 at net/mptcp/subflow.c:1430 subflow_data_ready+0x147/0x1c0
Modules linked in: dummy bpf_testmod(O) [last unloaded: bpf_test_no_cfi(O)]
CPU: 32 PID: 3276 Comm: test_progs Tainted: GO 6.8.0-12873-g2c43c33bfd23
Call Trace:
<TASK>
mptcp_set_rcvlowat+0x79/0x1d0
sk_setsockopt+0x6c0/0x1540
__bpf_setsockopt+0x6f/0x90
bpf_sock_ops_setsockopt+0x3c/0x90
bpf_prog_509ce5db2c7f9981_bpf_test_sockopt_int+0xb4/0x11b
bpf_prog_dce07e362d941d2b_bpf_test_socket_sockopt+0x12b/0x132
bpf_prog_348c9b5faaf10092_skops_sockopt+0x954/0xe86
__cgroup_bpf_run_filter_sock_ops+0xbc/0x250
tcp_connect+0x879/0x1160
tcp_v6_connect+0x50c/0x870
mptcp_connect+0x129/0x280
__inet_stream_connect+0xce/0x370
inet_stream_connect+0x36/0x50
bpf_trampoline_6442491565+0x49/0xef
inet_stream_connect+0x5/0x50
__sys_connect+0x63/0x90
__x64_sys_connect+0x14/0x20
The root cause of the issue is that bpf allows accessing mptcp-level
proto_ops from a tcp subflow scope.
Fix the issue detecting the problematic call and preventing any action.
Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/482
Fixes: 5684ab1a0eff ("mptcp: give rcvlowat some love")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/d8cb7d8476d66cb0812a6e29cd1e626869d9d53e.1711738080.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-04-01 20:43:24 -07:00
..
2024-02-09 14:12:01 -08:00
2023-12-13 05:44:30 +09:00
2023-10-28 11:29:28 +01:00
2024-02-26 11:46:12 +00:00
2023-12-26 20:31:01 +00:00
2024-02-09 14:12:01 -08:00
2024-02-02 12:44:16 +00:00
2024-03-29 09:48:37 -04:00
2024-03-11 18:06:04 -07:00
2024-03-14 18:03:09 -07:00
2024-01-05 08:06:35 -08:00
2024-02-20 15:32:45 +01:00
2024-03-06 12:43:01 +01:00
2024-03-29 12:27:05 -07:00
2024-03-21 14:41:00 -07:00
2024-03-19 19:37:57 -07:00
2024-01-11 10:07:29 -08:00
2024-03-07 20:37:13 -08:00
2024-03-06 20:40:20 -08:00
2024-02-08 18:32:29 -08:00
2024-03-29 10:42:21 +00:00
2024-03-08 20:35:33 -08:00
2023-12-15 10:50:18 +00:00
2024-03-29 14:48:38 -07:00
2024-03-29 12:42:55 -07:00
2024-03-19 11:38:27 -07:00
2024-03-11 09:53:22 +00:00
2024-02-09 14:12:01 -08:00
2024-03-11 09:53:22 +00:00
2024-01-30 13:49:09 +01:00
2024-03-25 15:23:07 +01:00
2024-03-06 21:01:26 +01:00
2024-02-29 14:24:56 -08:00
2024-03-14 18:03:09 -07:00
2024-04-01 20:43:24 -07:00
2023-11-18 15:00:51 +00:00
2024-03-28 03:54:01 +01:00
2024-02-28 19:37:34 -08:00
2024-03-11 15:48:34 -07:00
2024-03-07 10:36:58 +01:00
2024-03-22 09:41:39 +00:00
2024-02-09 12:54:38 -08:00
2024-03-18 12:29:53 +00:00
2024-02-22 09:05:50 +01:00
2023-12-29 08:43:59 +00:00
2024-01-01 18:41:29 +00:00
2024-03-29 12:04:09 -07:00
2023-12-21 22:17:23 +01:00
2023-12-15 11:59:53 +00:00
2024-03-14 13:09:53 +01:00
2024-03-19 15:33:25 +01:00
2024-03-07 21:12:43 -08:00
2024-03-05 15:49:35 +01:00
2024-03-16 11:44:00 -07:00
2024-02-16 09:36:37 +00:00
2024-02-15 13:18:19 +01:00
2024-03-26 20:48:24 -07:00
2024-02-22 15:29:26 -08:00
2024-01-23 15:13:54 +01:00
2024-03-25 15:23:06 +01:00
2024-03-11 09:53:22 +00:00
2024-03-02 20:50:59 -08:00
2024-03-18 11:56:11 +01:00
2023-12-12 14:24:14 +01:00
2024-02-18 10:19:21 +00:00
2024-01-31 16:41:16 -08:00
2024-03-14 16:48:53 -07:00