From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id AFAF3803F6 for ; Tue, 10 Nov 2026 16:33:02 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AAGVn3Q016246; Tue, 10 Nov 2026 19:31:49 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAGVn3Q016246 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1794328311; bh=GLzYZkCTA4IJZEDH+o0heQA8dRiVZK1S+ZlTG9VTPb0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=nis2gOj/ehEzDT2GZciLCBXgXEKJR+4obre14t+XV4n5QVZorwsGq3xclkgWxsrip n7NMpktXjP2AsPMcKJ5F1prit3o5D44jPMLQNNmyG8xwUGFVPESZsVU0AFkf+d03L9 n/PktJ0owL+mWaC+Bh4eYcTfmNdpoKGNZ1fJvSXGe/iIXSm2Uhwg7DWfGjWN6e+3a7 rNXMwi+Q2JQkhvCC3arouFYCaU/dx58CThmG6Qc1S8LxFeilLWqFRzUhrTeIlIe+Cv 0wUygujYXQ1lFWfga9fOS9v7eh1Q8LeaBO269LXJeEjYhkFQRkzD2tKxEuYhth6k2L QHGmyqzpZtLNQ== Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AAGVaQm016211 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 10 Nov 2026 19:31:36 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAGVaQm016211 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="mXpEw6yg" Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49febef74e3so15228105e9.0 for ; Tue, 10 Nov 2026 08:31:36 -0800 (PST) X-Gm-Message-State: APuU4Z+JNoYcQLOOR+j+MKg4uTxIbx5tQuNaUsogIEeERvVf/Lc8Obqq 7QC2LzQcDMobtQdAxR5yIkHWQ6K1W6rN7doNSC6BcWtJjlQlYG6XEdNOG4W2Jo67y6PFADmrlFT gSl0eDuqfuMqiyDEm4xaF2wKwCvVe3GEmIJuKhIsSr9Jk02lquv6EzA== X-Gm-Gg: AYBFou3RmLSFdkf/4WurRKAlE4yAE/AlcFoq+obIRDjveyH7wJP0jcMjZbzuYYV3xx3 NA4NzTKHBeZRlICKXQw3naA3vwYrKFdo9YXIWm6hTQSvgleqZjZqGNRKXTCerHMTuuIrYMyvvBQ IBCGCJ+SmzhjT284GSB91v6YuG4+dQQdK7DmV68oDxYhI25r7a9TSjdM0i2VcRSWIYDpm5gDzB6 CGWXm3+DNMtGgBm/YMv5Vnif/C1CF62EFSaFocFGGO571AVOcYvIS8ruZqo2VL6SXyxRSR3l6VT TkMin6sy6w== X-Received: by 2002:a05:600c:3b0a:b0:4a1:c27d:e1a8 with SMTP id 5b1f17b1804b1-4ba02348031mr55884265e9.10.1794328296224; Tue, 10 Nov 2026 08:31:36 -0800 (PST) X-Received: by 2002:a05:600c:3b0a:b0:4a1:c27d:e1a8 with SMTP id 5b1f17b1804b1-4ba02348031mr55883875e9.10.1794328295728; Tue, 10 Nov 2026 08:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794328295; cv=none; d=google.com; s=arc-20260327; b=BAg9UM+mQfYUXN8/cwWWA/Qq0qMOxfeJq8lJuZXi7Y80TXlZ/k1s3oJS1PX7ehnwLy 2tcoPZY92u8mjg3WcucxKY2BNs5X73sSqUwwqb9u3WjqLZAouBhL7qiELz9gJH0ccXlS X5kf+5dk684gD9StfSzNP21cwGNHkPESEdV/9X1ELQWqRbhBYlck8kDM/cs7hIGH023b YEbLEWtvSpr4w43H6ShcLkWzWzZzExRgoo/jQ1NRtmuXZ/j/7PZVpp+kgAHWp+5mJCEG BxTzbYz9t/3rtfH4APmSUz6MNY50KSyHK6iX4mYycHmfS4by8ZjhYlZce34MRbd1kv9k dk2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wVD+BmLMgJh/Vz09vTRAGeKKSJ4SnZ8WNZqtlbxFZ+g=; fh=ozrYJQ1t3QIP6s65KBq5xgJxiFM2qf+5wwn3ABTusyU=; b=E5lgMM+UDDkAEP2KKs3kCQAO4f04/cmAgBQFT1Ln2P6QwtUj945q4NOyLFMTrJpvm+ Cp3p95V074OMQiLhyohhSt+jNIc1WlguSj18t7BZfLKcAAjERBDuQft5SNwmrYhoHCf9 JQfZgV/kUf4YCIVXG8tD0DLlO9xOEMUC6I4cC+fruQtHCIktNYQlxXAB2zpuLglPauKz 1qrT8HnkP3HC5TXJeMJPFkXI9hBNC+2RpcNtxCOuzZ7CSHtiMbpvrMSy7Yym6QOwmgx3 ITb9aWLMwnKHg7el6yPyE+1WL6AtIava/S1ndogpMP+uUE+M6qwK07Q1mTjttmrjiJvy RuIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=mXpEw6yg; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4ba0204e1ffsor6804735e9.5.2026.11.10.08.31.35 for (Google Transport Security); Tue, 10 Nov 2026 08:31:35 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) client-ip=2a06:5b06:b600:300:4f78:6441:d0f1:22af; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=mXpEw6yg; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1794328295; x=1794933095; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wVD+BmLMgJh/Vz09vTRAGeKKSJ4SnZ8WNZqtlbxFZ+g=; b=mXpEw6yg4WsHRcwtpP14Ly+LZdZVHwz/bCCbikMvxZTvRuGjxY7KllWB1i2HUpYvAx id2lcIOcMq0szmqKe/TRVGCHLR3W8cOuvOCAcWSRLZ9/kWZY7U3Po8GNhvyOShIliiYn UjtIEGDpZ7fYoiEnta6JP9OBpVLXEb3tUCgrOHOc6USfQZbu3UF5CWAsspEzlS3etpnP qQ2sJ2Sh2VsXhvnylopIjOd74RzTgqbS3NXQgbXYw6xGp2WZK8/YcvjmHCC2WSCAN2Vw Wxmo4eUmxpfIo5TaibUxcJWJ2nlA6CcnSWAp57of4Cwdys3cGAamKcfVQ96xBbRosqnQ OILg== X-Received: by 2002:a05:600c:3544:b0:49e:65f2:db64 with SMTP id 5b1f17b1804b1-4ba0233cbd1mr60192815e9.5.1794328295311; Tue, 10 Nov 2026 08:31:35 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:4f78:6441:d0f1:22af]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba01fdac9csm108580235e9.0.2026.11.10.08.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2026 08:31:34 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Tue, 10 Nov 2026 17:31:27 +0100 Message-ID: <20261110163130.2776687-4-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261110163130.2776687-1-den@openvz.org> References: <20261110163130.2776687-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 3/6] ms/ip6: vti: Use ip6_tnl.net in vti6_changelink(). X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Kuniyuki Iwashima ip netns add ns1 ip netns add ns2 ip -n ns1 link add vti6_test type vti6 remote ::1 local ::2 key 7 ip -n ns1 link set vti6_test netns ns2 ip -n ns2 link set vti6_test type vti6 remote ::3 local ::4 key 9 ip netns del ns2 ip netns del ns1 [ 132.495484] ------------[ cut here ]------------ [ 132.497609] kernel BUG at net/core/dev.c:12376! Commit 61220ab34948 ("vti6: Enable namespace changing") dropped NETIF_F_NETNS_LOCAL from vti6 devices. A vti6 tunnel can then move through IFLA_NET_NS_FD. After the move dev_net(dev) points at the new netns while t->net stays at the creation netns. vti6_changelink() and vti6_update() still use dev_net(dev) and dev_net(t->dev). They unlink from one per netns hash and relink into another. The creation netns is left with a stale entry. cleanup_net() of that netns later walks freed memory. Reachable from an unprivileged user namespace (unshare --user --map-root-user --net). Cross tenant scope on container hosts. Fixes: 61220ab34948 ("vti6: Enable namespace changing") Reported-by: Maoyi Xie Reviewed-by: Eric Dumazet Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20260521130555.3421684-2-maoyixie.tju@gmail.com Signed-off-by: Paolo Abeni (cherry picked from commit 11b326fb0a374f4654f9be22d0f0f7abd9f7d3fe) https://virtuozzo.atlassian.net/browse/VSTOR-154348 Feature: fix ms/net Signed-off-by: Denis V. Lunev --- net/ipv6/ip6_vti.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index 0081650fae0c..6cf5d8f01c31 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -728,10 +728,11 @@ vti6_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p, static int vti6_update(struct ip6_tnl *t, struct __ip6_tnl_parm *p, bool keep_mtu) { - struct net *net = dev_net(t->dev); - struct vti6_net *ip6n = net_generic(net, vti6_net_id); + struct net *net = t->net; + struct vti6_net *ip6n; int err; + ip6n = net_generic(net, vti6_net_id); vti6_tnl_unlink(ip6n, t); synchronize_net(); err = vti6_tnl_change(t, p, keep_mtu); @@ -1037,11 +1038,12 @@ static int vti6_changelink(struct net_device *dev, struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack) { - struct ip6_tnl *t; + struct ip6_tnl *t = netdev_priv(dev); + struct net *net = t->net; struct __ip6_tnl_parm p; - struct net *net = dev_net(dev); - struct vti6_net *ip6n = net_generic(net, vti6_net_id); + struct vti6_net *ip6n; + ip6n = net_generic(net, vti6_net_id); if (dev == ip6n->fb_tnl_dev) return -EINVAL; -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel