git: f87a9f51ef2b - main - vfs: validate that a mount point with FPLOOKUP has vop_fplookup ops
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Apr 2023 15:45:38 UTC
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f87a9f51ef2b5a02b663c02ddd2ac663a5a45a88 commit f87a9f51ef2b5a02b663c02ddd2ac663a5a45a88 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2023-04-05 23:10:34 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2023-04-06 15:20:41 +0000 vfs: validate that a mount point with FPLOOKUP has vop_fplookup ops --- sys/kern/vfs_subr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5c1819800d96..96adc6ff3493 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1800,6 +1800,10 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, KASSERT(vops->registered, ("%s: not registered vector op %p\n", __func__, vops)); + if (mp != NULL && (mp->mnt_kern_flag & MNTK_FPLOOKUP) != 0) { + MPASS(vops->vop_fplookup_vexec != VOP_PANIC); + MPASS(vops->vop_fplookup_symlink != VOP_PANIC); + } td = curthread; if (td->td_vp_reserved != NULL) {