svn commit: r325805 - head/sys/contrib/rdma/krping

Hans Petter Selasky hselasky at FreeBSD.org
Tue Nov 14 14:39:39 UTC 2017


Author: hselasky
Date: Tue Nov 14 14:39:37 2017
New Revision: 325805
URL: https://svnweb.freebsd.org/changeset/base/325805

Log:
  Set the default VNET in krping before calling ifunit_ref(). Else using IPv6
  link-local addresses when VIMAGE is enabled will cause a so-called NULL
  pointer dereferencing issue.
  
  Sponsored by:	Mellanox Technologies
  MFC after:	1 week

Modified:
  head/sys/contrib/rdma/krping/krping.c

Modified: head/sys/contrib/rdma/krping/krping.c
==============================================================================
--- head/sys/contrib/rdma/krping/krping.c	Tue Nov 14 14:31:02 2017	(r325804)
+++ head/sys/contrib/rdma/krping/krping.c	Tue Nov 14 14:39:37 2017	(r325805)
@@ -3185,7 +3185,9 @@ krping_get_ipv6_scope_id(char *name)
 
 	if (name == NULL)
 		return (0);
+	CURVNET_SET_QUIET(TD_TO_VNET(curthread));
 	ifp = ifunit_ref(name);
+	CURVNET_RESTORE();
 	if (ifp == NULL)
 		return (0);
 	retval = ifp->if_index;


More information about the svn-src-all mailing list