[Devel] [PATCH hci-8.1] net/ip_gre: fix a host panic on a received ERSPAN packet

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Nov 10 19:35:10 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> Commit a1049e020cdf ("ve/net/gre: Disable ERSPAN support in ip_gre
> module") compiled erspan_net_ops out under CONFIG_VE but left the ERSPAN
> receive and ICMP error paths in place. erspan_net_id is then never
> assigned and stays 0, and net_generic(net, 0) does not return NULL: it
> returns the length word of struct net_generic, which ptr[0] overlays.
> ip_tunnel_lookup() passes its NULL check and reads itn->tunnels[] in
> the first page. Once ip_gre is loaded, any GRE packet with protocol
> ETH_P_ERSPAN or ETH_P_ERSPAN2 delivered to the node panics it in
> softirq, and so does an ICMP error quoting such a header. The packet
> can come from the network or from container root with a raw socket.
> 
> Return a NULL itn for ERSPAN under CONFIG_VE, so both paths miss the
> lookup and handle the packet as one for a tunnel that does not exist.
> 
> Fixes: a1049e020cdf ("ve/net/gre: Disable ERSPAN support in ip_gre module")
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-154362
> Feature: net: disable ERSPAN support in ip_gre module
> 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/20261110163110.2776207-1-den@openvz.org?part=1




More information about the Devel mailing list