From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 546753FD94F; Fri, 15 May 2026 16:22:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778862178; cv=none; b=nSnF1jFBLwtzNj7qUU+Kqza3njM3CZXRY3ojrj9j3hNNaOgA1hrSDR5nwo4UZHV0OEXvmq97jYdgGaJ/HEvkm/4Tb0yajaKPq8nNkJaek1Vr+68n76qwNWyfsvYAjFgrvFEm26I0a2LIFEvqgpwp/RoeLrMIcW2IcNbXDFUdU/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778862178; c=relaxed/simple; bh=dFDaohPD85a3DfsYS/KhKOawT5jfE5PS7LkV2lxznUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g/F6MbYzAEVHGWqU7Vy5q3rG738DcN6Cjuw0uhoaRTnU4aVGTv2qX3OqXjfS9/yOqtupR21XpmnIgZV60bjU7H+owOE4Y8U1kAy5Hxdc7k9TqNrmBj7IcrrTj/i/ZRE8Y9fwBVIeY8EwvTCmc1oB5h9yg5ye3+9xPmqbXSWQj/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=V1YBUhUr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="V1YBUhUr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D85CFC2BCB0; Fri, 15 May 2026 16:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778862178; bh=dFDaohPD85a3DfsYS/KhKOawT5jfE5PS7LkV2lxznUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V1YBUhUr0mohPzw2mwFPxKpLoU3nUcS1Ad8MpGLWzrzG7+Fz/ekahYPHmeEXOeo+S EJ5ExFZVazsFce1Gep/Zvh9ImcuXKexlscZJlNZE2peM856tMkQHGIUnhB8XrPif5o //81ZnEVqDm8+SpZLLCI8VkkPquGHaAiWThbogMo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Yuan Tan , Yifan Wu , Juefei Pu , Xin Liu , Luxing Yin , Jiexun Wang , Ren Wei , Sven Eckelmann Subject: [PATCH 6.18 137/188] batman-adv: reject new tp_meter sessions during teardown Date: Fri, 15 May 2026 17:49:14 +0200 Message-ID: <20260515154700.300185205@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154657.309489048@linuxfoundation.org> References: <20260515154657.309489048@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiexun Wang commit 3243543592425beec83d453793e9d27caa0d8e66 upstream. Prevent tp_meter from starting new sender or receiver sessions after mesh_state has left BATADV_MESH_ACTIVE. Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation") Cc: stable@kernel.org Reported-by: Yuan Tan Reported-by: Yifan Wu Reported-by: Juefei Pu Reported-by: Xin Liu Co-developed-by: Luxing Yin Signed-off-by: Luxing Yin Signed-off-by: Jiexun Wang Signed-off-by: Ren Wei Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/tp_meter.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -947,6 +947,13 @@ void batadv_tp_start(struct batadv_priv /* look for an already existing test towards this node */ spin_lock_bh(&bat_priv->tp_list_lock); + if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) { + spin_unlock_bh(&bat_priv->tp_list_lock); + batadv_tp_batctl_error_notify(BATADV_TP_REASON_DST_UNREACHABLE, + dst, bat_priv, session_cookie); + return; + } + tp_vars = batadv_tp_list_find(bat_priv, dst); if (tp_vars) { spin_unlock_bh(&bat_priv->tp_list_lock); @@ -1329,9 +1336,12 @@ static struct batadv_tp_vars * batadv_tp_init_recv(struct batadv_priv *bat_priv, const struct batadv_icmp_tp_packet *icmp) { - struct batadv_tp_vars *tp_vars; + struct batadv_tp_vars *tp_vars = NULL; spin_lock_bh(&bat_priv->tp_list_lock); + if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) + goto out_unlock; + tp_vars = batadv_tp_list_find_session(bat_priv, icmp->orig, icmp->session); if (tp_vars) @@ -1464,6 +1474,9 @@ void batadv_tp_meter_recv(struct batadv_ { struct batadv_icmp_tp_packet *icmp; + if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) + goto out; + icmp = (struct batadv_icmp_tp_packet *)skb->data; switch (icmp->subtype) { @@ -1478,6 +1491,8 @@ void batadv_tp_meter_recv(struct batadv_ "Received unknown TP Metric packet type %u\n", icmp->subtype); } + +out: consume_skb(skb); }