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 762482F745E; Tue, 16 Jun 2026 16:44:03 +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=1781628244; cv=none; b=pAJqcdwGS4GKtG0D6r1cpRqLO70ng3r65Eqk51GC3YNug8mfF7vJEnWJ/t2NMhV1Fb6YS62nMHsYN1M6qWTwsp+eXl2Hl8uOeu2yzZIBm4nxSV5B35GJH+COT0G3bYKnO+YCclyMt/DNxvns+Jk9Yvf/ftPl3WS20TSFaUKcbj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781628244; c=relaxed/simple; bh=+h2egc+2q+vi9wtyXGeCM6XCktp8D3OpkWWdw0QYfLc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BeN2/ojkd/UiEhk5cMnsAdiVCLn1YtJqsubXslIKXDO5o08ewmPeOEcyH17doV+jXTeAUXpjrW0Ls157mY8BasN7eLHjWYwN8YkPsaa+Ka8lvTHJ+3cwXasaculxpgxBhW5bheCEp+uzsXK9fJjrjXmwms83zenS8i9LXTdDx1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lSb/3J6L; 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="lSb/3J6L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 377411F000E9; Tue, 16 Jun 2026 16:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781628243; bh=Xa6LOstle3dNokgMGwAEErAkTvu6gcg3Ytj8ZD/2H7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lSb/3J6LgCMrPYqLmSuSJLWmFpIyS4dZ0N7JA9IOtQ7cBxkBJRw+FaaFtetuqtuH3 w5b4Fsp8lCBWf4a6iQt1T3L5Wy16x7vRHkBqIJieJgdC4wfP/j8oO+0oGAxgFjd2nF 9WqhoQxk4WeQon4kh2ZRaqnpScw+gbu9/289XKWE= 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.6 058/452] batman-adv: tp_meter: directly shut down timer on cleanup Date: Tue, 16 Jun 2026 20:24:45 +0530 Message-ID: <20260616145121.015506984@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145117.796205997@linuxfoundation.org> References: <20260616145117.796205997@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.6-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