Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: stable@vger.kernel.org
Cc: Sven Eckelmann <sven@narfation.org>
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	[thread overview]
Message-ID: <20260626160952.123713-2-sven@narfation.org> (raw)
In-Reply-To: <20260626160952.123713-1-sven@narfation.org>

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 <sven@narfation.org>
---
 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


  reply	other threads:[~2026-06-26 16:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 16:09 [PATCH 5.10 00/23] batman-adv: 7.2 merge window fixes backports Sven Eckelmann
2026-06-26 16:09 ` Sven Eckelmann [this message]
2026-06-26 16:09 ` [PATCH 5.10 02/23] batman-adv: tp_meter: initialize dup_acks explicitly Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 03/23] batman-adv: tp_meter: initialize dec_cwnd explicitly Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 04/23] batman-adv: tp_meter: avoid window underflow Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 05/23] batman-adv: tp_meter: avoid divide-by-zero for dec_cwnd Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 06/23] batman-adv: tp_meter: fix fast recovery precondition Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 07/23] batman-adv: tp_meter: handle seqno wrap-around for fast recovery detection Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 08/23] batman-adv: tp_meter: add only finished tp_vars to lists Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 09/23] batman-adv: bla: annotate lasttime access with READ/WRITE_ONCE Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 10/23] batman-adv: prevent ELP transmission interval underflow Sven Eckelmann
2026-06-27 11:26   ` Sasha Levin
2026-06-27 12:05     ` Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 11/23] batman-adv: tp_meter: initialize last_recv_time during init Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 12/23] batman-adv: frag: ensure fragment is writable before modifying TTL Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 13/23] batman-adv: frag: avoid underflow of TTL Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 14/23] batman-adv: v: prevent OGM aggregation on disabled hardif Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 15/23] batman-adv: tp_meter: restrict number of unacked list entries Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 16/23] batman-adv: tp_meter: annotate last_recv_time access with READ/WRITE_ONCE Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 17/23] batman-adv: tp_meter: prevent parallel modifications of last_recv Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 18/23] batman-adv: tp_meter: handle overlapping packets Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 19/23] batman-adv: tt: don't merge change entries with different VIDs Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 20/23] batman-adv: tt: track roam count per VID Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 21/23] batman-adv: dat: prevent false sharing between VLANs Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 22/23] batman-adv: tvlv: enforce 2-byte alignment Sven Eckelmann
2026-06-26 16:09 ` [PATCH 5.10 23/23] batman-adv: tvlv: avoid race of cifsnotfound handler state Sven Eckelmann
2026-06-28  3:33 ` [PATCH 5.10 00/23] batman-adv: 7.2 merge window fixes backports Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260626160952.123713-2-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox