Commit 7237d23d authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
parents ee924152 53e55336
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ definitions:
    type: enum
    name: event-type
    enum-name: mptcp-event-type
    doc: Netlink MPTCP event types
    name-prefix: mptcp-event-
    entries:
      -
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#define MPTCP_PM_VER	1

/**
 * enum mptcp_event_type
 * enum mptcp_event_type - Netlink MPTCP event types
 * @MPTCP_EVENT_UNSPEC: unused event
 * @MPTCP_EVENT_CREATED: A new MPTCP connection has been created. It is the
 *   good time to allocate memory and send ADD_ADDR if needed. Depending on the
+12 −17
Original line number Diff line number Diff line
@@ -1044,26 +1044,23 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info)
	return ret;
}

static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
static void mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
				      const struct mptcp_addr_info *addr,
				      bool force)
{
	struct mptcp_rm_list list = { .nr = 0 };
	bool ret;
	bool announced;

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

	ret = mptcp_remove_anno_list_by_saddr(msk, addr);
	if (ret || force) {
	announced = mptcp_remove_anno_list_by_saddr(msk, addr);
	if (announced || force) {
		spin_lock_bh(&msk->pm.lock);
		if (ret) {
			__set_bit(addr->id, msk->pm.id_avail_bitmap);
		if (announced)
			msk->pm.add_addr_signaled--;
		}
		mptcp_pm_remove_addr(msk, &list);
		spin_unlock_bh(&msk->pm.lock);
	}
	return ret;
}

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,
					  !(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT));

		list.ids[0] = mptcp_endp_get_local_id(msk, addr);
		if (remove_subflow) {
			spin_lock_bh(&msk->pm.lock);
			mptcp_pm_rm_subflow(msk, &list);
			spin_unlock_bh(&msk->pm.lock);
		}

		if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) {
		spin_lock_bh(&msk->pm.lock);
		if (remove_subflow)
			mptcp_pm_rm_subflow(msk, &list);
		if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW)
			__mark_subflow_endp_available(msk, list.ids[0]);
		else /* mark endp ID as available, e.g. Signal or MPC endp */
			__set_bit(addr->id, msk->pm.id_avail_bitmap);
		spin_unlock_bh(&msk->pm.lock);
		}

		if (msk->mpc_endpoint_id == entry->addr.id)
			msk->mpc_endpoint_id = 0;
+9 −7
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static void mptcp_crypto_key_gen_sha(u64 *key, u32 *token, u64 *idsn)
 * It creates a unique token to identify the new mptcp connection,
 * a secret local key and the initial data sequence number (idsn).
 *
 * Returns 0 on success.
 * Return: 0 on success.
 */
int mptcp_token_new_request(struct request_sock *req)
{
@@ -146,7 +146,7 @@ int mptcp_token_new_request(struct request_sock *req)
 * the computed token at a later time, this is needed to process
 * join requests.
 *
 * returns 0 on success.
 * Return: 0 on success.
 */
int mptcp_token_new_connect(struct sock *ssk)
{
@@ -241,7 +241,7 @@ bool mptcp_token_exists(u32 token)
 * This function returns the mptcp connection structure with the given token.
 * A reference count on the mptcp socket returned is taken.
 *
 * returns NULL if no connection with the given token value exists.
 * Return: NULL if no connection with the given token value exists.
 */
struct mptcp_sock *mptcp_token_get_sock(struct net *net, u32 token)
{
@@ -288,11 +288,13 @@ EXPORT_SYMBOL_GPL(mptcp_token_get_sock);
 * @s_slot: start slot number
 * @s_num: start number inside the given lock
 *
 * This function returns the first mptcp connection structure found inside the
 * token container starting from the specified position, or NULL.
 * Description:
 *   On successful iteration, the iterator is moved to the next position and a
 *   reference to the returned socket is acquired.
 *
 * On successful iteration, the iterator is moved to the next position and
 * a reference to the returned socket is acquired.
 * Return:
 *   The first mptcp connection structure found inside the token container
 *   starting from the specified position, or NULL.
 */
struct mptcp_sock *mptcp_token_iter_next(const struct net *net, long *s_slot,
					 long *s_num)
+1 −1
Original line number Diff line number Diff line
@@ -1296,8 +1296,8 @@ void xdisconnect(int fd)

int main_loop(void)
{
	struct addrinfo *peer = NULL;
	int fd = 0, ret, fd_in = 0;
	struct addrinfo *peer;
	struct wstate winfo;

	if (cfg_input && cfg_sockopt_types.mptfo) {