Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932274AbWELX7t (ORCPT ); Fri, 12 May 2006 19:59:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932213AbWELX5b (ORCPT ); Fri, 12 May 2006 19:57:31 -0400 Received: from mx.pathscale.com ([64.160.42.68]:59561 "EHLO mx.pathscale.com") by vger.kernel.org with ESMTP id S932274AbWELXod (ORCPT ); Fri, 12 May 2006 19:44:33 -0400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH 31 of 53] ipath - forbid sending of bad packet sizes X-Mercurial-Node: 4868daa7f215e154629545bc543f01d6bd435824 Message-Id: <4868daa7f215e1546295.1147477396@eng-12.pathscale.com> In-Reply-To: Date: Fri, 12 May 2006 16:43:16 -0700 From: "Bryan O'Sullivan" To: rdreier@cisco.com Cc: openib-general@openib.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 835 Lines: 22 Signed-off-by: Bryan O'Sullivan diff -r b098b021b6fd -r 4868daa7f215 drivers/infiniband/hw/ipath/ipath_ud.c --- a/drivers/infiniband/hw/ipath/ipath_ud.c Fri May 12 15:55:28 2006 -0700 +++ b/drivers/infiniband/hw/ipath/ipath_ud.c Fri May 12 15:55:28 2006 -0700 @@ -273,6 +273,11 @@ int ipath_post_ud_send(struct ipath_qp * } len += wr->sg_list[i].length; ss.num_sge++; + } + /* Check for invalid packet size. */ + if (len > ipath_layer_get_ibmtu(dev->dd)) { + ret = -EINVAL; + goto bail; } extra_bytes = (4 - len) & 3; nwords = (len + extra_bytes) >> 2; - 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/