bianbu-linux-6.6/net/mptcp
Paolo Abeni ff825ab2f4 mptcp: cope racing subflow creation in mptcp_rcv_space_adjust
[ Upstream commit ce7356ae35943cc6494cc692e62d51a734062b7d ]

Additional active subflows - i.e. created by the in kernel path
manager - are included into the subflow list before starting the
3whs.

A racing recvmsg() spooling data received on an already established
subflow would unconditionally call tcp_cleanup_rbuf() on all the
current subflows, potentially hitting a divide by zero error on
the newly created ones.

Explicitly check that the subflow is in a suitable state before
invoking tcp_cleanup_rbuf().

Fixes: c76c695656 ("mptcp: call tcp_cleanup_rbuf on subflows")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/02374660836e1b52afc91966b7535c8c5f7bafb0.1731060874.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-22 15:38:31 +01:00
..
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
crypto_test.c mptcp: move crypto test to KUNIT 2020-06-26 16:21:39 -07:00
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 kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
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: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:46:25 +02:00
pm_userspace.c mptcp: use sock_kfree_s instead of kfree 2024-11-14 13:19:38 +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 mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
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