freebsd-skq/sys/fs
Konstantin Belousov 5fc9e11c42 Save lower root vnode in nullfs mnt data instead of upper.
Nullfs needs to know the root vnode of the lower fs during the
operation.  Currently it caches the upper vnode of it, which is also
the root of the nullfs mount.  On unmount, nullfs calls vflush() with
rootrefs == 1, and aborts non-forced unmount if there are any more
vnodes instantiated during vflush().  This means that the reference to
the root vnode after failed non-forced unmount could be lost and
nullm_rootvp points to the freed memory.

Fix it by storing the reference for lower vnode instead, which is kept
intact during vflush().  nullfs_root() now instantiates the upper
vnode of lower root.  Care about VV_ROOT flag in null_nodeget().

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-01-28 11:29:06 +00:00
..
autofs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
cd9660 vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
cuse Free all allocated unit IDs in cuse(3) after the client character 2019-06-25 11:46:01 +00:00
deadfs vfs: flatten vop vectors 2019-12-16 00:06:22 +00:00
devfs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
ext2fs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
fdescfs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
fifofs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
fuse fusefs: add missing CLTFLAG_MPSAFE annotation 2020-01-15 01:31:28 +00:00
msdosfs Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOS 2020-01-27 12:02:41 +00:00
nfs Add missing comma in nfsv4_errstr 2020-01-13 21:49:27 +00:00
nfsclient vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
nfsserver Fix a crash in the NFSv4 server. 2020-01-26 17:59:05 +00:00
nullfs Save lower root vnode in nullfs mnt data instead of upper. 2020-01-28 11:29:06 +00:00
procfs Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map. 2019-10-08 07:14:21 +00:00
pseudofs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
smbfs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
tmpfs Don't hold the object lock while calling getpages. 2020-01-19 23:47:32 +00:00
udf vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
unionfs vfs: provide F_ISUNIONSTACK as a kludge for libc 2020-01-17 14:42:25 +00:00