From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56]) (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 7D4EA3101B0 for ; Thu, 28 May 2026 20:21:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.160.73.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999703; cv=none; b=MOSwBzxsFscviuYzabdvE+pYNp3GjPqa3tP5LYr61PrUou07MT1/qZ4KgX+0eFo8BBm4IbBl9vsl/enhbzcA1dGrGKYYW72i6JMLyhI5XQcwx8bcvp9KiGmYnwpDjr5HQCIvVfBe0wUFwk5TVqu/Gg7gkq0Ft7f0qx0SV91I0KU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999703; c=relaxed/simple; bh=PjPpx/ADezrs9ZSqZcxiSc/iaIXYfrygE2MNvlVdBSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g7BhrBRNy4xQu7o+qfyD4N0RBokmXuLxypNQ7sJtiEXc1/wwAxEWz9P/PMHkFCmo912rNjY8JtHGVzRRme9eWVy8e6eiOomZoRWqpXkGpBIPz4Q83n3/s4ZfnPlg7PcLAqYjy2+X3FJBwlKjYZC1FV1TSK++GAs0DbzoUxHuxuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org; spf=pass smtp.mailfrom=narfation.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b=olvHVFYD; arc=none smtp.client-ip=213.160.73.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=narfation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="olvHVFYD" Received: by dvalin.narfation.org (Postfix) id 89B231FE5D; Thu, 28 May 2026 20:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1779999700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qhbgXyq7XNLh0gTPq6SUFs02TK9v74UELx5dX57oqR4=; b=olvHVFYD6+9bcgtvWz2x3E1JvGh9ANYlY8VYrCXksiv0nlNr+j7BZmH94xo/WLaoKcRGHr IuLW+nHk4HwOHQJVfjepwElwiNuLLWu0LvvFtccNQtDkbYZAsvK4yeYX7eaDUU564dcQR8 dSbfYqR8HwdiqPoXNpn+b8zf4Mcz658= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann , stable@kernel.org Subject: [PATCH 6.12.y] batman-adv: tp_meter: directly shut down timer on cleanup Date: Thu, 28 May 2026 22:21:35 +0200 Message-ID: <20260528202135.443823-1-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <2026052840-reviver-sage-4805@gregkh> References: <2026052840-reviver-sage-4805@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 87797969c220..bdafdec93a18 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -400,13 +400,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.47.3