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>
This commit is contained in:
Bart Van Assche
2015-08-10 17:07:27 -07:00
committed by Doug Ledford
parent 7e85c91970
commit f731ed6293
2 changed files with 20 additions and 6 deletions

View File

@@ -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;