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 E03043F99FE for ; Fri, 26 Jun 2026 16:10:02 +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=1782490207; cv=none; b=pJvYj83G6wwG3Efs7kQAu/fagIB/MNcg7wv8WB2qLU/ktA7Qv4iGdP/M4pJAZmE+W8CtGFPhBBICUgQNO+Lx9TuGXu3m4reu4BUftkoeMi3CAd1hSpQReje0WH8NHcuR2OJzZAF30KnYgSSbs+3mmQA8wWmXiNsTnCAMM2TTURI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490207; c=relaxed/simple; bh=85kc4uIjGS2lwWwl/pbjzk85tHUpPYztN5vqyrm2fiI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YBh60CQQ1VMez6Tutgw/GW1iXAxJyUgE7LdFqhOt+3xYXLs+hbQvUYe5TAQbx96YXXYG2TkklX1nzf2kuNji8ynGF/GHXtu1xA5q3Fd1udXYQDOcrJ58gNlakI6bVqeWYyjrrBds2Fh1Z09Px9Q2t5KWof1C6zNWRYugON8DcPk= 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=B+d3G2TE; 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="B+d3G2TE" Received: by dvalin.narfation.org (Postfix) id 8C750203E0; Fri, 26 Jun 2026 16:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1782490194; 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=Ug0LOkWYbn862UpsUTGttCYv2C1uuqHsfP8Jg/hoPs4=; b=B+d3G2TEyzrpGfQBkpvt6PvI71Eb+/tYJ8COIoDXcwGBSBpxFwnmXe+qLvLLO+qcOddWfk wvRBPMM6auXES+KAvfo7ya8eVIhbN188b1FtPiiV8aK2tJrf38jdAEw1LeiHBLn3REpaiZ CyeKei6ff4+OXh/5k1wcRcSgfIsOyzo= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann Subject: [PATCH 5.10 01/23] batman-adv: tp_meter: keep unacked list in ascending ordered Date: Fri, 26 Jun 2026 18:09:30 +0200 Message-ID: <20260626160952.123713-2-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260626160952.123713-1-sven@narfation.org> References: <20260626160952.123713-1-sven@narfation.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit commit 5aa8651527ea0b610e7a09fb3b8204c1398b9525 upstream. When batadv_tp_handle_out_of_order inserts a new entry in the list of unacked (out of order) packets, it searches from the entry with the newest sequence number towards oldest sequence number. If an entry is found which is older than the newly entry, the new entry has to be added after the found one to keep the ascending order. But for this operation list_add_tail() was used. But this function adds an entry _before_ another one. As result, the list would contain a lot of swapped sequence numbers. The consumer of this list (batadv_tp_ack_unordered()) would then fail to correctly ack packets. Cc: stable@kernel.org Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann --- net/batman-adv/tp_meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index fc2f0b49e5a06..c837a91879ac2 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1334,7 +1334,7 @@ static bool batadv_tp_handle_out_of_order(struct batadv_tp_vars *tp_vars, * one is attached _after_ it. In this way the list is kept in * ascending order */ - list_add_tail(&new->list, &un->list); + list_add(&new->list, &un->list); added = true; break; } -- 2.47.3