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 40B59803F6 for ; Tue, 10 Nov 2026 16:32:55 +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 6AAGVexl016232; Tue, 10 Nov 2026 19:31:42 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAGVexl016232 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1794328304; bh=7raPE23PrNhqFwsOcjlqq8lIkSLcTXFJLQJnM6/T5Fs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=CN2JRx18/7TrV//GObCmmCi4lvJI4NtS+ULrfefPZmAwg5lbNw9JlMEi3nBdB1i1C 6+koxObCLA4sUNODtQNpbyQx0JukHwHpgeJbbafF4WuRf2Fmto6b72Fh/Co+V/tPgq F9SRS9BI9ZJ63wCUjN0lvbR3MJVgbPud3x6QmLXJo3UuUt2wt9DlKtR5OH3YGDX3iS es4RkI+f1OfeJ2WPdY/3OVq9QiSVtNWEmwXV0F+x8sTjxDwvw7MmHDH0xZaR2gZIdA dLaJZew7MsesYsbItoc8bOlWGb7MvTiqqgy+JBtuSoYogDYQOTnSykxVqTELJt4ZHb WI07Jg0qyyD1A== Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AAGVYtO016201 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 10 Nov 2026 19:31:35 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAGVYtO016201 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="QCRlZQzD" Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4a70b42bab0so23837465e9.1 for ; Tue, 10 Nov 2026 08:31:35 -0800 (PST) X-Gm-Message-State: APuU4Z8UVmLVpHD+5chBnQzaQczvqrOL4qQEmt+OIPE/kc6vjmD3KQiS cBIzTYmpxODNtQ6WWMJrhG61H/ibtuQLCbzSDURRJN6G7sgwDlvenxJ4FtEbhqln0ppExK5QMTB F/gYaO69o38NuX1h5OU3sG1QIS5vH246WVEI4MaHgqoiDKWHiUCDAKQ== X-Gm-Gg: AYBFou2XuP+8cRI7Vjhq3V69Rxemk7YR74aOW60KktBrfRnUl/49PPcpsMy6csy08ym FnWihyqIdkfK57lDi4L+xpRymTVwdi/ECtDXjC/HPJA1JARDnO+kzSU+HyXU8G/PqnAl/3w3beh 1wKw7pM/ExmNTauBWJocPtq0v1DXxrBT5pwOKQwBCqNvHRv8o2UJ/gGepOy+OGH80Qldf5ZU3l2 O5Pk1gCluhk85aWwJGlFAGnbQ1iwuYcQ7GiUxIfN8lPEMSyO/M+XzpB5moglOH2lEwceRvmUDoC fZg/Ew89vQ== X-Received: by 2002:a05:600c:8b2a:b0:4a0:20b4:ba93 with SMTP id 5b1f17b1804b1-4ba02351468mr51623115e9.16.1794328294441; Tue, 10 Nov 2026 08:31:34 -0800 (PST) X-Received: by 2002:a05:600c:8b2a:b0:4a0:20b4:ba93 with SMTP id 5b1f17b1804b1-4ba02351468mr51622715e9.16.1794328294074; Tue, 10 Nov 2026 08:31:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794328294; cv=none; d=google.com; s=arc-20260327; b=XoHI4Z65U8C7Hla9hUDuTgQSl8B4Ja9FR5TwMrx7P2XTfHyKFphyDDslC5ruZSiwMQ 6U+WBusKeauislY/Uc05q/p/RO2LeuDBnE2ECizJd9I0voia85SWl5z7EP3PQfFGHt/r DFoBwv5dQZq6qzCJ9J6A7A2MBW1Nc6Nft798i2cbYlIXJ/CWZHjcRhC7L0vkIa1MTx74 R4YpW3TO5ekWOdwzFiGVs2AzHhIAL3DFCuG2/VWXERQfJhq8RYDN1idhleRXz8Qioszs Qvx4RUZizClLJ7x9QE4VuGVkitlERbiDqKgbvjLrJ/lKHKMw21Qdmr1BqVpfTW7tBIEo VcFw== 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=ggUcXKXGolNAF04+bU4SVaYilt79DmnrOWDA6FDYuNg=; fh=ozrYJQ1t3QIP6s65KBq5xgJxiFM2qf+5wwn3ABTusyU=; b=Gn+KxoHTjxVZUtopg4M3WdzTdSuPPBpzzzJAE/XnF5FwiH/KqBsXGaAqrze7pU2h2M duAhNYWlRuS4KAHmV51e9jyfof1TAt2ZI+HCzDafyVjlAlacQfyOaLq23ZGxzqj/dX2E uEktzZrNlIdw8+Q9AO9RhtoULCVXqJKH9OrjtWHse3qhMsxCyCM7Ln+dIj1WAUIaS15k w0R25R1vrPY0tbpBDt2k4dPOMTYFsq0pI/A5PSGXNpb3L+4ocHxuWjm5A45Cp0UMsUP3 C6RKfrn/4tWbEuIy1bBq0IiS1ouG6FnrFVO604d5/hS8V27e2m2eqfPh9oL2L8xSLzzm EeSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=QCRlZQzD; 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-4ba01fddae8sor9191605e9.3.2026.11.10.08.31.34 for (Google Transport Security); Tue, 10 Nov 2026 08:31:34 -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=QCRlZQzD; 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=1794328294; x=1794933094; 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=ggUcXKXGolNAF04+bU4SVaYilt79DmnrOWDA6FDYuNg=; b=QCRlZQzDrjt5mmxRI3hkgjS3E5vIyHN03+uYICBeLRjCQskSrEaIUL65Vg/UqkPdqA azVqAT5ZDcMrWfsSsyvNI11UMuDhxEoi4FxbnrQxyRdaqEGHZFk2MDmq/3j2Op900wVu yFBeQWeSPxm9KJZ9IiGz0BRA4lMLyrXefuTW1+nahqtU5YB17Xf3peImUu/wJVaTUBkV SWEcq6h8fZiagtm84INbmNil1IAPw6bgcjPEV1fgRnIDgLQrhICre5Dh3XkdiGFsov3J z466ph52P8kxfoaaxXOqbBsA3s9JevqoU2OUMA4IfIhjp3FCVS08uWJodYOeCipyhOLD fwaQ== X-Received: by 2002:a05:600c:8b2a:b0:4a0:20b4:ba93 with SMTP id 5b1f17b1804b1-4ba02351468mr51622335e9.16.1794328293608; Tue, 10 Nov 2026 08:31:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2026 08:31:33 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Tue, 10 Nov 2026 17:31:25 +0100 Message-ID: <20261110163130.2776687-2-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 1/6] net/ip6_tunnel: fix a host panic deleting ip6tnl moved into a CT without ipip 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: Denis V. Lunev ip6_tnl_init_net() frees the ip6_tnl_net of a netns whose VE lacks VE_FEATURE_IPIP. Only the fallback ip6tnl0 is netns_immutable, so the host can move any other ip6tnl tunnel into such a container with "ip link set t6 netns ". ip6_tnl_dellink() looks ip6n up in dev_net(dev) and reads ip6n->fb_tnl_dev, so the node panics on a NULL pointer dereference when container root deletes the tunnel, when the container stops and cleanup_net() deletes it, or when ip6_tunnel is unloaded. Take ip6n from t->net, the netns the tunnel was created in and is hashed in, as changelink, uninit and the ioctl path already do. The fallback device cannot leave its netns, so the fb_tnl_dev comparison keeps its meaning. Fixes: 94e61c310587 ("net/ip6ip: Consider VE_FEATURE_IPIP on new net creation") https://virtuozzo.atlassian.net/browse/VSTOR-154346 Feature: ve: per-CT features management Signed-off-by: Denis V. Lunev --- net/ipv6/ip6_tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 9694480cdaff..a7667de2c451 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -2095,8 +2095,8 @@ static int ip6_tnl_changelink(struct net_device *dev, struct nlattr *tb[], static void ip6_tnl_dellink(struct net_device *dev, struct list_head *head) { - struct net *net = dev_net(dev); - struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); + struct ip6_tnl *t = netdev_priv(dev); + struct ip6_tnl_net *ip6n = net_generic(t->net, ip6_tnl_net_id); if (dev != ip6n->fb_tnl_dev) unregister_netdevice_queue(dev, head); -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel