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 A5A7F3FC5D8 for ; Fri, 26 Jun 2026 16:12:15 +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=1782490340; cv=none; b=PwKcYSwiL0XGFnyaD/hhJcwFNqCOqAkpG1earTf2TWe1jfW42kd818Zh+1l3pKZSEieLpV8hh9gyetRTO74z12FYKfpRUBwNuXMVbT6OBFiR1uE/hF+fM7Kz+GIkJzZ6zxlZx0WlA6vwi/EJFqRmNR8aFPK3ooWdJblCitM6dFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490340; c=relaxed/simple; bh=BqRS4Q9CYCPo20A6idon2cnoebV7t6LSYDX8UZiBseM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cysnib+hFq1RsvYWbAVr7xGRl7aZxtkllN7Op5iWN7exY2iU9Kf1eflbXRrlPlGL+0gbOKW+d2jS3cnX9HdDu3rQn2Xgn69qWRQiPDucoz04vI+2QWCuQv/vVHvd53UBhwBQU5wgJMtx7G+4a/SZt1n0Jk2Vxp9XhB7FuLTQE3k= 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=g4pCLOyk; 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="g4pCLOyk" Received: by dvalin.narfation.org (Postfix) id 1735720470; Fri, 26 Jun 2026 16:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1782490334; 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=s+CDhH0eyV53vY53QXYWZ85WDgjfICC3vLG7UVB4oZY=; b=g4pCLOykivjkZdMyVtQ/uQKwTtTefrgEWBHrFjJ9gO48oFNCrDrqGiFpSwHoIB4Dl+lIt8 J4uT1YTFcNo3GbYctb+jGNti0HLNsXRm9YX4/+gvCThqne9Keccy4njmwOXoMx8doWfIXw SjrLNAuIT8YpyjajPZTqxiAUr5hS75k= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann Subject: [PATCH 6.18 07/26] batman-adv: tp_meter: handle seqno wrap-around for fast recovery detection Date: Fri, 26 Jun 2026 18:11:51 +0200 Message-ID: <20260626161210.124712-8-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260626161210.124712-1-sven@narfation.org> References: <20260626161210.124712-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 f54c85ed42a1b27a516cf2a4728f5a612b799e07 upstream. The recover variable and the last_sent sequence number are initialized on purpose as a really high value which will wrap-around after the first 2000 bytes. The fast recovery precondition must therefore not use simple integer comparisons but use helpers which are aware of the sequence number wrap-arounds. 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 a85622267ba65..0ebfc4462b8f1 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -733,7 +733,7 @@ static void batadv_tp_recv_ack(struct batadv_priv *bat_priv, if (atomic_read(&tp_vars->dup_acks) != 3) goto out; - if (tp_vars->recover >= recv_ack) + if (!batadv_seq_before(tp_vars->recover, recv_ack)) goto out; /* if this is the third duplicate ACK do Fast Retransmit */ -- 2.47.3