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 7505531F991 for ; Fri, 15 May 2026 08:45:23 +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=1778834723; cv=none; b=S8wgKLvxOBeubnldpRfOXC47NuL3qdw8Z5rYDpJvaNPlH03Cr1MEUWQSDSPTpOMrqe0ZYCpS7nQkheVk4yv8z6zh1goDtYKOmR4c3tUSRcYZZdCFdx5H5fKdpH+9yPQbxxpLxiAp+6bH+XvhZiEg6raJvQ9yM/qbLQ7BtZUqiU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778834723; c=relaxed/simple; bh=0xf9FW0u1hwgFfmxX+962AuIiyh4TnmOjP25s8O4oTE=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=utsUx3NfgkrGOCpBMj5ZVJ47JfR2J9eoaoxsAyGiLDWu4jDnhegCBbleRQSEszrlFzKUHxB48AUyWz0XjjMLuxf6rTRo+qqgUDNJJF4oxvAixhxTpziM2y5KUrCkVkA51C5tHBbozBvTNfzlrDl2oZywPchSpYLkRzHo13e5ovQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xhN6EEPP; 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="xhN6EEPP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90652C2BCB0; Fri, 15 May 2026 08:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778834723; bh=0xf9FW0u1hwgFfmxX+962AuIiyh4TnmOjP25s8O4oTE=; h=Subject:To:Cc:From:Date:From; b=xhN6EEPPR45mP4ZPiZ/bMNARPAQ20tryaNm79tLAgG+S78QZymDPxuii8mkeySdJW OLRrS6Ly1JOgv6QDdsVfRIr996xKA6Het9wN3/h1xfRLZNHoqOnP4sfzTav6snwGKf 3YZZymXfF/zHKTjLfsppirHAln5mUwqII+zGc1b8= Subject: FAILED: patch "[PATCH] batman-adv: tp_meter: fix tp_num leak on kmalloc failure" failed to apply to 6.12-stable tree To: sven@narfation.org Cc: From: Date: Fri, 15 May 2026 10:45:19 +0200 Message-ID: <2026051519-pound-zippy-6d5f@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x ce425dd05d0fe7594930a0fb103634f35ac47bb6 # git commit -s git send-email --to '' --in-reply-to '2026051519-pound-zippy-6d5f@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ce425dd05d0fe7594930a0fb103634f35ac47bb6 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 6 May 2026 22:20:49 +0200 Subject: [PATCH] batman-adv: tp_meter: fix tp_num leak on kmalloc failure When batadv_tp_start() or batadv_tp_init_recv() fail to allocate a new tp_vars object, the previously incremented bat_priv->tp_num counter is never decremented. This causes tp_num to drift upward on each allocation failure. Since only BATADV_TP_MAX_NUM sessions can be started and the count is never reduced for these failed allocations, it causes to an exhaustion of throughput meter sessions. In worst case, no new throughput meter session can be started until the mesh interface is removed. The error handling must decrement tp_num releasing the lock and aborting the creation of an throughput meter session Cc: stable@kernel.org Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 58ca59a2799e..066c76113fc4 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -994,6 +994,7 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, tp_vars = kmalloc_obj(*tp_vars, GFP_ATOMIC); if (!tp_vars) { + atomic_dec(&bat_priv->tp_num); spin_unlock_bh(&bat_priv->tp_list_lock); batadv_dbg(BATADV_DBG_TP_METER, bat_priv, "Meter: %s cannot allocate list elements\n", @@ -1366,8 +1367,10 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv, } tp_vars = kmalloc_obj(*tp_vars, GFP_ATOMIC); - if (!tp_vars) + if (!tp_vars) { + atomic_dec(&bat_priv->tp_num); goto out_unlock; + } ether_addr_copy(tp_vars->other_end, icmp->orig); tp_vars->role = BATADV_TP_RECEIVER;