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 F03AA80E7E for ; Thu, 5 Nov 2026 14:39: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 6A5EcYh7005695; Thu, 5 Nov 2026 17:38:35 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5EcYh7005695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793889519; bh=gQHAR6+9yGtDCL9EYciJvBnYIA69fznmwoKsLd6tDJQ=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=Z/Q4cUTrTeOxfcaS5T50zRrk4Iebf8cHQLJyWMey+iOyz45scaljIIOAi3S5wuvWB r7eZYNk8wvObfAVwu460UnrI2b1xdpQgm4sUYyHsFtuZnR7vMXckNyHhayTWERgt1i 9yAADbHIYq0zZEtMaOCwsduprfabMCJvn0T4DUaBhzhGGkofQPwpHMsVajzNHz/izi zXLjRN68ShBk8zdWVnNYjwi/Jbhae/hX1iMfnCbzSQ3fCtuqjiKKx7fhgUThW/Rl1u NqafcMSoWm3gYOopf2NloUaYqX2rzAqUzqxPEjTjxy+WPZy0JU/+se/UEe73f81dfI JYL4imNFQ2Ssg== Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A5EcWaL005691 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 5 Nov 2026 17:38:32 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5EcWaL005691 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="KkmPB687" Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5be3e0d9c34so1009325e87.3 for ; Thu, 05 Nov 2026 06:38:32 -0800 (PST) X-Gm-Message-State: APuU4Z/g55QwTaqQCGvV0JlbMikvjuWZUPAffCJ/NvcJfjkCexCsexbx 5xMtexHorZ4XL9nPOt/6JuEUf84CJaod4Su5KkC++sS2EhPxsNn2+FJQJKQaGyISHkNhI0C5ANb ODYHEj41aH5B3U7xT95wizuEtPsf4KugnJ+N9Vp/oyyGqiWAdzXY39w== X-Gm-Gg: AYBFou3cWxu3ReX3/PWMp2CFsQt1jhoiNgxookxLcr+HueUys1RnAfsNQHquv+TrMpV 3ngssL0U7Gf8Z6N0FLBVa9xiFzBNidZzRw165usnkWA35sVyVji+DrJdJ2wSMK2IM2DQr+AzhQR B1N7SMcQx648rbSk3fEBkGc0ZgyCudBBkLQGTOvyHNPYIhPcjXkE1VFfVtyZ/Yiejkm2mDOAqDX y+eQckrLPFo5xO7HWwqBWAwmLTJWMXFG2yuRX5J+UG2WHL8Ecd2lWHsxLcTitFxZrMjhJ7ZGFJs 0/PmQF2+YQ== X-Received: by 2002:a05:6000:4559:b0:48e:752b:9f90 with SMTP id ffacd0b85a97d-48e752ba019mr26317645f8f.38.1793888262383; Thu, 05 Nov 2026 06:17:42 -0800 (PST) X-Received: by 2002:a05:6000:4559:b0:48e:752b:9f90 with SMTP id ffacd0b85a97d-48e752ba019mr26317607f8f.38.1793888261974; Thu, 05 Nov 2026 06:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793888261; cv=none; d=google.com; s=arc-20260327; b=fUohbn0vUaYOeEPziHjZGMRekwAX3PsUshuaCN905tnQCG1XcsnxrXz4BXKYD5ezog 6pEzPjzjzqsyg4LbmyRVonKINOIvoN4WZquu7HoCUm1Zio/H2bB5j12fMHBKfwiQHFQU xwDHH7LQdZ+AFlqFVE2n6gA9aSVMD99Tw8+0QiXX1a08+UfV7bnwafsTNsHfLfl8OEYm pt3lmgLPHLmjTslNH8NM9Krc6Rcqmayg7IJa/0bbW+fN74bcIpc4xI9iAPRKD+BZpTeq V2gjdCQC2UB9HoLrGpmU/DECLGJJsvWesnAojsKkPnJ6/hJgYCgf+Yv/gvOjsno2/dsM 8LwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Ls5VahU8c+vpcCYHz8lG8i229/cqZnSli6+/3LZDtlo=; fh=ozrYJQ1t3QIP6s65KBq5xgJxiFM2qf+5wwn3ABTusyU=; b=j0Aetw62HKfyp40fB/oHy0oY3SgeDYKRb2h//81O7P+aja+GkIXyGcQhHi1ug54HMW FClDxoAxCsK0is7DLjDcV+Idq7EjwtpYie+W4i96iuJhKrrxO5tO25ZLm2CA42hhzaQb iXVCTwXT2igsV0FipYlGOR5dyWuIGjnYs0AzVguMkf51q/oCJzyOBaQ8l8zZIZmPNrLw b0hYSC7qf+Nztzhb+zbhiJv+55xUi7LUTHWGglMRMyu+DPMOA+YaXOdEAsxv8Y3r6Lwk y9lHsRiAyQAtRY4OL/j5wGntxYWVH9wplixz/5CIeMVMHBPJAGATqfkUFPZP7Hcj2QA7 4UKg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=KkmPB687; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:3848:9c8a:8cf7:6236 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 ffacd0b85a97d-48fed552427sor1129446f8f.17.2026.11.05.06.17.41 for (Google Transport Security); Thu, 05 Nov 2026 06:17:41 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:3848:9c8a:8cf7:6236 as permitted sender) client-ip=2a06:5b06:b600:300:3848:9c8a:8cf7:6236; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=KkmPB687; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:3848:9c8a:8cf7:6236 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=1793888261; x=1794493061; darn=openvz.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=Ls5VahU8c+vpcCYHz8lG8i229/cqZnSli6+/3LZDtlo=; b=KkmPB687cPJewhL03S1jTE6G1Ojb08+/MZlyxblZyNpxZClXh7DBRdlDnE7iS0h4Ua Dmk6hoMc7wQSIl6iqw9CVsMJYYbaZjhi1X3SgdZ0rWi0OnC0QihQHb0VT7tpK+OhDJ+W T7ijSS7YAIXpBjIC3SA01OTOaRPd/SeyNhrQnClcMnvho/3s5LiNdWjtTWCF9blwBJSy /AYlrsh09aG3xj60wpo4BlAbY8NWrQZgVDykazGtyM5TxQq16sBnYEV2TaIrAvHsPJeZ 2PO88Syv2sauZoroi+NK+FC9ZTPuiQwuGtkr7m6c8hmaUl7V+fK5SJOIt+RPKQikzRUu yjmg== X-Received: by 2002:a5d:6950:0:b0:48e:3bc4:a367 with SMTP id ffacd0b85a97d-48e6e2fab84mr32691185f8f.33.1793888261414; Thu, 05 Nov 2026 06:17:41 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:3848:9c8a:8cf7:6236]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48fece998absm11157097f8f.22.2026.11.05.06.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 06:17:31 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Thu, 5 Nov 2026 15:17:26 +0100 Message-ID: <20261105141726.2594661-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1] net/ip6_gre: fix a host panic deleting ip6gre moved into a CT without ipgre 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 ip6gre_init_net() frees the ip6gre_net of a netns whose VE lacks VE_FEATURE_IPGRE. Only the fallback ip6gre0 is netns_immutable, so the host can move any other ip6gre tunnel into such a container with "ip link set t6 netns ". ip6gre_dellink() looks ign up in dev_net(dev) and reads ign->fb_tunnel_dev, so the node panics when container root deletes the tunnel or when the container stops and cleanup_net() deletes it: BUG: kernel NULL pointer dereference, address: 0000000000000410 RIP: 0010:ip6gre_dellink+0x37/0x60 [ip6_gre] default_device_exit_batch+0x8e/0x110 cleanup_net+0x27a/0x490 Take ign from t->net, the netns the tunnel was created in and is hashed in, as changelink, uninit and the ioctl path already do and as upstream does since commit b7c0d393e108 ("ip6_gre: Unlink ip6gre_tunnel_unlink() from ->dellink()."). The fallback device cannot leave its netns, so the fb_tunnel_dev comparison keeps its meaning. ip6gretap and ip6erspan have no ->dellink and are not affected. Fixes: 46c13c45f25a ("net/gre: Consider VE_FEATURE_IPGRE on new net creation") https://virtuozzo.atlassian.net/browse/VSTOR-153615 Feature: ve: per-CT features management Signed-off-by: Denis V. Lunev --- net/ipv6/ip6_gre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 9060cb17bf25..19682f976c39 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -2124,8 +2124,8 @@ static int ip6gre_changelink(struct net_device *dev, struct nlattr *tb[], static void ip6gre_dellink(struct net_device *dev, struct list_head *head) { - struct net *net = dev_net(dev); - struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); + struct ip6_tnl *t = netdev_priv(dev); + struct ip6gre_net *ign = net_generic(t->net, ip6gre_net_id); if (dev != ign->fb_tunnel_dev) unregister_netdevice_queue(dev, head); -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel