Skip to content

Commit

Permalink
[PATCH] IB/ipath: disallow send of invalid packet sizes over UD
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bryan O'Sullivan authored and Linus Torvalds committed Jul 1, 2006
1 parent 57abad2 commit 4faba98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/hw/ipath/ipath_ud.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4faba98

Please sign in to comment.