Article View: linux.kernel.netdev
Article #7387[PATCH net 04/10] batman-adv: dat: initialize orig_node of unfilled candidate slots
From: Simon Wunderlich
Date: Mon, 26 Oct 2026 08:53
Date: Mon, 26 Oct 2026 08:53
39 lines
10647 bytes
10647 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:
<20261026085309.1074911-5-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-351771-linux-kernel-netdev=dewy.ruReferences:
<20261026085309.1074911-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-351771-linux-kernel-netdev=dewy.ru From: sw@simonwunderlich.de (Simon Wunderlich) Newsgroups: linux.kernel.netdev Subject: [PATCH net 04/10] batman-adv: dat: initialize orig_node of unfilled candidate slots Date: Mon, 26 Oct 2026 09:53:03 +0100 Organization: Usenet Network Message-ID: <20261026085309.1074911-5-sw@simonwunderlich.de> References: <20261026085309.1074911-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="1265027"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:yfvDEJNsA/06lPoiU2xTpZEbhbw= sha256:GJ1PqELapyGYWZBWecF5OKx7ZDlp2CA77ItWUS1mF9o= sha1:HBtZ9QKRzGNKVUY2JZSEDVIthR4= sha256:ehqWQ8z+/x9iM5OJHA4plzFn0y+uQQUU8FcycPFJvww= 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 98320125B8E; Mon, 26 Oct 2026 11:53:51 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.149 X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31 tests=[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 dPplgkuN0OZB; Mon, 26 Oct 2026 11:53:48 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-351771-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 335B9125B91; Mon, 26 Oct 2026 11:53:39 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id C11B160134F; Mon, 26 Oct 2026 08:53:27 +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=1793004803; b=2K6cbgrjXXJGUcjhYv53UnM3ut69zXRhp7ZtnOd6U1B/Y9DktGhjI3eaOP4EDN4qD5Dc o/eBsUBhx0qZlO46Cs2ydGVWwc6A2oisPIv8uaNLE7gues5prigoown84nZBIB9A10CtA 18HpenkqZOyLi3jklQ3ZTMvgst50fA/kjjoDZKN5zjFzP/jKWuWPHLasnPH9dWPSuxccB YtIS3wkIGCsbMhBlwU3gXZMw+uf6uMsO/2eZe4DBMGD45Mp5WVyO4oaAte2SdkNA2Os9Q sbRihVQvcKPGOCRsVq8LgL+DrVvNjPIDdiWbKSiHknPJe4I4dCivIo02OaFeY1thi8Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793004803; 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=y2FJdy6OVgXWjDLm3rG5VSoiuG8kzdtRDV2YhL6D4WrGtu6k3doepbw14YS2U/psglkh RYUVebjnR5i2zKPeCxTnxw4ID7wT9iJ2GvU/7HBuZTsu8kVyi3y0FDVUwLyvNakQmNVkU egqP2LZ5FsdrtGo2Ob74qEj3C7pQf9j1T3cO19J/Vp0b0Z3soE4/ZwAz+Z01hfe7dIHM8 y7ZMDof7fJkUDwyJZMD3Z+RMmrdyPrd54JjNN/eZj+Qzv2FhAwx2WliOBI+Uws6jTvICx od+DkW+CpVWGEz2yXsryrEF3+0HGDJgeT3nGvVbSUX0gr5ArpT63PoKdtz/HkAFP5lQ== 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=xOMgBnOp; 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 E550860A260F; Mon, 26 Oct 2026 08:53:22 +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=xOMgBnOp 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=1793004802; b=Fk2b9gfvGsJev85S9O+BUg6BKbTaJcrfpH2Pxvv34CJa+aEulFq7ZMVq5ZpuWxTwqYLQ OayvwHBZSaDbRoifnZLhtCfX++zx9mzHfofJZOzTkm1tG+vf+Ct82wt4NFb/y6u30oNZz JeerxsBPvH6OL79fTF5/tC68lhuXRwKb+ZFwMEgE6fCKcEvnCIlvzepBk8jz5gZUQULop f5AKKTsZ5e7ApYBZs3OcEIQzeQPda73g7phfGAyZy/UAYvbWXAulTk/G28pVWsL9iWmQ6 t//iKtMA/C/+p0X4Rd2kec1kB7hihDnLDr5QfxuIThpZ+sWSx3RBn1khCtN1M83C5pw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793004802; 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=ZKQSZmsrDrnPuZ7zqAnvW+02c0AToyIov4i8epFBhNCJdQ8MvDw5pc8dGGPSd0sdc1QQ RK7OnC8g5/6JldMF/1RkQwabgDWUfc3FpCKGwx719yLhx3LArk2uVItWuPFsauVDqJTus Q94vx5D5yhYSE/6tMtj3o3mn9to/Z67JgmrS5UsZ0HX0YXtZ7Uqb6EFoSY+BdrjXbQ/sM p0m71i5dRPYhVN4CBafnBgRQOJVM16QQCf4LsREf/113ZNcybjY8AccXSE/+PKSR5z12d d+7equ80koDtzWR1BkFawppdjxk441LrFQSEDg+YhSYfUoH+KAevkDyJ8dBbQnYHvPQ== 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=xOMgBnOp; 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 7D0A7606A32E; Mon, 26 Oct 2026 08:53:21 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7D0A7606A32E 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 (p200300c5973Ce5d80Fc8dfE94A24022d.dip0.t-ipconnect.de [IPv6:2003:c5:973c:e5d8:fc8:dfe9:4a24:22d]) (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 F1FC7FA1DA; Mon, 26 Oct 2026 09:53:13 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de; s=09092022; t=1793004794; 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=xOMgBnOpjIEKs567hEgwRcEEpAczhvNU3VlMu7J+24ohb/EiruGY05gGdc43DNjfDsviHV YiNy547Ofd+bLg0w+PrxAQaUSAeUYxW/0f7I6lJoPVrNo6Iih4Mxf/WPHF8Z+//gVh209A m0xix3+j7BcD6nud5JZNdaEA6V+Junsy2Z3g73u582wbw6n9+i7q872Gb3dWktmhghc/Uf NvpruixTYcemMbXHu4SAR1g5cQwVvZcWffpcHnNDbOCQuNQd0zK8rMQhQYcObFZqa8UcXE yllsiZziv9R+1c06Yi3YAaSbtf5h1S7Ffg36W24vjB/3m7srny81MGj9gk28eg== 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: <20261026085309.1074911-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