Article View: linux.kernel.netdev
Article #5298[PATCH net v2] vxlan: reject adding a remote to a nexthop fdb entry
From: Henry Martin
Date: Tue, 20 Oct 2026 03:45
Date: Tue, 20 Oct 2026 03:45
66 lines
12869 bytes
12869 bytes
FDB entries backed by a nexthop group must not carry a remote
destination list. vxlan_fdb_update_existing() currently appends a
remote via vxlan_fdb_append() on an NLM_F_APPEND request with a
multicast or zero MAC even when the entry is backed by a nexthop,
breaking that invariant through three different callers:
- "bridge fdb append" with a dst on a nexthop entry;
- "ip link set dev vx0 type vxlan remote <ip>" (vxlan_changelink());
- "bridge vni add/change ... group <mcast>" on a vnifilter device
(vxlan_update_default_fdb_entry()).
All three reach the append block with nhid == 0 and a PERMANENT
state, so they pass the earlier nexthop checks.
Reject the combination at the top of vxlan_fdb_update_existing(),
next to the existing nexthop guards, so a refused request has no
side effects: placing the check in the append block instead would
return -EOPNOTSUPP only after the entry state and flags have been
rewritten, skipping both the notification pass and the err_notify
rollback.
Note the resulting behavior change for the two rtnetlink callers:
operations that previously succeeded while silently attaching an
unused remote to a nexthop entry now fail with extack
"Cannot add a remote to a nexthop fdb entry".
This issue was discovered by Tencent CodeBuddy Security.
Cc: stable@vger.kernel.org
Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
---
v2: Move the check before the entry state/flags update, next to the
other nexthop guards, so a rejected request cannot leave the
entry half-updated with notifications skipped (reported by
sashiko, confirmed by Jakub); reword the extack message and
document the behavior change for the vxlan_changelink() and
vnifilter callers.
drivers/net/vxlan/vxlan_core.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 3390e341d1e58..83dcede2ca62f 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -1002,6 +1002,15 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
return -EOPNOTSUPP;
}
+ if (rcu_access_pointer(f->nh) &&
+ (flags & NLM_F_APPEND) &&
+ (is_multicast_ether_addr(f->key.eth_addr) ||
+ is_zero_ether_addr(f->key.eth_addr))) {
+ NL_SET_ERR_MSG(extack,
+ "Cannot add a remote to a nexthop fdb entry");
+ return -EOPNOTSUPP;
+ }
+
/* Do not allow an externally learned entry to take over an entry added
* by the user.
*/
--
2.43.7
Technical Details
Message-ID:
<20261020034531.1420194-1-bsdhenrymartin@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349025-linux-kernel-netdev=dewy.ruShow 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-349025-linux-kernel-netdev=dewy.ru
From: bsdhenrymartin@gmail.com (Henry Martin)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2] vxlan: reject adding a remote to a nexthop fdb entry
Date: Tue, 20 Oct 2026 11:45:31 +0800
Organization: Usenet Network
Message-ID: <20261020034531.1420194-1-bsdhenrymartin@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3776879"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Qn9XkUX1xGNsrkeCdVQOlFfWs8Q= sha256:vMjy4O7VBP+vd1es3i6o9p3kx/KFMS4VytyxycpTleo=
sha1:g1tsZ3rTot8bS7FkfZOchCbJBBw= sha256:c0rGtdV0E5dhYBCP3sUpxnoRKCn2q7UlKUtgGMw9Ijo=
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 DA9DB110BF3; Tue, 20 Oct 2026 06:47:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 WtC1rOL-H5-j;
Tue, 20 Oct 2026 06:47:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349025-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id EEB5C110BE3; Tue, 20 Oct 2026 06:47:22 +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 8E37560EFA; Tue, 20 Oct 2026 03:45:46 +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=1792467946;
b=WGCg3Oo/LRE/n/xkMQl5ILsxwAyWwluU+3zqAY5sUvgB4KUPiC4f4fj5eEshMQKOw0We
+i5MwJQ7HD9Wg2VcKfuBRpktJEYcetulCc18pUXMh91sfbDNMq1LZ3UeB36UprqIk3Ac2
vxCwvIpMJMfaIE4p1OqQWLU+nzRsw7lp2GH/FTH6xvE3wfAk9hLuxMEhbgowtQDqZPBFr
Mmfj/LIyvmaluknOdQQdofGL+r3zQOVlOlIwMPlaq/PRZRLvdrusIdz+g+eNqBFrFA3Dw
h3i6g8PlDTUEhtpl2B7mUotHdd8tl+A3qfi8lhvGcf6Hbt7VbztDDyx+vm+w9QFikuA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792467946;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=ULuGvekLIA9kqLWF/rjFDFzz9QzEifCQafgwxDg8ZBU=;
b=kXUFxr6ULkTO+o4JuxiL1sdtTgOYX27gBtj2NeybieCiNJdTrOSLD6mOLwiogJaUur+k
PgL8V374E8b2Xn491l9AQNpnUnrKWBDRhvJhyt01lq7KHPdbMuVKgK1ebGknQ9GOUIPK9
fLFaa+griMFMZbH34axw+RUSMmrdhMpG/1xtSnIII/g0ipZVzk1u9o4vVi3L3KOv7f3vN
sKfA4iEom1dJ69GKUvDAdmwAYOrEYtJqlETyLLimo32Imh/8PQxs+ZjGt0c7eUnzUmTai
R60oTCGhAN4zJ1Fa9hrDlDXtWmR83I8Dz9/ZszJG7cOScItpLiiq9C3EOkEepE6bM3g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=QNUydbyP;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 43325606A322;
Tue, 20 Oct 2026 03:45:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=QNUydbyP
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.231.137
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792467945;
b=qtgeiKtPAmekkWpd7eXSHNjVz7Dtyeu1FlD6sxYc1nBlKrPIEgT4AulWsszn0WJH38q6
6QLRN9nFiQwjMjrXDyZ7fYuggap9XGs/BsmgivTKYNfZFM1YlCYKL8QkWXr9R+dH80z4e
+iuOTs7SKuepYoulPC6yBSkZZwIYy+AgLimFymnp3J4ZVx5rmNlaXRCUYs3t3lpxVQaFQ
lUdV6qL74Lf+n2W4MmIMHl5BpOYtHAuhBOt5KszWqTyw/UHGegspWdc1HvZPKrJFvdCAR
H2xI+NNmq9NjW1LbSy1gZNP4Mh+hxcMi4X9w+tps4iTbxtadiPsQsvBrPfiYo+f3cWw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792467945;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
bh=ULuGvekLIA9kqLWF/rjFDFzz9QzEifCQafgwxDg8ZBU=;
b=WCZpI5vckKXx3dQ/Atg7zV2Ij6o/1OkzULNKvHUsDndHX91qAqsnclVgZyDfOOfcV6EZ
foK5O6L63LdYoG3/H8Oh/AWCEGYck43NcizG4CeyHj6ILk/ycJoxIUl/xrQ3J5IiK4wZt
xGM8xez977oaHpcTLN5UniPjaYg8MAOE7VEgxbqiWKWFto6AZhga+eDu6JPcr0aOMj44U
iI6PBcB4QuQPAd6IF4E/LRcggv78HP2v7Pup0nvx6FDugBvsTMvY74j2aT5AagNkmJV9g
EM4rS760MJNebBwxLZcMfvr+OH0LflVWsBv4uBLF307XOmfEBmBQYcz20iHoCBd+diw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=QNUydbyP;
arc=none smtp.remote-ip=74.125.231.137
X-Received: from mail-oo2-f9.google.com (mail-oo2-f9.google.com [74.125.231.137])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11F60606A31B
for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 03:45:44 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 11F60606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-oo2-f9.google.com with SMTP id 006d021491bc7-6de48228f20so288262eaf.0
for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 20:45:44 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792467944; x=1793072744; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=ULuGvekLIA9kqLWF/rjFDFzz9QzEifCQafgwxDg8ZBU=;
b=QNUydbyPz7OjvEvLXsauM9XC4aZqXdk0GUCJxlwONwH6xc3ncdV30gJOAE3h0UlwG9
ACMPDKSicxvuwyOa+VSoPt8r1WC7+AQI7PCPJfsMUFsf4U2lhRSdmBHPfFxvThSfCDpK
/7AE3/AfuHijqSrz5AVovSgKi57dhOlPIiJ5qBVLCQ+3Ry3KnFR+M33loLvqzGSqc4CH
phdCg+5ro093v3iTCZyOjMG6/U5IEXlYG5AGZMts6Fjr7bIqF4juQ/574qX3Bzk1KtEO
NOJfku2kZUB48AoU62vl3dEKmFFeiZo7GK+/mSGccprSElJYgqwtsQau3pVKn/VzC+42
VwUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792467944; x=1793072744;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=ULuGvekLIA9kqLWF/rjFDFzz9QzEifCQafgwxDg8ZBU=;
b=awlPMVUYXpDln5eYdQwnpKfI3iohPrmaYklQFiK/Yt7DLRk3dSM3owmC4T0JHZKWRh
XLMG9GSRw/lWYLO89SC4nO7yoMcI0bmSf2gqRWTSoscslXXo6W4JXTTeWU9JNs4qoVvB
EpfvtvdP0pr94sEsuJj8zfEoM+dLT4oDidUL5+5sLhJy3yk9Q2vv90fQXFlxiNFyXdK/
zBG3Ekf9Kg3tqqoPaqZSUzoSNMCvVNsjfutG8Ehv8BUIe3fgr75Ks4A+OGNN9IN3H62H
FkhK2OSYqhsZRS7pAW/zPpCP8bYac8q7mgP+3fIlLiNawB8tVvO2gRAYh55jdnzZfNPo
WiiQ==
X-Gm-Message-State: AFq9FYL2ho3F5aWaxNXmNT80yIb4OJYDP3dbS33cpZekiSCV3odFUg6N
8YIbAGr3Bx9Wt7t8aLPGsv9VwCrPUzdW3q5DsEcS+v66yn8g+Dc8dto7
X-Gm-Gg: AYBFou0pe21i0h6Izcynj8vhxFDsp4Lq3W4A0cvo9h3iegvTOZyrfbPMX3oh4zRXOyW
i30pU6v+R7wz7syHMnSu/Zsb7ygoGffivvOY5OF6mBIdjsPBLd7/4bz0Zq+jPi9M2nW6N9a3Sd0
QJma3K5VGdTp1KPGnmbxtXi5UfIi4XtmkqDmh+dHyycoLa6u8UGcdhY1axPZV6QF46RlI3ildEN
Byn1xDy6e+okQCPZeds4qLPAEKwpLn7t+T8Zi7glTZppy5c0NG9qLu1qhEA5E/Bp8ZN4zYJl4j5
81rgBA7Z+z6hA0jVQUfBWhS+gDIylhZevOAoUeZj2g65P5ijJhBw5vEGHgdychOUNfV1RScDYmo
EymBZPp8QVax05FA5deAL64uWfYkCcaNiVnoOteDcclMmiJFUOZYLeMFfalyI5wrBIGZ0GVBBTc
kqMKWV7Kd/LF/qL0Y90Cermon33sDXMGyJ8iRrgA8G5uVr+paID1Io+qKEjRMfY3thFuKF9185M
WXfqdKwVoKp74tXOOfpbfbcsChQNdkKfX3A
X-Received: by 2002:a05:6830:719c:b0:81f:92c9:1f80 with SMTP id 46e09a7af769-844ffcda39emr8967693a34.16.1792467943952;
Mon, 19 Oct 2026 20:45:43 -0700 (PDT)
X-Received: from localhost.localdomain ([14.22.11.161])
by smtp.gmail.com with ESMTPSA id 46e09a7af769-8498d1a4bfdsm4387344a34.20.2026.10.19.20.45.35
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 19 Oct 2026 20:45:43 -0700 (PDT)
X-Cc: netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Henry Martin <bsdhenrymartin@gmail.com>,
stable@vger.kernel.org
X-Mailer: git-send-email 2.43.7
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