Commit 4faba98a authored by Bryan O'Sullivan's avatar Bryan O'Sullivan Committed by Linus Torvalds

[PATCH] IB/ipath: disallow send of invalid packet sizes over UD

Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: default avatarBryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 57abad25
...@@ -275,6 +275,11 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr) ...@@ -275,6 +275,11 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
len += wr->sg_list[i].length; len += wr->sg_list[i].length;
ss.num_sge++; 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; extra_bytes = (4 - len) & 3;
nwords = (len + extra_bytes) >> 2; nwords = (len + extra_bytes) >> 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment