Skip to content

Commit 7237d23

Browse files
committed
Merge branch 'mptcp-misc-fixes-for-v6-19-rc8'
Matthieu Baerts says: ==================== mptcp: misc fixes for v6.19-rc8 Here are various unrelated fixes: - Patch 1: when removing an MPTCP in-kernel PM endpoint, always mark the corresponding ID as "available". Syzbot found a corner case where it is not marked as such. A fix for up to v5.10. - Patch 2: Linked to the previous patch, the variable name was confusing and was probably partly responsible for the issue fixed by patch 1. No "Fixes" tag: no need to backport that for the moment, but better to avoid confusion now. - Patch 3: fix all existing kdoc warnings linked to MPTCP code. No "Fixes" tag: they were there for a while, and not considered as important to backport. - Patch 4: silence a compiler (false-positive) warning in the selftests. No "Fixes" tag: it is a false-positive warning, only seen with some versions. ==================== Link: https://patch.msgid.link/20260205-net-mptcp-misc-fixes-6-19-rc8-v2-0-c2720ce75c34@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents ee92415 + 53e5533 commit 7237d23

5 files changed

Lines changed: 24 additions & 26 deletions

File tree

Documentation/netlink/specs/mptcp_pm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ definitions:
1515
type: enum
1616
name: event-type
1717
enum-name: mptcp-event-type
18+
doc: Netlink MPTCP event types
1819
name-prefix: mptcp-event-
1920
entries:
2021
-

include/uapi/linux/mptcp_pm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define MPTCP_PM_VER 1
1212

1313
/**
14-
* enum mptcp_event_type
14+
* enum mptcp_event_type - Netlink MPTCP event types
1515
* @MPTCP_EVENT_UNSPEC: unused event
1616
* @MPTCP_EVENT_CREATED: A new MPTCP connection has been created. It is the
1717
* good time to allocate memory and send ADD_ADDR if needed. Depending on the

net/mptcp/pm_kernel.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,26 +1044,23 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info)
10441044
return ret;
10451045
}
10461046

1047-
static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
1047+
static void mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
10481048
const struct mptcp_addr_info *addr,
10491049
bool force)
10501050
{
10511051
struct mptcp_rm_list list = { .nr = 0 };
1052-
bool ret;
1052+
bool announced;
10531053

10541054
list.ids[list.nr++] = mptcp_endp_get_local_id(msk, addr);
10551055

1056-
ret = mptcp_remove_anno_list_by_saddr(msk, addr);
1057-
if (ret || force) {
1056+
announced = mptcp_remove_anno_list_by_saddr(msk, addr);
1057+
if (announced || force) {
10581058
spin_lock_bh(&msk->pm.lock);
1059-
if (ret) {
1060-
__set_bit(addr->id, msk->pm.id_avail_bitmap);
1059+
if (announced)
10611060
msk->pm.add_addr_signaled--;
1062-
}
10631061
mptcp_pm_remove_addr(msk, &list);
10641062
spin_unlock_bh(&msk->pm.lock);
10651063
}
1066-
return ret;
10671064
}
10681065

10691066
static void __mark_subflow_endp_available(struct mptcp_sock *msk, u8 id)
@@ -1097,17 +1094,15 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
10971094
!(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT));
10981095

10991096
list.ids[0] = mptcp_endp_get_local_id(msk, addr);
1100-
if (remove_subflow) {
1101-
spin_lock_bh(&msk->pm.lock);
1102-
mptcp_pm_rm_subflow(msk, &list);
1103-
spin_unlock_bh(&msk->pm.lock);
1104-
}
11051097

1106-
if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) {
1107-
spin_lock_bh(&msk->pm.lock);
1098+
spin_lock_bh(&msk->pm.lock);
1099+
if (remove_subflow)
1100+
mptcp_pm_rm_subflow(msk, &list);
1101+
if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW)
11081102
__mark_subflow_endp_available(msk, list.ids[0]);
1109-
spin_unlock_bh(&msk->pm.lock);
1110-
}
1103+
else /* mark endp ID as available, e.g. Signal or MPC endp */
1104+
__set_bit(addr->id, msk->pm.id_avail_bitmap);
1105+
spin_unlock_bh(&msk->pm.lock);
11111106

11121107
if (msk->mpc_endpoint_id == entry->addr.id)
11131108
msk->mpc_endpoint_id = 0;

net/mptcp/token.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void mptcp_crypto_key_gen_sha(u64 *key, u32 *token, u64 *idsn)
103103
* It creates a unique token to identify the new mptcp connection,
104104
* a secret local key and the initial data sequence number (idsn).
105105
*
106-
* Returns 0 on success.
106+
* Return: 0 on success.
107107
*/
108108
int mptcp_token_new_request(struct request_sock *req)
109109
{
@@ -146,7 +146,7 @@ int mptcp_token_new_request(struct request_sock *req)
146146
* the computed token at a later time, this is needed to process
147147
* join requests.
148148
*
149-
* returns 0 on success.
149+
* Return: 0 on success.
150150
*/
151151
int mptcp_token_new_connect(struct sock *ssk)
152152
{
@@ -241,7 +241,7 @@ bool mptcp_token_exists(u32 token)
241241
* This function returns the mptcp connection structure with the given token.
242242
* A reference count on the mptcp socket returned is taken.
243243
*
244-
* returns NULL if no connection with the given token value exists.
244+
* Return: NULL if no connection with the given token value exists.
245245
*/
246246
struct mptcp_sock *mptcp_token_get_sock(struct net *net, u32 token)
247247
{
@@ -288,11 +288,13 @@ EXPORT_SYMBOL_GPL(mptcp_token_get_sock);
288288
* @s_slot: start slot number
289289
* @s_num: start number inside the given lock
290290
*
291-
* This function returns the first mptcp connection structure found inside the
292-
* token container starting from the specified position, or NULL.
291+
* Description:
292+
* On successful iteration, the iterator is moved to the next position and a
293+
* reference to the returned socket is acquired.
293294
*
294-
* On successful iteration, the iterator is moved to the next position and
295-
* a reference to the returned socket is acquired.
295+
* Return:
296+
* The first mptcp connection structure found inside the token container
297+
* starting from the specified position, or NULL.
296298
*/
297299
struct mptcp_sock *mptcp_token_iter_next(const struct net *net, long *s_slot,
298300
long *s_num)

tools/testing/selftests/net/mptcp/mptcp_connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,8 +1296,8 @@ void xdisconnect(int fd)
12961296

12971297
int main_loop(void)
12981298
{
1299+
struct addrinfo *peer = NULL;
12991300
int fd = 0, ret, fd_in = 0;
1300-
struct addrinfo *peer;
13011301
struct wstate winfo;
13021302

13031303
if (cfg_input && cfg_sockopt_types.mptfo) {

0 commit comments

Comments
 (0)