[Devel] [PATCH hci-8.1] net/ip6_gre: fix a host panic deleting ip6gre moved into a CT without ipgre
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Thu Nov 5 17:43:16 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> 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 <CT>". 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 <den at openvz.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261105141726.2594661-1-den@openvz.org?part=1
More information about the Devel
mailing list