svn commit: r273272 - stable/10/sys/kern

Alexander Motin mav at FreeBSD.org
Sun Oct 19 08:47:28 UTC 2014


Author: mav
Date: Sun Oct 19 08:47:27 2014
New Revision: 273272
URL: https://svnweb.freebsd.org/changeset/base/273272

Log:
  MFC r273143: Remove setting BIO_DONE flag for BIOs that have done() method.
  
  This fixes use-after-free, caused by geom_disk, completing same BIO twice
  to save extra allocation, and getting BIO_DONE set after the first.

Modified:
  stable/10/sys/kern/vfs_bio.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_bio.c
==============================================================================
--- stable/10/sys/kern/vfs_bio.c	Sun Oct 19 06:59:33 2014	(r273271)
+++ stable/10/sys/kern/vfs_bio.c	Sun Oct 19 08:47:27 2014	(r273272)
@@ -3585,10 +3585,8 @@ biodone(struct bio *bp)
 		bp->bio_flags |= BIO_DONE;
 		wakeup(bp);
 		mtx_unlock(mtxp);
-	} else {
-		bp->bio_flags |= BIO_DONE;
+	} else
 		done(bp);
-	}
 }
 
 /*


More information about the svn-src-all mailing list