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 E53DC3E2745 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=1782490288; cv=none; b=pZpjNbO86Kk6PEmVgP4MPZ2Mu+ndEnFDPbPFGDYqUFfT6Cn/lb1Ax4smAg+MFdumUqi86UrKffwJY4JzRWbaaBanQGx0VCLWb5RHmKJJfF5Uh76Qku/aWEtvcZ6/c6IaHe5YOjnhDZ2oHhR3+f/6mYjPKLMOR6xRAWfDaNxA9ew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490288; c=relaxed/simple; bh=8HIKyq4BSb8qVt3HqOP7c9x5E1T7lWQcfvTnjkEPCmY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xw2TUa+jAIZ5DUnM8eCBkKLF/qtSt2YQsmaBD3QnfTuSd9GZXNn1iplklgyNzYpoTFZk1rvARMy/7iFS1V8qp2IHluGRO/x8PfuHN9B50Q7NjdNbfdWf5XBgsxx/hbRYJITByoFPkPMqYo85tjSncdm4jebCpzzZCKVpjAYiLbQ= 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=pPaukB6x; 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="pPaukB6x" Received: by dvalin.narfation.org (Postfix) id 9E96C203E0; Fri, 26 Jun 2026 16:11:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1782490285; 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=l2Z+W0DL4p3ivSDcSwcRqMFiAbkqyH2J0VIzY3641l8=; b=pPaukB6x7LtM/HnEGprwfRkDLkWZm2HkRHjLG/m/QPT2vsU6s6RKOzdMN43Sn6AEdxsKY8 wc7yh8vbwH9LitfVkI125Kfw3jWQ9lfiUSMBLWXQEcdpPr+jFuSfw8DKGUu5aAbP/7H5zP 8tm8kfbSub0X1RSOBS2RvF2hD6wcJpM= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann Subject: [PATCH 6.1 03/25] batman-adv: tp_meter: initialize dec_cwnd explicitly Date: Fri, 26 Jun 2026 18:11:01 +0200 Message-ID: <20260626161123.124273-4-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 febfb1b86224489535312296ecfa3d4bf467f339 upstream. When batadv_tp_update_cwnd() is called, dec_cwnd is increased. But dec_cwnd is only initialixed (to 0) when a duplicate Ack was received or when cwnd is below the ss_threshold. Just initialize the cwnd during the initialization to avoid any potential access of uninitialized data. 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, 2 insertions(+) diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 750e5e9d3dc9d..f6ccb639744a2 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1055,6 +1055,8 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, * soft_interface, hence its MTU */ tp_vars->cwnd = BATADV_TP_PLEN * 3; + tp_vars->dec_cwnd = 0; + /* at the beginning initialise the SS threshold to the biggest possible * window size, hence the AWND size */ -- 2.47.3