svn commit: r275204 - stable/10/sys/cam/scsi

Alexander Motin mav at FreeBSD.org
Fri Nov 28 09:23:17 UTC 2014


Author: mav
Date: Fri Nov 28 09:23:15 2014
New Revision: 275204
URL: https://svnweb.freebsd.org/changeset/base/275204

Log:
  MFC r274756:
  Remove residual xpt_release_device() call left after r272406 cleanup.
  
  Excessive release here could trigger use-after-free condition and kernel
  panic on LUN 0 disconnect.

Modified:
  stable/10/sys/cam/scsi/scsi_xpt.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- stable/10/sys/cam/scsi/scsi_xpt.c	Fri Nov 28 08:56:37 2014	(r275203)
+++ stable/10/sys/cam/scsi/scsi_xpt.c	Fri Nov 28 09:23:15 2014	(r275204)
@@ -2041,23 +2041,7 @@ scsi_scan_bus(struct cam_periph *periph,
 				scan_info->lunindex[target_id]++;
 			} else {
 				mtx_unlock(&target->luns_mtx);
-				/*
-				 * We're done with scanning all luns.
-				 *
-				 * Nuke the bogus device for lun 0 if lun 0
-				 * wasn't on the list.
-				 */
-				if (first != 0) {
-					TAILQ_FOREACH(device,
-					    &target->ed_entries, links) {
-						if (device->lun_id == 0) {
-							break;
-						}
-					}
-					if (device) {
-						xpt_release_device(device);
-					}
-				}
+				/* We're done with scanning all luns. */
 			}
 		} else {
 			mtx_unlock(&target->luns_mtx);


More information about the svn-src-all mailing list