Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932498AbWI1QIl (ORCPT ); Thu, 28 Sep 2006 12:08:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964932AbWI1QIG (ORCPT ); Thu, 28 Sep 2006 12:08:06 -0400 Received: from mx.pathscale.com ([64.160.42.68]:63669 "EHLO mx.pathscale.com") by vger.kernel.org with ESMTP id S1751861AbWI1QBW (ORCPT ); Thu, 28 Sep 2006 12:01:22 -0400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH 10 of 28] IB/ipath - RC and UC should validate SLID and DLID X-Mercurial-Node: f8c0eb9dc3b8ddcf8f4c69ce786ad3543404ce72 Message-Id: In-Reply-To: Date: Thu, 28 Sep 2006 09:00:06 -0700 From: "Bryan O'Sullivan" To: rdreier@cisco.com Cc: linux-kernel@vger.kernel.org, openib-general@openib.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1412 Lines: 37 This is required for IB conformance (spec ch. 9.6.1.5). Signed-off-by: Bryan O'Sullivan diff -r 934e5c1d6ade -r f8c0eb9dc3b8 drivers/infiniband/hw/ipath/ipath_rc.c --- a/drivers/infiniband/hw/ipath/ipath_rc.c Thu Sep 28 08:57:12 2006 -0700 +++ b/drivers/infiniband/hw/ipath/ipath_rc.c Thu Sep 28 08:57:12 2006 -0700 @@ -1319,6 +1319,10 @@ void ipath_rc_rcv(struct ipath_ibdev *de int diff; struct ib_reth *reth; int header_in_data; + + /* Validate the SLID. See Ch. 9.6.1.5 */ + if (unlikely(be16_to_cpu(hdr->lrh[3]) != qp->remote_ah_attr.dlid)) + goto done; /* Check for GRH */ if (!has_grh) { diff -r 934e5c1d6ade -r f8c0eb9dc3b8 drivers/infiniband/hw/ipath/ipath_uc.c --- a/drivers/infiniband/hw/ipath/ipath_uc.c Thu Sep 28 08:57:12 2006 -0700 +++ b/drivers/infiniband/hw/ipath/ipath_uc.c Thu Sep 28 08:57:12 2006 -0700 @@ -246,6 +246,10 @@ void ipath_uc_rcv(struct ipath_ibdev *de struct ib_reth *reth; int header_in_data; + /* Validate the SLID. See Ch. 9.6.1.5 */ + if (unlikely(be16_to_cpu(hdr->lrh[3]) != qp->remote_ah_attr.dlid)) + goto done; + /* Check for GRH */ if (!has_grh) { ohdr = &hdr->u.oth; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/