bianbu-linux-6.6/net/mptcp
Matthieu Baerts (NGI0) 3bc4569a72 mptcp: pm: use _rcu variant under rcu_read_lock
commit db3eab8110bc0520416101b6a5b52f44a43fb4cf upstream.

In mptcp_pm_create_subflow_or_signal_addr(), rcu_read_(un)lock() are
used as expected to iterate over the list of local addresses, but
list_for_each_entry() was used instead of list_for_each_entry_rcu() in
__lookup_addr(). It is important to use this variant which adds the
required READ_ONCE() (and diagnostic checks if enabled).

Because __lookup_addr() is also used in mptcp_pm_nl_set_flags() where it
is called under the pernet->lock and not rcu_read_lock(), an extra
condition is then passed to help the diagnostic checks making sure
either the associated spin lock or the RCU lock is held.

Fixes: 86e39e0448 ("mptcp: keep track of local endpoint still available for each msk")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20241112-net-mptcp-misc-6-12-pm-v1-3-b835580cefa8@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-22 15:38:36 +01:00
..
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto.c
crypto_test.c
ctrl.c mptcp: only allow set existing scheduler for net.mptcp.scheduler 2024-05-17 12:02:30 +02:00
diag.c mptcp: correct MPTCP_SUBFLOW_ATTR_SSN_OFFSET reserved size 2024-08-29 17:33:19 +02:00
fastopen.c mptcp: pr_debug: add missing \n at the end 2024-09-08 07:54:35 +02:00
Kconfig
Makefile mptcp: add struct mptcp_sched_ops 2023-08-22 17:31:18 -07:00
mib.c mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:46:25 +02:00
mib.h mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:46:25 +02:00
mptcp_diag.c tcp: Access &tcp_hashinfo via net. 2022-09-20 10:21:49 -07:00
options.c mptcp: pr_debug: add missing \n at the end 2024-09-08 07:54:35 +02:00
pm.c mptcp: pr_debug: add missing \n at the end 2024-09-08 07:54:35 +02:00
pm_netlink.c mptcp: pm: use _rcu variant under rcu_read_lock 2024-11-22 15:38:36 +01:00
pm_userspace.c mptcp: hold pm lock when deleting entry 2024-11-22 15:38:36 +01:00
protocol.c mptcp: cope racing subflow creation in mptcp_rcv_space_adjust 2024-11-22 15:38:31 +01:00
protocol.h mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:46:25 +02:00
sched.c mptcp: pr_debug: add missing \n at the end 2024-09-08 07:54:35 +02:00
sockopt.c mptcp: pr_debug: add missing \n at the end 2024-09-08 07:54:35 +02:00
subflow.c mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:46:25 +02:00
syncookies.c
token.c mptcp: add statistics for mptcp socket in use 2023-01-09 07:30:50 +00:00
token_test.c mptcp: init sk->sk_prot in build_msk() 2023-01-09 07:30:50 +00:00