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 4B0DB437473 for ; Mon, 20 Jul 2026 15:56:26 +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=1784562987; cv=none; b=PAazwC3FUyKoh9RDU0P2KMKdYy3Me5VT82KqgKwYFQeRc53Sq0a9DzyA13vl7ibF55RjvTVq9q1+4RBBZmr57f6JNoATOkAP13Z2+OynFFVKM49wje4vLmnhXbejAciItdvy+wX3KFmmZjczggMKic8HKHrxrermfnjWLjdUp9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784562987; c=relaxed/simple; bh=KaFmlfTNh2+BnENV6aJyO2dXq9vBEKwTFAWCdwAUlQY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=PIq6uo/dTobj0P+GJqd7x9izXU6e0luyGMtEfmgIho+mo918YsGQcEvuVfqTE1YgiqLR1lN0oUeSD2j89bDlNxX0kJu1mIoLSCz5cdZj3qadk1axPCy+0lzEvIak2WW0r8bX9IOvm2gdFWlJXj1TsOgkEB3/sWHUO8CEWsOVuS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RtkxuvKu; 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="RtkxuvKu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B18D71F000E9; Mon, 20 Jul 2026 15:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784562986; bh=no+fEyUwxRcWrRQXbXRqBNtvvVuSjkhdXPHIo1MJJB4=; h=Subject:To:Cc:From:Date; b=RtkxuvKuWuuehq+6Rje5p/8DZxMN+MvDARpnKNBOohHw5MtFvTn2YAkf/8ik37Mes +CsVxXSfMYuVKiooZoRRDtZ+j1na6Ifg4WaSglB0LK1UlIt+jw7MbqbUOg5wFnd2sP yzlTUtLTukicwKukCnhuYZd2Si/WHLkTNu2rFGTk= Subject: FAILED: patch "[PATCH] net: ip6_tunnel: require CAP_NET_ADMIN in the device netns" failed to apply to 6.6-stable tree To: maoyixie.tju@gmail.com,kuba@kernel.org,kuniyu@google.com,shaw.leon@gmail.com Cc: From: Date: Mon, 20 Jul 2026 17:53:23 +0200 Message-ID: <2026072023-majesty-rubbing-2664@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 2496fa0b7d180b3ad356b514e7ff93bb14e6140a # git commit -s git send-email --to '' --in-reply-to '2026072023-majesty-rubbing-2664@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 2496fa0b7d180b3ad356b514e7ff93bb14e6140a Mon Sep 17 00:00:00 2001 From: Maoyi Xie Date: Fri, 12 Jun 2026 16:59:38 +0800 Subject: [PATCH] net: ip6_tunnel: require CAP_NET_ADMIN in the device netns for changelink ip6_tnl_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 ip6_tnl_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: 0bd8762824e7 ("ip6tnl: add x-netns support") Cc: stable@vger.kernel.org Signed-off-by: Maoyi Xie Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20260612085941.3158249-5-maoyixie.tju@gmail.com Signed-off-by: Jakub Kicinski diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 73fc5a0b8203..d7c90a8533ec 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -2103,6 +2103,9 @@ static int ip6_tnl_changelink(struct net_device *dev, struct nlattr *tb[], struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); struct ip_tunnel_encap ipencap; + if (!rtnl_dev_link_net_capable(dev, net)) + return -EPERM; + if (dev == ip6n->fb_tnl_dev) { if (ip_tunnel_netlink_encap_parms(data, &ipencap)) { /* iproute2 always sets TUNNEL_ENCAP_FLAG_CSUM6, so