From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: [PATCH v2 1/9] IB/srp: Fix a sporadic crash triggered by cable pulling Date: Tue, 13 May 2014 16:39:13 +0200 Message-ID: <53722E91.20902@acm.org> References: <53722E4F.7070709@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53722E4F.7070709-HInyCGIudOg@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roland Dreier Cc: Sagi Grimberg , Vu Pham , David Dillow , Sebastian Parschauer , linux-rdma List-Id: linux-rdma@vger.kernel.org Avoid that srp_finish_req() can encounter a pointer to a SCSI command in req->scmnd that is no longer associated with that request. If the function srp_finish_req() is invoked twice for a SCSI command that is not in flight then that would cause srp_unmap_data() to try to invoke ib_fmr_pool_unmap() with an invalid pointer as argument, resulting in a kernel oops. Reported by: Sagi Grimberg Reference: http://thread.gmane.org/gmane.linux.drivers.rdma/19068/focus=19069 Signed-off-by: Bart Van Assche Cc: Roland Dreier Cc: David Dillow Cc: Sagi Grimberg Cc: Vu Pham Cc: Sebastian Parschauer Cc: stable # 3.13+ ("IB/srp: Use SRP transport layer error recovery") --- drivers/infiniband/ulp/srp/ib_srp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 66a908b..427336a 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1594,6 +1594,8 @@ err_unmap: err_iu: srp_put_tx_iu(target, iu, SRP_IU_CMD); + req->scmnd = NULL; /* for srp_finish_req() */ + spin_lock_irqsave(&target->lock, flags); list_add(&req->list, &target->free_reqs); -- 1.8.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html