From patchwork Mon Jul 2 12:54:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1146661 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 983BEDFFAD for ; Mon, 2 Jul 2012 12:54:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750861Ab2GBMyn (ORCPT ); Mon, 2 Jul 2012 08:54:43 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:55797 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815Ab2GBMym (ORCPT ); Mon, 2 Jul 2012 08:54:42 -0400 Received: by qcro28 with SMTP id o28so2866329qcr.19 for ; Mon, 02 Jul 2012 05:54:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=TpiODIW3eBbHugxxUZTS1EIZrDNfCFbzIyF3BtoHx0M=; b=DRkhRXC7zYeavK9FS61Q/HP+kajOyJlT4JlrOuNaWL8/KPQRxjZlrjix33ginpeSeI F4qmI2GKMMzNjzVJOwTOQOgK5oiWp3xbQlp9J2XzqIXzvk6ZPUWPy8Xs2SAu+UyQvVFO nASdCUlD+rcHZNNrWv33NpyX8cnsGyTdff5VdLDazUS5Z0iA9/lbIbYYXcPQ3Bf+V0/7 XyVl3zZLfn3Z5D1PAbexk1knysyF8tDzMBUN9iDWc7lPC8RmpQ7WKfFDvPbjExfhoYjg e+wsnQGbK6dE8m3LpDcmE7earejZq5uQPkmPgHzT6//0TW8epEZeps5qKYuptxwMw/C+ oCng== Received: by 10.224.221.141 with SMTP id ic13mr23052246qab.2.1341233681739; Mon, 02 Jul 2012 05:54:41 -0700 (PDT) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id s9sm31072919qaa.7.2012.07.02.05.54.40 (version=SSLv3 cipher=OTHER); Mon, 02 Jul 2012 05:54:41 -0700 (PDT) Message-ID: <4FF19A0C.9010201@dev.mellanox.co.il> Date: Mon, 02 Jul 2012 08:54:36 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" , Daniel Klein Subject: [PATCH] opensm/osm_node_info_rec.c: Also handle non compliant SMA in ni_rcv_process_existing X-Gm-Message-State: ALoCoQkaguVIZpSEbFVYOsFDGs0xSPfphp8kw2JpX92RJUT8l06ZwVH8H+aFjTnrYigAJEclHppw Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org in case of NodeInfo.LocalPortNum > NodeInfo.NumPorts Signed-off-by: Hal Rosenstock --- opensm/osm_node_info_rcv.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c index 9375e36..12e7693 100644 --- a/opensm/osm_node_info_rcv.c +++ b/opensm/osm_node_info_rcv.c @@ -782,6 +782,17 @@ static void ni_rcv_process_existing(IN osm_sm_t * sm, IN osm_node_t * p_node, cl_ntoh64(p_ni->node_guid), cl_ntoh64(p_smp->trans_id), p_node->discovery_count); + if (port_num > p_ni->num_ports) { + OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D0C: " + "Existing %s node GUID 0x%" PRIx64 "is non-compliant " + "and is being ignored since the " + "local port num %u > num ports %u\n", + ib_get_node_type_str(p_ni->node_type), + cl_ntoh64(p_ni->node_guid), port_num, + p_ni->num_ports); + goto Exit; + } + /* If we haven't already encountered this existing node on this particular sweep, then process further. @@ -807,6 +818,7 @@ static void ni_rcv_process_existing(IN osm_sm_t * sm, IN osm_node_t * p_node, ni_rcv_set_links(sm, p_node, port_num, p_ni_context); +Exit: OSM_LOG_EXIT(sm->p_log); }