Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 360F543F09C for ; Thu, 16 Jul 2026 20:35:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784234106; cv=none; b=AaqiUNOimtwTIeDPfe23yv+oDPSjYE9bKbP2PEUIzYyswql/E2gwhnzlVY77hP77f/EErN9hCY6sZmSUj5TMDeOtyI7SxmsTi3++9Xw+h2U/tkGXOgloYN824IoCaQBkr0CIwBHxOrBrosq+AI5tVQ4tbvysHlmgvoic9W/2nN8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784234106; c=relaxed/simple; bh=a2r3SaEcmo1vXRTikEb5mYwXGPxTs2s/FQ04pnJ5R5A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nYkITwWITrmmhb650Kfiw+Vmjd6IFWKNK6gtMaYI21y+37v/VDhFA9JgrqE3RBVZwLQwUdwLN3U62ycXYKePHOeD+KTDYsSnIkmrzlqVOe9Zq2Dy/28M71biYdYjpeJNnM8RfJzdG5DiaKvhUtpWU5E4zieUcVitCCZJNINdB0M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0sec.ai; spf=pass smtp.mailfrom=0sec.ai; dkim=temperror (0-bit key) header.d=0sec.ai header.i=@0sec.ai header.b=bWc2OLTl; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0sec.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0sec.ai Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=0sec.ai header.i=@0sec.ai header.b="bWc2OLTl" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493c19bad03so58671325e9.2 for ; Thu, 16 Jul 2026 13:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0sec.ai; s=google; t=1784234103; x=1784838903; 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=EcO4tM1S3A4dsQuKJz/L4WTtHD8wctZEu5fpHjbBuSo=; b=bWc2OLTldqwUGev8rjSWlNyUzqyJXU1Pq239JOCc1yfyGWKGAUmP3mAue4vb5HkGAv koX7QJ1IieQWablWsRwCoyald4FSYej+qfk9iaZ9RDs/KFTa/ZPsawyew6HF52JaTIBr kknvAr4Tcu/VfF2WloiavqVI0NAfecO/4nufIPOTyI4yp1oDbDRpku29teH0KIn5C3cl XG1Q8KMr85c1Q3WR7B4BGPBfZnJeZuLCAiiTdam8dVDrLwWOGNQfCSW03Bn8s2oBjMBq YCofz7VfwHoKrg0rhJWRupc+8mqdnP0KDmoXf58xJa1PLSSnrvZBePG8t6rIkzQMZshd /bgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784234103; x=1784838903; 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=EcO4tM1S3A4dsQuKJz/L4WTtHD8wctZEu5fpHjbBuSo=; b=li3f0AxnAhB0Uvl+DR8Iszf12qoCOshFNAqTlJw742IuWlYRGyqBBEchxTBLR8QOQi rsyI4IC+n3cxOtra8FOM5NT5aFldydjct9lOYC+G0qKwO+u4+nURMasrnb9WBi1q6yXP JORj75A0SiiBWA60cMWHleoAOBT+6JMQ5GO/qkY5DhO6ECwr2UZMflFL9dYmq70fdyv4 /eHLp8BC7zO7rHLFkGcUF1oGDl29kebf4GlxpqE/cfgAMimF4dhTfaufVQc36sle4r7S 05g7/EWS0aunMbL67YDt0Lg+L4PQQU1ZEqu6GhdKZgr9c3jsBtlKF4ubvjoAezQBTSgH 8wQQ== X-Forwarded-Encrypted: i=1; AHgh+RrunWAioajaBP0VBMhEcOdBIEK6oM4IQCCLl4Lx9Cz7j3pEweQ+X8a8s594Z3rvZcr+ilaHtrXk5YHM/oE=@vger.kernel.org X-Gm-Message-State: AOJu0YwTlyLRNWvqFL0fCatVTmJ+FxqkwVYZHwpBB7pLh3YytQbAGGiv DKFTOJawDLlt70lJxqqjMXQx5ZourTSR2pUaFAXvB/JtnOZoSXEm9YJ+XQ29uiTWnr22 X-Gm-Gg: AfdE7cmsQ6ZUvcbITBUP482d1wXbepYy2I8h1mT5Pj0Via2I40FuGlAVyATv0c5kKsj PjkCJGgulWK9PIJh4JciHGyufQ+9OIFsSnRI6v5s2kBTosDXOmqGta+N7jqiP+IhxLFZ179SEqt hFz41jFaxeQmu/u8gI9MNx+n2Od17AfxqRllLmcgl+rXgzrLnL0R2sKCQ+phXpuHRL7hxPO8OvL 39s58Rou0Zbl0YN4ebwrix3V5upjPqs/ZnnsNWuXus43e6ow/j3qyfR8ldtV3M5MhJq1e+BVEit bAsebQRWGrAyacERJbdAwItxMVoq328mGUM0d/Zdp5o1Jifhlr1Roi+sIBwH8dRpVYsSyh3wo/H 3fUzfN7i5oLxCsgdklpchqt59OeTsIA72a9tPbOhsDDU51tIrRwRHlPttC5iR41XYpCxOR2PLcq HxJbgbfFDUwMfwF9SYDeqFnIAiuKgoQmDjkyZGqQTIfXgMG/SZVqplWWgnJcOeEqMBLKguSKTKp 2WkAQD2txos+0d6jo5e5Dec X-Received: by 2002:a05:600c:6d4d:b0:493:f6f0:d66b with SMTP id 5b1f17b1804b1-4953c14f0a7mr76349675e9.1.1784234103380; Thu, 16 Jul 2026 13:35:03 -0700 (PDT) Received: from PeakBook-Mini.tail8e484.ts.net ([178.197.218.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49548e075d4sm4602835e9.1.2026.07.16.13.35.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 16 Jul 2026 13:35:01 -0700 (PDT) From: Doruk Tan Ozturk To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch Cc: fmancera@suse.de, sd@queasysnail.net, linville@tuxdriver.com, mschiffer@universe-factory.net, maoyixie.tju@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH net v2 0/2] vxlan, geneve: require CAP_NET_ADMIN in the device netns for changelink Date: Thu, 16 Jul 2026 22:34:58 +0200 Message-ID: <20260716203500.70573-1-doruk@0sec.ai> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The recent series "require CAP_NET_ADMIN in the device netns for changelink" (8165f7ff57d9..27ccb68e7ccc) added rtnl_dev_link_net_capable() and gated the eight IP tunnel drivers (ip_gre, ipip, ip_vti, ip6_tunnel, ip6_gre, ip6_vti, sit, xfrm_interface). VXLAN and GENEVE share the exact same shape but were not covered: both store the underlay netns sticky at newlink (vxlan->net / geneve->net) and their changelink() operates on that netns, while the generic RTM_NEWLINK path only checks CAP_NET_ADMIN against dev_net(dev). Once such a device is created in or moved to another netns, a caller privileged in dev_net(dev) but not in the underlay netns can reconfigure the tunnel'"'"'s underlay. This completes that series for the two UDP tunnel drivers that were left out. Same helper, same placement (top of changelink, before any attribute is parsed). Verified on next-20260714 in QEMU with CONFIG_VXLAN=y + CONFIG_USER_NS=y: an unprivileged user namespace holding CAP_NET_ADMIN only in a child netns issues an IFLA_INFO_DATA changelink on a vxlan device whose underlay lives in init_net. Before: returns 0 (reconfigures the init_net underlay). After: returns -EPERM. v2: - Correct the Fixes: tag on both patches to the commit that added changelink support (8bcdc4f3a20b for vxlan, 5b861f6baa3a for geneve), as pointed out by Fernando Mancera. No code changes. Doruk Tan Ozturk (2): vxlan: require CAP_NET_ADMIN in the device netns for changelink geneve: require CAP_NET_ADMIN in the device netns for changelink drivers/net/geneve.c | 3 +++ drivers/net/vxlan/vxlan_core.c | 3 +++ 2 files changed, 6 insertions(+) base-commit: cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5 -- 2.43.0