From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 956F31C5F27; Sun, 7 Jun 2026 10:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828026; cv=none; b=Umh2lIh1Tmh2HW6gh54rZvY5/ewY3/zeoidZhsf8lcsd8B5KQoUxcFTUexkQndT1+6WZDV39sacQtoYrdS/yqiCZglG7ljUh1BhKRAyHsaMuxEkXOYNcCbK/5ZpJynBEo/jR5/ym2cdp0C6K3bH8hvTorITxkFtZtqqa/KWX1Qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828026; c=relaxed/simple; bh=ZXFg8jhNJNWbaiAFcNOrEl1yha+vwTXouN7uOUvZQG0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s5GlAmBnwyOxZVoeSXVk2wi20bFo0034EKb7e/8kYlJCCtMG09vgHxuFkciTEdDm4HBYgLn3P9ziXm/LC8ADlCGgSjqr1cngETS8pjQMzvFynsHOa2Nff37tkPsgN+L8FH6wWXx1fhd5qVUbQ7gsKH2UNFPzvnyK4wJd98WqwuM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lNPyofFK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lNPyofFK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70D6B1F00893; Sun, 7 Jun 2026 10:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780828025; bh=DOjo0mmFyXAf5YOOezYMpq5veyS63fOtc8U2UwNcD+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lNPyofFKaXaUcGJJW+InJzJCeR9+P1F5J384cQvAmNsJF7S29hTMAeHykmY3GIIkH dgJQ4uKRPAQQ71s6qWq90LuAcV87tMRmD4q32wWSm7QvpzOUI3SicTjjtQiKAgtobu N5C3Z7y/0wShJMMKBOd71IruDxyizxwhqo+F7b48= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Sven Eckelmann , Sasha Levin Subject: [PATCH 6.12 105/307] batman-adv: tp_meter: directly shut down timer on cleanup Date: Sun, 7 Jun 2026 11:58:22 +0200 Message-ID: <20260607095731.642354514@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.647295505@linuxfoundation.org> References: <20260607095727.647295505@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann commit d5487249a81ea658717614009c8f46acc5b7101a upstream. batadv_tp_sender_cleanup() was calling timer_delete_sync() followed by timer_delete() to guard against the timer handler re-arming itself between the two calls. This double-deletion hack relied on the sending status being set to 0 to suppress re-arming. Replace both calls with a single timer_shutdown_sync(). This function both waits for any running timer callback to complete (like timer_delete_sync()) and permanently disarms the timer so it cannot be re-armed afterwards, making re-arming prevention unconditional and self-documenting. The re-arming property is also required because otherwise: 1. context 0 (batadv_tp_recv_ack()) checks in batadv_tp_reset_sender_timer() if sending is still 1 -> it is 2. context 1 changes in batadv_tp_sender_shutdown() sending to 0 and in this process forces the kthread to stop timer in batadv_tp_sender_cleanup() 3. context 0 continues in batadv_tp_reset_sender_timer() and rearms the timer -> but the reference for it is already gone Cc: stable@kernel.org Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation") [ adapt pre-hunk to old del_timer* names ] Signed-off-by: Sven Eckelmann Signed-off-by: Sasha Levin --- net/batman-adv/tp_meter.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index bc3dc377f0bfd0..dfc3374549921f 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -430,13 +430,7 @@ static void batadv_tp_sender_cleanup(struct batadv_tp_vars *tp_vars) batadv_tp_list_detach(tp_vars); /* kill the timer and remove its reference */ - del_timer_sync(&tp_vars->timer); - /* the worker might have rearmed itself therefore we kill it again. Note - * that if the worker should run again before invoking the following - * del_timer(), it would not re-arm itself once again because the status - * is OFF now - */ - del_timer(&tp_vars->timer); + timer_shutdown_sync(&tp_vars->timer); batadv_tp_vars_put(tp_vars); } -- 2.53.0