🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8934

[PATCH net 05/14] batman-adv: dat: initialize orig_node of unfilled candidate slots

#8934
From: Simon Wunderlich
Date: Fri, 30 Oct 2026 13:50
39 lines
10667 bytes
From: Sven Eckelmann <sven@narfation.org>

batadv_dat_select_candidates() allocates the candidate array without
zeroing it. batadv_choose_next_candidate() marks each slot as
BATADV_DAT_CANDIDATE_NOT_FOUND but only sets orig_node when an eligible
originator was found. In the following rounds,
batadv_is_orig_node_eligible() compares res[j].orig_node of all previous
slots against the evaluated originator. For slots without candidates, it
reads uninitialized memory.

The orig_node has to be cleared together with the
BATADV_DAT_CANDIDATE_NOT_FOUND type.

Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-b25d9aa4-10bb-427c-a145-ccaadc2a1bb9
Fixes: 785ea1144182 ("batman-adv: Distributed ARP Table - create DHT helper functions")
Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/distributed-arp-table.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 74050bffedbce..0260ed7e828b2 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -653,6 +653,7 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
 	 * NOT_FOUND
 	 */
 	cands[select].type = BATADV_DAT_CANDIDATE_NOT_FOUND;
+	cands[select].orig_node = NULL;
 
 	/* iterate over the originator list and find the node with the closest
 	 * dat_address which has not been selected yet
-- 
2.47.3
Technical Details
Message-ID: <20261030135105.2555887-6-sw@simonwunderlich.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353796-linux-kernel-netdev=dewy.ru
References: <20261030135105.2555887-1-sw@simonwunderlich.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353796-linux-kernel-netdev=dewy.ru
From: sw@simonwunderlich.de (Simon Wunderlich)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 05/14] batman-adv: dat: initialize orig_node of unfilled candidate slots
Date: Fri, 30 Oct 2026 14:50:56 +0100
Organization: Usenet Network
Message-ID: <20261030135105.2555887-6-sw@simonwunderlich.de>
References: <20261030135105.2555887-1-sw@simonwunderlich.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2248441"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jLMv6vUEM+0ys1DHuItGqF03JLc= sha256:Jit11l0I6EqsbzzkcyjdXLAkuDht8/44KyI9e8v34Jw=
	sha1:MeVOyCdVb7RALEXcHAT/q5S/SZU= sha256:y0WfsmNe50L9IE7+E6V1HeKmhxsK/hqvtRzDOfnEe3Q=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 38D76125C93; Fri, 30 Oct 2026 16:55:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=simonwunderlich.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id W842U3R7iQL0;
	Fri, 30 Oct 2026 16:55:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353796-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=simonwunderlich.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 384AF125C91; Fri, 30 Oct 2026 16:55:07 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8B19A2DB8E; Fri, 30 Oct 2026 13:51:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793368290;
	b=kY6BlcuaL7me5ORmy3ifqZ9hQA3bgNJxErry4VOeB1L6O5LUz1NU2ACfmkhHAMlQwVjv
	 tdeCQKwP0KbpsNpGfOAKrBImv7mMDqyOmcI1rbdrVAjzNmaNRfkuRCeTTvHwXpp0oeWx+
	 wglq4AHXkO4Lz9dKyekIZYzlE6E3jSlrmjpeA0hNMdxzv1Jg8Qceh3+Uyu74SXh/8i9aP
	 xReRIFpHw78lYyUjKj/sQ6mOSAcwaBE5WeL1FvwFGm7Kemo48tgMDCvrAEJoz5Ez6D/R5
	 djM4C7sEygskBGokSySySTr/x8c/S0a7BY1VxdcGJxIaWjh3mScFP3AU/tQmvko4w7Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793368290;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=zooGUg5U79hEFPrT6Hi6K1nHULVSW/Tn4sEvAK4VHgM=;
	b=Ya51REh6sqp88VuGHhHSpQ3vvdWv6rppKw374lZfFZ5G0dYU5QzFw2fgUKYLSZTFF2+W
	 xKeyDLSTBG13DV5KBgB6+FagELdExlad1Xt59t6CDN3zYt0lAGAZcwyxTq/vquns6e9OV
	 R0jedmnKpWoIPvwEGj4acS5VLCmOy3N7GcIaTU3ajSHUGy0J19yuiRfdvxIWW0fq8dNDy
	 z0XRkT5fx6UWyQSMjACU+9Q0v6j6K6sa1smiJXvXpSlQrhMFqzlyIJClBXcX5vQq/6gqw
	 pzX6OqcT1qTrhMSVuHnsRULvpCH/Dfa/l42h8hxyuf/XeDgVk0k9XyR8LGHZdhCjUYA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=BFFAb6w4;
	dmarc=pass header.from=simonwunderlich.de;
	spf=pass smtp.mailfrom=simonwunderlich.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 21597606A335;
	Fri, 30 Oct 2026 13:51:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=BFFAb6w4
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=23.88.38.48
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793368284;
	b=mKjQOEcS/S1QotQ5oMF9IM27LuMI+Ro6B1gkHY+F97ZgU6SZUNaUnKAOP+TxVUpWCvEO
	 W6Z1SY/zYReMBo9BLNBFuXyyRH/1VwTXzUw3VGLefQTl4gDg2udU4167haiA2SjJLpPij
	 464kMyfTf13gpgncgKFHyC6fsdygpl+E0+qNEMeKQaJZ5b/Aw3Bvqt1NfNYJ0YUswU2ug
	 kQ1wzA5vn8siMo0bVFdYiP5KUvrdFFH0zy8gCfb4RIVQn2fYBEx6nf8ubncRX6r/Fr69g
	 GvR5vLymt41rEF8nSn9BHQ/B7uvDAFe0Ki01jZniiniHboXATkX/zdy6s3AmXQ0WLIw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793368284;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=zooGUg5U79hEFPrT6Hi6K1nHULVSW/Tn4sEvAK4VHgM=;
	b=H1eRKxnY8FBo0Gx7ZzH6xXQTTMqT1ve9gcqOMCyAXff84Y5ZZ/278VZq5cr5M85q/cZl
	 IQMo7RLYYBHikese/BapO1XRJrLYEejulQ6XlV3Iv235hhTeaHxq9Eq511RKjMglGi0Mm
	 40+KDvb7EUdtTV1lAVqp3vAWUiLHkazd6P5OFbktvHlx+csmsQCuzmkg1Z94YdW2MnJqp
	 1ZbVh7h4JudJ7/MYUgQKQQ0krvzEG0kJt7ZahQwZ/5/gE1d1ZDDRMo9qNbAbWH54HH4T3
	 oq8zEhvmzC6DiThISi3PhRV+gHuoYihJgho4QqvmdXsOmEqzo/r4L/pF6A0SZFpcM9w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=simonwunderlich.de;
	spf=pass smtp.mailfrom=simonwunderlich.de;
	dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=BFFAb6w4;
	arc=none smtp.remote-ip=23.88.38.48
X-Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 7433B606A334;
	Fri, 30 Oct 2026 13:51:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7433B606A334
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de
X-Received: from kero.packetmixer.de (p200300C597124Fd839580C360d3Ed6F6.dip0.t-ipconnect.de [IPv6:2003:c5:9712:4fd8:3958:c36:d3e:d6f6])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mail.simonwunderlich.de (Postfix) with UTF8SMTPSA id C70D9FA197;
	Fri, 30 Oct 2026 14:51:11 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de;
	s=09092022; t=1793368271;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=zooGUg5U79hEFPrT6Hi6K1nHULVSW/Tn4sEvAK4VHgM=;
	b=BFFAb6w48mJG8/X+32JzoBLNREjEax2+Ii+ujqab09H93BmKa4mFxx6dz43FTvXokA0w/5
	uS9pd+9rBiYgRfZ7iJxsZOzvHFtcXi6eQ8AQQNSX+KB7R6IFQyh/6nJkS3M+B6wySG6fjG
	QSLxR+SQMU0cYf+84uHeuPZBJpBt5Oi0NVpKfD2ZRUdPlB3E3ji1IjNflfKRECfgooloAV
	veGDs6EyxD97JzMC34Md1h6QixT9E2NLzKFkOMnGZOiUN+G1lc9QPSLT/QdzklptH4ZUUo
	HQvcE9TLPo7fS1kXsTE72DPYSvG6QdQfe3A8htrhxLJuWEAcdcPS+Vzb8AGZDA==
X-Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	b.a.t.m.a.n@lists.open-mesh.org,
	Sven Eckelmann <sven@narfation.org>,
	stable@vger.kernel.org,
	Sashiko <sashiko-bot@kernel.org>,
	Linus Lüssing <linus.luessing@c0d3.blue>,
	Simon Wunderlich <sw@simonwunderlich.de>
X-Mailer: git-send-email 2.47.3
X-In-Reply-To: <20261030135105.2555887-1-sw@simonwunderlich.de>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list