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 A96CB3E49CF; Tue, 21 Jul 2026 22:24:44 +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=1784672685; cv=none; b=L9uUcshEZRHloFj+0YQcopAL38bQ0d/jGUoAw68e6LDwU7NeTHoP4U+fjmMXVcDsyu38WUYZcxYk1nPWVAYbn31kAUO3Lrq565QfmNcWj0YqdeG73MV1kJcFqtHKux6q5j2aGtpAciUqFxfZ7YFIcj0NVsyqbsReT9AexbH0Z7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784672685; c=relaxed/simple; bh=ODh4yajihv1qe8O1bS4FLBY3QXXZI3HG3H/T4Rb0ueM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qxFrFqxO2pR5uGagYaxVAUkzHdkchhiR4E5J/D9kqr45i42xyvv488aLtCVNU9OnAzO9n4izLC5j6a+Z81OFVYun/SvkLDrY0yDi7wWYzB02baUNAaLCpptmRAg2vF/E/5Lx7Jt7OuzcJREvDNRpiR6Q6QbZhvB7rKrGm3NW76Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EFlSXSXF; 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="EFlSXSXF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C4E21F000E9; Tue, 21 Jul 2026 22:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784672684; bh=3+M/RS3TYo1TRoS+ABDSaILreH6lVfu+pKKWcYCgMYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EFlSXSXFVP+NkH3Z15MlPRYB0qtY8DB8RgTUw0hyn0Tsvp2uJfyLOvGn49n68fuUZ yzLLcXFHr7b8jL9RWmxqw1JSMDEwehrVSUb+YpfZY50bzlwptRiucyi6rckPNorCbC kjAIeXqtSriEm8GdRXEkHn4AWhJ9cl1sX7ls2YkY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiao Liang , Maoyi Xie , Kuniyuki Iwashima , Jakub Kicinski Subject: [PATCH 5.15 681/843] net: ip6_vti: require CAP_NET_ADMIN in the device netns for changelink Date: Tue, 21 Jul 2026 17:25:16 +0200 Message-ID: <20260721152421.376764832@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152405.946368001@linuxfoundation.org> References: <20260721152405.946368001@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maoyi Xie commit e2ac3b242c37dff323a964962e43854f4b1a2b79 upstream. vti6_changelink() operates on at most two netns, dev_net(dev) and the tunnel link netns t->net. They differ once the device is created in or moved to a netns other than the one the request runs in. The rtnl changelink path checks CAP_NET_ADMIN only against dev_net(dev), so a caller privileged there but not in t->net can rewrite a tunnel that lives in t->net. Gate vti6_changelink() on rtnl_dev_link_net_capable() at its top, before any attribute is parsed. Reported-by: Xiao Liang Closes: https://lore.kernel.org/netdev/CABAhCOSzP1vaThGV35_VnsRCb=87_CPjPVsTHbq905k8A+BuUg@mail.gmail.com/ Fixes: 61220ab34948 ("vti6: Enable namespace changing") Cc: stable@vger.kernel.org Signed-off-by: Maoyi Xie Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20260612085941.3158249-7-maoyixie.tju@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_vti.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -1052,6 +1052,9 @@ static int vti6_changelink(struct net_de struct __ip6_tnl_parm p; struct vti6_net *ip6n; + if (!rtnl_dev_link_net_capable(dev, net)) + return -EPERM; + ip6n = net_generic(net, vti6_net_id); if (dev == ip6n->fb_tnl_dev) return -EINVAL;