IB/core - ib_umad can cause address alignment fault

In user_mad.c, the definition for struct ib_umad_packet includes
struct ib_user_mad at an odd 32-bit offset.  When ib_umad_write()
tries to assign rmpp_mad->mad_hdr.tid, there is an alignment fault on
architectures which have strict alignment for load/stores.
This patch fixes the problem by changing the offset on which
struct ib_user_mad is defined within struct ib_umad_packet.

Thanks go to John W. Marland <[EMAIL PROTECTED]> for finding this.

Signed-off-by: Ralph Campbell <[EMAIL PROTECTED]>

diff -r b1128b48dc99 drivers/infiniband/core/user_mad.c
--- a/drivers/infiniband/core/user_mad.c        Fri Jan 12 20:00:03 2007 +0000
+++ b/drivers/infiniband/core/user_mad.c        Wed Jan 17 14:09:37 2007 -0800
@@ -125,7 +125,7 @@ struct ib_umad_packet {
        struct ib_mad_send_buf *msg;
        struct ib_mad_recv_wc  *recv_wc;
        struct list_head   list;
-       int                length;
+       long               length;
        struct ib_user_mad mad;
 };
 



_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to