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 E2EA33B2FD1; Thu, 2 Jul 2026 16:27:11 +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=1783009634; cv=none; b=aiTDR45qaZZlAMiy+GwlFogKEtUX78cguL4CRQgjg4VerxZSVGEMrA98W+dnsdNKA0BOUULmwBgOE7+5NvmH8BIxVr81DpdqxqgkmzT2SEFfQfeb2BOYpZowHoaHJQ46kjOihLSTie+uMpwWOolIm6zil9L1cbf1SNg7VtxMUvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783009634; c=relaxed/simple; bh=6RDFgDze8ADc8Gy3CP5frlN1plLjZPxEyvkbGRMcB7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lOv1AZT4ADT1SEqIIVMLam4N5yv3dL9c5PMXSZG9VAby9j+GHx/XL/WBbhjYPAdne6+D0N6mVi73m3HEMykpLJmo54KqiFNGjEso8gvLVATWJdqrq5Tc3a31yGP4z61G1Z/sN5bClJW16Fw6avHkTICvP//GwTdXwxkEx33PoXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mqWP2BJF; 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="mqWP2BJF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 912801F000E9; Thu, 2 Jul 2026 16:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783009631; bh=F8VuIUigoXiG4MeOK23tRR5QOC1OklH+FHZEWx/Dfug=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mqWP2BJFeoYi/rcdJ8R6Cq6+aaKAhnGIFJZOKSt5NvkzgthGxIbqDkthefBamUv6y NnVcPhOM2Rwa5599yrfpuZkACEJxXai18eUooZwTdW+mRN1e/F/ImaCBoL2J7Ar/Tp HWEgObQttntOiKzYZDvFHOcsHP7Uhp8Yn7Zar4MI= 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 5.15 28/95] batman-adv: tp_meter: keep unacked list in ascending ordered Date: Thu, 2 Jul 2026 18:19:31 +0200 Message-ID: <20260702155109.799977782@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155109.196223802@linuxfoundation.org> References: <20260702155109.196223802@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann 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 Signed-off-by: Sasha Levin --- 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 c7b48d51e2aed2..e8792e1e4eedfa 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1325,7 +1325,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.53.0