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 5959337C90F for ; Fri, 26 Jun 2026 16:11:26 +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=1782490287; cv=none; b=JGCbLjqrtypXF0JhpmU3zCRhaiEK0Ote9WCeIg2a+JsmYt1M5XWTi8XDyoBlJuuSLkPfn01VnJsESN5NjGxnRi3AimonN/6ENh8xS8j9HxAT1geBC0HaO2nWW5PeWZi5RzrnjBm4hPi4GbKkWhCejof9RBxX5vCuQLDSdZmGNTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490287; c=relaxed/simple; bh=L2M+9OPbU/T9vf1ell0xk7AD592h/Cnb1paszlAnt5g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oK7TPgUUUFOnJxV4MKTNc/IhDlC1n/+yDGfuK8SuNoUjJ7ZPoOyyk5eeRJ4RTUAMQFvm1NBjydlcJzpRLi2u3hWHZwSnPqX/cSedDOL/zjf67bjmi9FAHcOUCTkI839ZhcjKGVAjKxrUvtgkX8LdkaieurpSLFS/bXpZc/HtKKE= 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=T8z8Dbpo; 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="T8z8Dbpo" Received: by dvalin.narfation.org (Postfix) id B3D35202D1; Fri, 26 Jun 2026 16:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1782490284; 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=T8z8Dbpo/8M40X2XdHVeI8pbY96hiYKyfc+Fz3KyJU+JWvShp4QQ3zXCb1JQIXruatJFki a/Ad74pElNFyrwiI3OF0onB/0A7mx60HWwe1gHTuTfvTrqVS0h0AtSfv4kXw2IvpEa8n3z Lz05QLRmyeG18JGULvLgmxsYmz9Gmbo= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann Subject: [PATCH 6.1 01/25] batman-adv: tp_meter: keep unacked list in ascending ordered Date: Fri, 26 Jun 2026 18:10:59 +0200 Message-ID: <20260626161123.124273-2-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260626161123.124273-1-sven@narfation.org> References: <20260626161123.124273-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