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 C819D3F5BF9 for ; Fri, 26 Jun 2026 16:11:56 +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=1782490318; cv=none; b=b/SXfs80pKXCdCdXdD5WB/jr0DGL6yVXvlzmhxz67qw/l7FoaQ3M3beImA8CCJ0AxNRT3vTWhRbANxGYnMtJOrq3CM/SnpA20XAVg2mpWVYuN0vOgkBWlm+tBOAk+v+CBaIUPDLODCumx/6kCGT82zwAmXtkxCInRrcKD45M65k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490318; c=relaxed/simple; bh=L2M+9OPbU/T9vf1ell0xk7AD592h/Cnb1paszlAnt5g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iV/zqb72CghgaFqoRqNH0tqQ1CgzX6xVA/0OZKqt2IFfWg4hWy5yKyXHrJ9Rjn8uknRdjzxParI9e4hiwHm6QkGy6IR96BFMdBNmN+CApd6Sple1cKPlxpESsujujTusb9adqWt+cw474c6tkUGh7nRgLbAhGeTLhc7c6xakXWA= 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=jD4QUUOC; 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="jD4QUUOC" Received: by dvalin.narfation.org (Postfix) id 81645202D1; Fri, 26 Jun 2026 16:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1782490315; 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=rcA6d/miF5KKfaiKm0bT1TQf28+wZAx+1YCRhSDJTa0=; b=jD4QUUOC03jA/5FQqNUeV7fCmVZ7rOqQU96R14szkgFL4nsnvHUPezCQIeKSSqLCOC23Lp 05j6ry45cslkDJN67j7un+OUssgSKIQdX+u3nxQ33xT51SPYb4yOWSBrh1eTBwOgfXw3jJ n9buYj7ZMwpGDYu9DB14phPEUKvYtJg= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann Subject: [PATCH 6.12 01/25] batman-adv: tp_meter: keep unacked list in ascending ordered Date: Fri, 26 Jun 2026 18:11:30 +0200 Message-ID: <20260626161154.124562-2-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260626161154.124562-1-sven@narfation.org> References: <20260626161154.124562-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 dfc3374549921..f350a60e6c76b 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.47.3