Date: Wed, 15 Oct 2014 18:36:35 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273143 - head/sys/kern Message-ID: <201410151836.s9FIaZBU090173@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Oct 15 18:36:34 2014 New Revision: 273143 URL: https://svnweb.freebsd.org/changeset/base/273143 Log: 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. MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Oct 15 17:55:10 2014 (r273142) +++ head/sys/kern/vfs_bio.c Wed Oct 15 18:36:34 2014 (r273143) @@ -3618,10 +3618,8 @@ biodone(struct bio *bp) bp->bio_flags |= BIO_DONE; wakeup(bp); mtx_unlock(mtxp); - } else { - bp->bio_flags |= BIO_DONE; + } else done(bp); - } } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410151836.s9FIaZBU090173>