Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2020 10:30:13 -0500
From:      Eric van Gyzen <eric@vangyzen.net>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r364991 - head/contrib/ofed/opensm/opensm
Message-ID:  <99751146-ed8f-b901-e02a-e94c898e8cd0@vangyzen.net>
In-Reply-To: <202008311526.07VFQ2Bo010173@repo.freebsd.org>
References:  <202008311526.07VFQ2Bo010173@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 8/31/20 10:26 AM, Eric van Gyzen wrote:
> Author: vangyzen
> Date: Mon Aug 31 15:26:01 2020
> New Revision: 364991
> URL: https://svnweb.freebsd.org/changeset/base/364991
> 
> Log:
>    opensm: Fix a possible dereference of a NULL pointer
>    

Submitted by:	bret_ketchum@dell.com

>    Reported by:	Coverity
>    Reviewed by:	hselasky, kib
>    MFC after:	2 weeks
>    Sponsored by:	Dell EMC Isilon
>    Differential Revision:	https://reviews.freebsd.org/D26233
> 
> Modified:
>    head/contrib/ofed/opensm/opensm/osm_perfmgr.c
> 
> Modified: head/contrib/ofed/opensm/opensm/osm_perfmgr.c
> ==============================================================================
> --- head/contrib/ofed/opensm/opensm/osm_perfmgr.c	Mon Aug 31 15:07:15 2020	(r364990)
> +++ head/contrib/ofed/opensm/opensm/osm_perfmgr.c	Mon Aug 31 15:26:01 2020	(r364991)
> @@ -1311,6 +1311,14 @@ static void perfmgr_check_overflow(osm_perfmgr_t * pm,
>   		cl_plock_acquire(&pm->osm->lock);
>   		p_node =
>   		    osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid));
> +		if (!p_node) {
> +			OSM_LOG(pm->log, OSM_LOG_ERROR,
> +				"ERR 5407: Node \"%s\" (guid 0x%" PRIx64
> +				") no longer exists so removing from PerfMgr"
> +                                " monitoring\n",
> +				mon_node->name, mon_node->guid);
> +			goto Exit;
> +		}
>   		lid = get_lid(p_node, port, mon_node);
>   		cl_plock_release(&pm->osm->lock);
>   		if (lid == 0) {
> @@ -1402,6 +1410,14 @@ static void perfmgr_check_pce_overflow(osm_perfmgr_t *
>   		cl_plock_acquire(&pm->osm->lock);
>   		p_node =
>   		    osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid));
> +		if (!p_node) {
> +			OSM_LOG(pm->log, OSM_LOG_ERROR,
> +				"ERR 5407: Node \"%s\" (guid 0x%" PRIx64
> +				") no longer exists so removing from PerfMgr"
> +                                " monitoring\n",
> +				mon_node->name, mon_node->guid);
> +			goto Exit;
> +		}
>   		lid = get_lid(p_node, port, mon_node);
>   		cl_plock_release(&pm->osm->lock);
>   		if (lid == 0) {
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99751146-ed8f-b901-e02a-e94c898e8cd0>