From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 30393348465; Thu, 2 Jul 2026 16:41:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010468; cv=none; b=UtGD5zKvyY2pm5iaBaNL7XP39chXJXtTZG9mNHj6HWLCLFjgpfK+2D2QS3vBqp7riUKYcOZhgiQyW+N7rkacYA3fvNVWZOLrVRQWOYF5A6O2tIqUVh/HU+keProhUtZVkjSXW0dXHCZwl8JTBJ5lleb0AUzVZ2O87DGzIUfQ8zs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010468; c=relaxed/simple; bh=/HbBemIvJlV9zFKaBW/f/r4u+dRt+PXTRIr/DKIIS28=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TTNWTKdTj5caGlb0vtqKvfsBIdeBl6QEZ82I9tqdfPmqdUiEHiMIn3+OGOQ9Q/Ci+ufdZX9SJUY86NRwQKkJkJpLRvYosDe2jctEvqcuJjhLgpybX7BoPm5tt4oSN8SsTCQOD/YpLGX9Fk3+gRe3dg/tVp1mb2Dm5H46Vx0uGpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PUQlRFHt; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PUQlRFHt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3422D1F000E9; Thu, 2 Jul 2026 16:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783010466; bh=UfOtSVxkMeoOtgwsnR0lY70ytPXvOjM5vVWlaBivRl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PUQlRFHt+nIwzvbk+XAlNBs2IyKGm/6OslPOFbeoXa49CcBvnzACvRRFHmwiLhRtd WCLcMwJcbqJtNJ5dH8AgCPhf9L1jrM876ltSs/J86ML0Md3AGY/7zdmaKsGjdsnTn6 uGPn9Tm8lLYv4NHNSixlBtV8Q/3QupN9d4xIsHAA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Sven Eckelmann , Sasha Levin Subject: [PATCH 6.12 121/204] batman-adv: dat: prevent false sharing between VLANs Date: Thu, 2 Jul 2026 18:19:38 +0200 Message-ID: <20260702155121.195530361@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155118.667618796@linuxfoundation.org> References: <20260702155118.667618796@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann commit 20d7658b74169f86d4ac01b9185b3eadddf71f28 upstream. The local hash of DAT entries is supposed to be VLAN (VID) aware. But the adding to the hash and the search in the hash were not checking the VID information of the hash entries. The entries would therefore only be correctly separated when batadv_hash_dat() didn't select the same buckets for different VIDs. Cc: stable@kernel.org Fixes: be1db4f6615b ("batman-adv: make the Distributed ARP Table vlan aware") Signed-off-by: Sven Eckelmann Signed-off-by: Sasha Levin --- net/batman-adv/distributed-arp-table.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 4d53e7c3ea5463..bd5477263ecd7c 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -215,10 +215,13 @@ static void batadv_dat_purge(struct work_struct *work) */ static bool batadv_compare_dat(const struct hlist_node *node, const void *data2) { - const void *data1 = container_of(node, struct batadv_dat_entry, - hash_entry); + const struct batadv_dat_entry *entry1; + const struct batadv_dat_entry *entry2; - return memcmp(data1, data2, sizeof(__be32)) == 0; + entry1 = container_of(node, struct batadv_dat_entry, hash_entry); + entry2 = data2; + + return entry1->ip == entry2->ip && entry1->vid == entry2->vid; } /** @@ -345,6 +348,9 @@ batadv_dat_entry_hash_find(struct batadv_priv *bat_priv, __be32 ip, if (dat_entry->ip != ip) continue; + if (dat_entry->vid != vid) + continue; + if (!kref_get_unless_zero(&dat_entry->refcount)) continue; -- 2.53.0