From owner-svn-src-all@freebsd.org Mon Aug 31 15:30:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73A543C4735; Mon, 31 Aug 2020 15:30:26 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BgDfn52Vtz4fDm; Mon, 31 Aug 2020 15:30:25 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from disco.vangyzen.net (unknown [70.97.188.230]) by smtp.vangyzen.net (Postfix) with ESMTPSA id C2D1156487; Mon, 31 Aug 2020 10:30:17 -0500 (CDT) Subject: Re: svn commit: r364991 - head/contrib/ofed/opensm/opensm To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008311526.07VFQ2Bo010173@repo.freebsd.org> From: Eric van Gyzen Message-ID: <99751146-ed8f-b901-e02a-e94c898e8cd0@vangyzen.net> Date: Mon, 31 Aug 2020 10:30:13 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <202008311526.07VFQ2Bo010173@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BgDfn52Vtz4fDm X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of eric@vangyzen.net designates 2607:fc50:1000:7400:216:3eff:fe72:314f as permitted sender) smtp.mailfrom=eric@vangyzen.net X-Spamd-Result: default: False [-2.43 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEFALL_USER(0.00)[eric]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; NEURAL_HAM_LONG(-0.94)[-0.937]; DMARC_NA(0.00)[vangyzen.net]; NEURAL_HAM_SHORT(-0.21)[-0.214]; NEURAL_HAM_MEDIUM(-0.97)[-0.975]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36236, ipnet:2607:fc50:1000::/36, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2020 15:30:26 -0000 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) { >