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

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 24 03:30:31 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 32763e4fcaf5b502efafd257fea4e4b0436ea0fd
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Fri Jun 24 14:30:30 2016 +0400

    ve/net: sit: fix crash on newlink if VE_FEATURE_SIT 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/ipv6/sit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 2a73b52..6b1ae3b 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1441,6 +1441,9 @@ static int ipip6_newlink(struct net *src_net, struct net_device *dev,
 #endif
 	int err;
 
+	if (net_generic(net, sit_net_id) == NULL)
+		return -EACCES;
+
 	nt = netdev_priv(dev);
 	ipip6_netlink_parms(data, &nt->parms);
 


More information about the Devel mailing list