This is a note to let you know that I've just added the patch titled

    ib_srpt: Use correct ib_sg_dma primitives

to the 3.10-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ib_srpt-use-correct-ib_sg_dma-primitives.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From b076808051f2c80d38e03fb2f1294f525c7a446d Mon Sep 17 00:00:00 2001
From: Mike Marciniszyn <[email protected]>
Date: Mon, 7 Apr 2014 13:58:35 -0400
Subject: ib_srpt: Use correct ib_sg_dma primitives

From: Mike Marciniszyn <[email protected]>

commit b076808051f2c80d38e03fb2f1294f525c7a446d upstream.

The code was incorrectly using sg_dma_address() and
sg_dma_len() instead of ib_sg_dma_address() and
ib_sg_dma_len().

This prevents srpt from functioning with the
Intel HCA and indeed will corrupt memory
badly.

Cc: Bart Van Assche <[email protected]>
Reviewed-by: Dennis Dalessandro <[email protected]>
Tested-by: Vinod Kumar <[email protected]>
Signed-off-by: Mike Marciniszyn <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/infiniband/ulp/srpt/ib_srpt.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1078,6 +1078,7 @@ static void srpt_unmap_sg_to_ib_sge(stru
 static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch,
                                 struct srpt_send_ioctx *ioctx)
 {
+       struct ib_device *dev = ch->sport->sdev->device;
        struct se_cmd *cmd;
        struct scatterlist *sg, *sg_orig;
        int sg_cnt;
@@ -1124,7 +1125,7 @@ static int srpt_map_sg_to_ib_sge(struct
 
        db = ioctx->rbufs;
        tsize = cmd->data_length;
-       dma_len = sg_dma_len(&sg[0]);
+       dma_len = ib_sg_dma_len(dev, &sg[0]);
        riu = ioctx->rdma_ius;
 
        /*
@@ -1155,7 +1156,8 @@ static int srpt_map_sg_to_ib_sge(struct
                                        ++j;
                                        if (j < count) {
                                                sg = sg_next(sg);
-                                               dma_len = sg_dma_len(sg);
+                                               dma_len = ib_sg_dma_len(
+                                                               dev, sg);
                                        }
                                }
                        } else {
@@ -1192,8 +1194,8 @@ static int srpt_map_sg_to_ib_sge(struct
        tsize = cmd->data_length;
        riu = ioctx->rdma_ius;
        sg = sg_orig;
-       dma_len = sg_dma_len(&sg[0]);
-       dma_addr = sg_dma_address(&sg[0]);
+       dma_len = ib_sg_dma_len(dev, &sg[0]);
+       dma_addr = ib_sg_dma_address(dev, &sg[0]);
 
        /* this second loop is really mapped sg_addres to rdma_iu->ib_sge */
        for (i = 0, j = 0;
@@ -1216,8 +1218,10 @@ static int srpt_map_sg_to_ib_sge(struct
                                        ++j;
                                        if (j < count) {
                                                sg = sg_next(sg);
-                                               dma_len = sg_dma_len(sg);
-                                               dma_addr = sg_dma_address(sg);
+                                               dma_len = ib_sg_dma_len(
+                                                               dev, sg);
+                                               dma_addr = ib_sg_dma_address(
+                                                               dev, sg);
                                        }
                                }
                        } else {


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.10/ib_srpt-use-correct-ib_sg_dma-primitives.patch
queue-3.10/ib-ipath-fix-potential-buffer-overrun-in-sending-diag-packet-routine.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to