Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ffs uaf



details:   https://anonhg.NetBSD.org/src/rev/2c9730c12a17
branches:  trunk
changeset: 345092:2c9730c12a17
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat May 07 11:59:08 2016 +0000

description:
uaf

diffstat:

 sys/ufs/ffs/ffs_subr.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 07b020bbcded -r 2c9730c12a17 sys/ufs/ffs/ffs_subr.c
--- a/sys/ufs/ffs/ffs_subr.c    Sat May 07 11:49:21 2016 +0000
+++ b/sys/ufs/ffs/ffs_subr.c    Sat May 07 11:59:08 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_subr.c,v 1.48 2013/10/20 00:29:10 htodd Exp $      */
+/*     $NetBSD: ffs_subr.c,v 1.49 2016/05/07 11:59:08 maxv Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -36,7 +36,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.48 2013/10/20 00:29:10 htodd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.49 2016/05/07 11:59:08 maxv Exp $");
 
 #include <sys/param.h>
 
@@ -127,8 +127,10 @@
                (*bpp)->b_blkno = blkno;
        if (clearbuf)
                clrbuf(*bpp);
-       if ((*bpp)->b_blkno >= 0 && (error = fscow_run(*bpp, false)) != 0)
+       if ((*bpp)->b_blkno >= 0 && (error = fscow_run(*bpp, false)) != 0) {
                brelse(*bpp, BC_INVAL);
+               *bpp = NULL;
+       }
        return error;
 }
 



Home | Main Index | Thread Index | Old Index