linux-stable/net/mptcp
Paolo Abeni 0a9a182ea5 mptcp: cope racing subflow creation in mptcp_rcv_space_adjust
commit ce7356ae35 upstream.

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>
[ Conflicts in protocol.c, because commit f410cbea9f ("tcp: annotate
  data-races around tp->window_clamp") has not been backported to this
  version. The conflict is easy to resolve, because only the context is
  different, but not the line to modify. ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:50:38 +01:00
..
crypto_test.c mptcp: move crypto test to KUNIT 2020-06-26 16:21:39 -07:00
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
ctrl.c mptcp: faster active backup recovery 2021-08-14 11:37:25 +01:00
diag.c mptcp: correct MPTCP_SUBFLOW_ATTR_SSN_OFFSET reserved size 2024-09-04 13:23:19 +02:00
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
mib.c mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:40:47 +02:00
mib.h mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:40:47 +02:00
mptcp_diag.c net: inet: Retire port only listening_hash 2023-11-28 16:56:22 +00:00
options.c mptcp: pr_debug: add missing \n at the end 2024-09-12 11:07:45 +02:00
pm_netlink.c mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:40:47 +02:00
pm.c mptcp: pr_debug: add missing \n at the end 2024-09-12 11:07:45 +02:00
protocol.c mptcp: cope racing subflow creation in mptcp_rcv_space_adjust 2024-12-14 19:50:38 +01:00
protocol.h mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:40:47 +02:00
sockopt.c mptcp: pr_debug: add missing \n at the end 2024-09-12 11:07:45 +02:00
subflow.c mptcp: prevent MPC handshake on port-based signal endpoints 2024-10-22 15:40:47 +02:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token_test.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00