Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2019 08:09:39 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352437 - head/sys/kern
Message-ID:  <201909170809.x8H89ddk079226@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Tue Sep 17 08:09:39 2019
New Revision: 352437
URL: https://svnweb.freebsd.org/changeset/base/352437

Log:
  vfs: fix braino resulting in NULL pointer deref in r352424
  
  The breakage was added after all the testing and the testing which followed
  was not sufficient to find it.
  
  Reported by:	pho
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Tue Sep 17 06:08:15 2019	(r352436)
+++ head/sys/kern/vfs_default.c	Tue Sep 17 08:09:39 2019	(r352437)
@@ -613,11 +613,13 @@ vop_stdgetwritemount(ap)
 		vfs_op_thread_exit(mp);
 	} else {
 		MNT_ILOCK(mp);
-		if (mp == vp->v_mount)
+		if (mp == vp->v_mount) {
 			MNT_REF(mp);
-		else
+			MNT_IUNLOCK(mp);
+		} else {
+			MNT_IUNLOCK(mp);
 			mp = NULL;
-		MNT_IUNLOCK(mp);
+		}
 	}
 	*(ap->a_mpp) = mp;
 	return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909170809.x8H89ddk079226>