aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2011-07-27 18:10:39 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-07-28 04:10:35 -0400
commit324f667833d7ddd9501ed8c0e3ec5754ddb1b695 (patch)
tree1dbc7ce23d6c8f3c13f6c977d572be90fb95051b /drivers/scsi/libfc
parent6f06e3a7b2f2d840d42a0c2b9906f444e8f2eba6 (diff)
[SCSI] libfc, fcoe: ignore rx frame with wrong xid info
Drop the rx frame having xid with wrong cpu info or received with xid not matching to our xid. Not dropping such frame is causing panic as that causes accessing data struct beyond their bounds. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_exch.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 7baf2239ce07..01ff082dc34c 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -802,10 +802,8 @@ static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid)
802 pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask); 802 pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask);
803 spin_lock_bh(&pool->lock); 803 spin_lock_bh(&pool->lock);
804 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order); 804 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order);
805 if (ep) { 805 if (ep && ep->xid == xid)
806 fc_exch_hold(ep); 806 fc_exch_hold(ep);
807 WARN_ON(ep->xid != xid);
808 }
809 spin_unlock_bh(&pool->lock); 807 spin_unlock_bh(&pool->lock);
810 } 808 }
811 return ep; 809 return ep;