[Devel] [PATCH RHEL7 COMMIT] ve/net: ipip: fix crash on newlink if VE_FEATURE_IPIP is disabled

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 24 03:30:30 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.18.2.vz7.14.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.18.2.vz7.14.19
------>
commit c935ea6ca0d4d0aeed3857bff8d507f2f2a63176
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Fri Jun 24 14:30:30 2016 +0400

    ve/net: ipip: fix crash on newlink if VE_FEATURE_IPIP is disabled
    
    In this case net_generic returns NULL. We must handle this gracefully.
    
    Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
    Tested-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
---
 net/ipv4/ipip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 7842dcb..b1004fb 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -357,6 +357,9 @@ static int ipip_newlink(struct net *src_net, struct net_device *dev,
 {
 	struct ip_tunnel_parm p;
 
+	if (net_generic(dev_net(dev), ipip_net_id) == NULL)
+		return -EACCES;
+
 	ipip_netlink_parms(data, &p);
 	return ip_tunnel_newlink(dev, tb, &p);
 }


More information about the Devel mailing list