From patchwork Mon Feb 4 13:20:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 2092011 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AB2913FD56 for ; Mon, 4 Feb 2013 13:20:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754599Ab3BDNUs (ORCPT ); Mon, 4 Feb 2013 08:20:48 -0500 Received: from mail-vb0-f45.google.com ([209.85.212.45]:36483 "EHLO mail-vb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754656Ab3BDNUp (ORCPT ); Mon, 4 Feb 2013 08:20:45 -0500 Received: by mail-vb0-f45.google.com with SMTP id p1so3842565vbi.18 for ; Mon, 04 Feb 2013 05:20:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=zBV4d7jMTI3jMf3FYyfsQy6ONunP4oMWcylGrhSLD3w=; b=CbE8bGEJFrWZn1CEn5vey/JjrMBZUGXnu53IuyUuGTuHIWKTWlylzc9C8UHHRsoP+3 Xnhg9JxAyBpP38tOYYIdqNWkSWkLr+C/C3HHwoViAt+K4ox+9D/sKAGrrpKVjUnnzo5f AFUw+MVHVIcyOCHi637iZmwjL+jQufphMK4AcGin2VimHFKsOFX02f8VJfleAyXnkoD1 Fs/U/xCUBW661jVu5mCq3xRKjK1qmjCgvwIlq9dzsLHIxEOwCWPuE8GN8BJIqSLekjrP 1teXu19INaort726SYGTDDi1xB7eYEDMSlaHpPHwoLjocgVY71avuumwfhRnOCmgJlP/ RhEg== X-Received: by 10.220.149.200 with SMTP id u8mr20801851vcv.7.1359984044983; Mon, 04 Feb 2013 05:20:44 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPS id cd16sm21650175vdb.0.2013.02.04.05.20.43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Feb 2013 05:20:43 -0800 (PST) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Vincent Ficet , Alex Netes Subject: [PATCH] opensm/osm_ucast_ftree.c: fix opensm segfault in osm_ucast_ftree.c Date: Mon, 4 Feb 2013 15:20:09 +0200 Message-Id: <1359984011-30753-8-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359984011-30753-1-git-send-email-alexne@mellanox.com> References: <1359984011-30753-1-git-send-email-alexne@mellanox.com> X-Gm-Message-State: ALoCoQkQp+LTvSNnGAUTfodLm29/9hn5zoF0caCJ6bNKf7BocH4SdJi1FNU7cwNR2Mvfln737oLB Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Vincent Ficet Instead of unconditionnally assigning valid port numbers to the lft table, it now leaves 'holes' filled with the default value OSM_NO_PATH (=255) Accessing these invalid/unassigned LFT entries yields invalid addresses starting with 0xff as in the above example. After reverting commit 81dade3aeb1d5c80472a4f9fef55e9916bb38d3a and applying the above patch, we have not observed any multicast loop nor any segmentation fault. Reproducing this bug using ibsim is easy: 1/ Load a fat-tree topology 2/ Unlink a leaf switch 3/ Start opensm (configured with the ftree routing engine) 4/ Relink the leaf switch Signed-off-by: Vincent Ficet Signed-off-by: Alex Netes --- opensm/osm_ucast_ftree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c index c81e7a3..932ec6a 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -4171,6 +4171,9 @@ static int construct_fabric(IN void *context) OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE, "Max LID in switch LFTs: %u\n", p_ftree->lft_max_lid); + /* Build the full lid matrices needed for multicast routing */ + osm_ucast_mgr_build_lid_matrices(&p_ftree->p_osm->sm.ucast_mgr); + Exit: if (status != 0) { OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,