kernel_samsung_a53x/net/mptcp
YonglongLi 702ae57a1e mptcp: pm: update add_addr counters after connect
commit 40eec1795cc27b076d49236649a29507c7ed8c2d upstream.

The creation of new subflows can fail for different reasons. If no
subflow have been created using the received ADD_ADDR, the related
counters should not be updated, otherwise they will never be decremented
for events related to this ID later on.

For the moment, the number of accepted ADD_ADDR is only decremented upon
the reception of a related RM_ADDR, and only if the remote address ID is
currently being used by at least one subflow. In other words, if no
subflow can be created with the received address, the counter will not
be decremented. In this case, it is then important not to increment
pm.add_addr_accepted counter, and not to modify pm.accept_addr bit.

Note that this patch does not modify the behaviour in case of failures
later on, e.g. if the MP Join is dropped or rejected.

The "remove invalid addresses" MP Join subtest has been modified to
validate this case. The broadcast IP address is added before the "valid"
address that will be used to successfully create a subflow, and the
limit is decreased by one: without this patch, it was not possible to
create the last subflow, because:

- the broadcast address would have been accepted even if it was not
  usable: the creation of a subflow to this address results in an error,

- the limit of 2 accepted ADD_ADDR would have then been reached.

Fixes: 01cacb00b35c ("mptcp: add netlink-based PM")
Cc: stable@vger.kernel.org
Co-developed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: YonglongLi <liyonglong@chinatelecom.cn>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-3-1ab9ddfa3d00@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Conflicts in pm_netlink.c because commit 1a0d6136c5f0 ("mptcp: local
  addresses fullmesh") is not present in this version (+ others changing
  the context). To resolve the conflicts, the same block is moved later,
  and under the condition that the call to __mptcp_subflow_connect()
  didn't fail.
  The selftest modification has been dropped, because the modified test
  is not in this version. That's fine, we can test with selftests from a
  newer version. ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 14:19:05 +01:00
..
crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ctrl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
diag.c mptcp: fix possible deadlock in subflow diag 2024-11-18 23:18:30 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mib.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mptcp_diag.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
options.c mptcp: fix uninit-value in mptcp_incoming_options 2024-11-18 12:12:12 +01:00
pm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pm_netlink.c mptcp: pm: update add_addr counters after connect 2024-11-19 14:19:05 +01:00
protocol.c mptcp: ensure snd_una is properly initialized on connect 2024-11-19 14:19:05 +01:00
protocol.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
subflow.c mptcp: don't account accept() of non-MPC client as fallback to TCP 2024-11-19 09:23:11 +01:00
syncookies.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
token.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
token_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00