de4e1aeb21
Suppose that a binary was executed from tmpfs mount, and the text vnode was reclaimed while the binary was still running. It is possible during even the normal operations since tmpfs vnode' vm_object has swap type, and no references on the vnode is held. Also assume that the text vnode was revived for some reason. Then, on the process exit or exec, unmapping of the text mapping tries to remove the text reference from the vnode, but since it went from recycle/instantiation cycle, there is no reference kept, and assertion in VOP_UNSET_TEXT_CHECKED() triggers. Fix this by keeping a use reference on the tmpfs vnode for each exec reference. This prevents the vnode reclamation while executable map entry is active. Do it by adding per-mount flag MNTK_TEXT_REFS that directs vop_stdset_text() to add use ref on first vnode text use, and per-vnode VI_TEXT_REF flag, to record the need on unref in vop_stdunset_text() on last vnode text use going away. Set MNTK_TEXT_REFS for tmpfs mounts. Reported by: bdrewery Tested by: sbruno, pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week |
||
---|---|---|
.. | ||
autofs | ||
cd9660 | ||
cuse | ||
deadfs | ||
devfs | ||
ext2fs | ||
fdescfs | ||
fifofs | ||
fuse | ||
msdosfs | ||
nfs | ||
nfsclient | ||
nfsserver | ||
nullfs | ||
procfs | ||
pseudofs | ||
smbfs | ||
tmpfs | ||
udf | ||
unionfs |