diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 13:36:06 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 18:56:00 +0200 |
commit | 4faba98a1a11a6129cbcc772422c9ffc0c11dd2e (patch) | |
tree | 7222224fdc3d7c4708cf48624263c92151f120e0 /drivers/infiniband/hw | |
parent | [PATCH] IB/ipath: fix lost interrupts on HT-400 (diff) | |
download | linux-4faba98a1a11a6129cbcc772422c9ffc0c11dd2e.tar.xz linux-4faba98a1a11a6129cbcc772422c9ffc0c11dd2e.zip |
[PATCH] IB/ipath: disallow send of invalid packet sizes over UD
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_ud.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_ud.c b/drivers/infiniband/hw/ipath/ipath_ud.c index eeff19800db7..3b6d00b9b8be 100644 --- a/drivers/infiniband/hw/ipath/ipath_ud.c +++ b/drivers/infiniband/hw/ipath/ipath_ud.c @@ -275,6 +275,11 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) 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; |