diff options
author | Ira Weiny <ira.weiny@intel.com> | 2015-11-30 15:34:26 +0100 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-12-07 22:22:14 +0100 |
commit | 785f742223c03ec70f9dcf36b87f59e9df2067e0 (patch) | |
tree | 0c9098dac9e97066899c74ca10eb61dbe1da1ca4 /drivers/infiniband/hw | |
parent | Linux 4.4-rc4 (diff) | |
download | linux-785f742223c03ec70f9dcf36b87f59e9df2067e0.tar.xz linux-785f742223c03ec70f9dcf36b87f59e9df2067e0.zip |
IB/qib: Fix qib_mr structure
struct qib_mr requires the mr member be the last because struct
qib_mregion contains a dynamic array at the end. The additions
of members should have been placed before this structure as the
comment noted.
Failure to do so was causing random memory corruption. Reproducing
this bug was easy to do by running the client and server of
ib_write_bw -s 8 -n 5 on the same node.
This BUG() was tripped in a slab debug kernel:
kernel BUG at mm/slab.c:2572!
Fixes: 38071a461f0a ("IB/qib: Support the new memory registration API")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_verbs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/qib/qib_verbs.h b/drivers/infiniband/hw/qib/qib_verbs.h index 2baf5ad251ed..bc803f33d5f6 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.h +++ b/drivers/infiniband/hw/qib/qib_verbs.h @@ -329,9 +329,9 @@ struct qib_sge { struct qib_mr { struct ib_mr ibmr; struct ib_umem *umem; - struct qib_mregion mr; /* must be last */ u64 *pages; u32 npages; + struct qib_mregion mr; /* must be last */ }; /* |