Skip to content

Commit a133eae

Browse files
committed
Merge branch 'mptcp-misc-fixes-for-v6-7'
Matthieu Baerts says: ==================== mptcp: misc. fixes for v6.7 Here are a few fixes related to MPTCP: - Patch 1 limits GSO max size to ~64K when MPTCP is being used due to a spec limit. 'gso_max_size' can exceed the max value supported by MPTCP since v5.19. - Patch 2 fixes a possible NULL pointer dereference on close that can happen since v6.7-rc1. - Patch 3 avoids sending a RM_ADDR when the corresponding address is no longer tracked locally. A regression for a fix backported to v5.19. - Patch 4 adds a missing lock when changing the IP TOS with setsockopt(). A fix for v5.17. - Patch 5 fixes an expectation when running MPTCP Join selftest with the checksum option (-C). An issue present since v6.1. ==================== Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-0-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 278a370 + 7cefbe5 commit a133eae

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

net/mptcp/pm_netlink.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,8 +1515,9 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
15151515
struct mptcp_pm_addr_entry *entry;
15161516

15171517
list_for_each_entry(entry, rm_list, list) {
1518-
remove_anno_list_by_saddr(msk, &entry->addr);
1519-
if (alist.nr < MPTCP_RM_IDS_MAX)
1518+
if ((remove_anno_list_by_saddr(msk, &entry->addr) ||
1519+
lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) &&
1520+
alist.nr < MPTCP_RM_IDS_MAX)
15201521
alist.ids[alist.nr++] = entry->addr.id;
15211522
}
15221523

net/mptcp/protocol.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,8 @@ static void mptcp_update_infinite_map(struct mptcp_sock *msk,
12301230
mptcp_do_fallback(ssk);
12311231
}
12321232

1233+
#define MPTCP_MAX_GSO_SIZE (GSO_LEGACY_MAX_SIZE - (MAX_TCP_HEADER + 1))
1234+
12331235
static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
12341236
struct mptcp_data_frag *dfrag,
12351237
struct mptcp_sendmsg_info *info)
@@ -1256,6 +1258,8 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
12561258
return -EAGAIN;
12571259

12581260
/* compute send limit */
1261+
if (unlikely(ssk->sk_gso_max_size > MPTCP_MAX_GSO_SIZE))
1262+
ssk->sk_gso_max_size = MPTCP_MAX_GSO_SIZE;
12591263
info->mss_now = tcp_send_mss(ssk, &info->size_goal, info->flags);
12601264
copy = info->size_goal;
12611265

@@ -3398,10 +3402,11 @@ static void mptcp_release_cb(struct sock *sk)
33983402
if (__test_and_clear_bit(MPTCP_CLEAN_UNA, &msk->cb_flags))
33993403
__mptcp_clean_una_wakeup(sk);
34003404
if (unlikely(msk->cb_flags)) {
3401-
/* be sure to set the current sk state before tacking actions
3402-
* depending on sk_state, that is processing MPTCP_ERROR_REPORT
3405+
/* be sure to set the current sk state before taking actions
3406+
* depending on sk_state (MPTCP_ERROR_REPORT)
3407+
* On sk release avoid actions depending on the first subflow
34033408
*/
3404-
if (__test_and_clear_bit(MPTCP_CONNECTED, &msk->cb_flags))
3409+
if (__test_and_clear_bit(MPTCP_CONNECTED, &msk->cb_flags) && msk->first)
34053410
__mptcp_set_connected(sk);
34063411
if (__test_and_clear_bit(MPTCP_ERROR_REPORT, &msk->cb_flags))
34073412
__mptcp_error_report(sk);

net/mptcp/sockopt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,11 @@ static int mptcp_setsockopt_v4_set_tos(struct mptcp_sock *msk, int optname,
738738
val = READ_ONCE(inet_sk(sk)->tos);
739739
mptcp_for_each_subflow(msk, subflow) {
740740
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
741+
bool slow;
741742

743+
slow = lock_sock_fast(ssk);
742744
__ip_sock_set_tos(ssk, val);
745+
unlock_sock_fast(ssk, slow);
743746
}
744747
release_sock(sk);
745748

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3240,7 +3240,7 @@ fastclose_tests()
32403240
if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; then
32413241
test_linkfail=1024 fastclose=server \
32423242
run_tests $ns1 $ns2 10.0.1.1
3243-
chk_join_nr 0 0 0
3243+
chk_join_nr 0 0 0 0 0 0 1
32443244
chk_fclose_nr 1 1 invert
32453245
chk_rst_nr 1 1
32463246
fi

0 commit comments

Comments
 (0)