From patchwork Wed Feb 20 19:02:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2168831 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 A6F453FD4E for ; Wed, 20 Feb 2013 19:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934607Ab3BTTC4 (ORCPT ); Wed, 20 Feb 2013 14:02:56 -0500 Received: from mail-ia0-f176.google.com ([209.85.210.176]:50184 "EHLO mail-ia0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933973Ab3BTTCz (ORCPT ); Wed, 20 Feb 2013 14:02:55 -0500 Received: by mail-ia0-f176.google.com with SMTP id i18so7309499iac.7 for ; Wed, 20 Feb 2013 11:02:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=VCuGNBDaSdVI9MnAd8PITwvDLRccvobhwhgl2GA9gSo=; b=SRCBumR2J90C88oMtaVtluBRD5pga7rqy3YFA4LUVE2ruQOYKzUY/NR4x9wSRlyb0o 3jykJB+NGq+zwXIfrq18vjZKF6NsE/4dPFuIqhZ68D7QqlnHH2r8pT8NKqi7Kkq+kOMp Qh3WjiCumpzIfwp57vSZdCL5JfXaDXL3N3oejvDrIUQ5zwVd/+PjLWYM42jt4WOw5a/d 2DCyHpoeaXfzNfyTaczxih4d8YC+ZrjOdyQAQ7Pkr9ECYq805tiGPVi/2/CL1lg+rvC6 sybnq4cPc39MtLYuQusqYGR+/SiT9aaKqI2XcFbLw6kchQ+ZXd6RZByAZZ8vGSsGNrvb I2Sg== X-Received: by 10.50.87.201 with SMTP id ba9mr11811258igb.83.1361386975098; Wed, 20 Feb 2013 11:02:55 -0800 (PST) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPS id s8sm1335242igs.0.2013.02.20.11.02.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 11:02:54 -0800 (PST) Message-ID: <51251DDC.9090807@dev.mellanox.co.il> Date: Wed, 20 Feb 2013 14:02:52 -0500 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: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] opensm/osm_sa_multipath_record.c: Validate required components are indicated X-Gm-Message-State: ALoCoQlzWpWkzR4vggOM48rXcWsTUa7kcNim0EnlRCB1W+5tmf+/2sKMoeEdgKLgrpA3bZ6NCMqB Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Both SGIDCount and DGIDCount are required components Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/opensm/osm_sa_multipath_record.c b/opensm/osm_sa_multipath_record.c index e89c93a..955c994 100644 --- a/opensm/osm_sa_multipath_record.c +++ b/opensm/osm_sa_multipath_record.c @@ -1566,7 +1594,14 @@ void osm_mpr_rcv_process(IN void *context, IN void *data) osm_dump_multipath_record_v2(sa->p_log, p_mpr, FILE_ID, OSM_LOG_DEBUG); } + /* Make sure required components (S/DGIDCount) are supplied */ + if (!(p_sa_mad->comp_mask & IB_MPR_COMPMASK_SGIDCOUNT) || + !(p_sa_mad->comp_mask & IB_MPR_COMPMASK_DGIDCOUNT)) { + osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_INSUF_COMPS); + goto Exit; + } + /* Validate rate if supplied */ if ((p_sa_mad->comp_mask & IB_MPR_COMPMASK_RATESELEC) && (p_sa_mad->comp_mask & IB_MPR_COMPMASK_RATE)) { rate = ib_multipath_rec_rate(p_mpr);