summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.h
diff options
context:
space:
mode:
authorBart Van Assche2015-08-11 02:07:27 +0200
committerDoug Ledford2015-08-31 00:12:37 +0200
commitf731ed62934ace0d3f5aa9ec557349171711be05 (patch)
treea3e7332634f679faa18579d7da6a0e1bd7b0ea0b /drivers/infiniband/ulp/srp/ib_srp.h
parentIB/srp: Use multiple registrations for large memory regions (diff)
downloadkernel-qcow2-linux-f731ed62934ace0d3f5aa9ec557349171711be05.tar.gz
kernel-qcow2-linux-f731ed62934ace0d3f5aa9ec557349171711be05.tar.xz
kernel-qcow2-linux-f731ed62934ace0d3f5aa9ec557349171711be05.zip
IB/srp: Add memory descriptor array pointer range checking
Although most paths through which a request is submitted check block layer parameters like the max_segments limit, these are not checked when an SG_IO or direct I/O request is submitted. Hence add a range check for the memory descriptor array pointer. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.h')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 17ee3f80ba55..2ab73bc76da1 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -282,8 +282,14 @@ struct srp_fr_pool {
*/
struct srp_map_state {
union {
- struct ib_pool_fmr **next_fmr;
- struct srp_fr_desc **next_fr;
+ struct {
+ struct ib_pool_fmr **next;
+ struct ib_pool_fmr **end;
+ } fmr;
+ struct {
+ struct srp_fr_desc **next;
+ struct srp_fr_desc **end;
+ } fr;
};
struct srp_direct_buf *desc;
u64 *pages;