Merge branch 'mptcp-pm-defer-freeing-userspace-pm-entries'

Matthieu Baerts says:

====================
mptcp: pm: Defer freeing userspace pm entries

Here are two unrelated fixes for MPTCP:

- Patch 1: free userspace PM entry with RCU helpers. A fix for v6.14.

- Patch 2: avoid a warning when running diag.sh selftest. A fix for
  v6.15-rc1.
====================

Link: https://patch.msgid.link/20250421-net-mptcp-pm-defer-freeing-v1-0-e731dc6e86b9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski
2025-04-23 16:28:06 -07:00
2 changed files with 7 additions and 4 deletions

View File

@@ -337,7 +337,11 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
release_sock(sk);
sock_kfree_s(sk, match, sizeof(*match));
kfree_rcu_mightsleep(match);
/* Adjust sk_omem_alloc like sock_kfree_s() does, to match
* with allocation of this memory by sock_kmemdup()
*/
atomic_sub(sizeof(*match), &sk->sk_omem_alloc);
err = 0;
out:

View File

@@ -206,9 +206,8 @@ chk_dump_one()
local token
local msg
ss_token="$(ss -inmHMN $ns | grep 'token:' |\
head -n 1 |\
sed 's/.*token:\([0-9a-f]*\).*/\1/')"
ss_token="$(ss -inmHMN $ns |
mptcp_lib_get_info_value "token" "token")"
token="$(ip netns exec $ns ./mptcp_diag -t $ss_token |\
awk -F':[ \t]+' '/^token/ {print $2}')"