Page MenuHomeFreeBSD

tmpfs: push VEXEC check into tmpfs_lookup()
ClosedPublic

Authored by kevans on Jan 28 2021, 3:49 PM.
Tags
None
Referenced Files
F146271779: D28401.id.diff
Sun, Mar 1, 7:17 AM
F146197563: D28401.id.diff
Sat, Feb 28, 4:22 PM
Unknown Object (File)
Wed, Feb 25, 4:12 AM
Unknown Object (File)
Sat, Feb 7, 6:30 PM
Unknown Object (File)
Jan 17 2026, 12:21 AM
Unknown Object (File)
Jan 1 2026, 9:47 AM
Unknown Object (File)
Dec 12 2025, 11:11 AM
Unknown Object (File)
Dec 3 2025, 3:23 PM
Subscribers

Details

Summary

vfs_cache_lookup() has already done the appropriate VEXEC check, therefore
we must not re-check in VOP_CACHEDLOOKUP.

This fixes O_SEARCH semantics on tmpfs and removes a redundant descent into
VOP_ACCESS() in the common case.

Reported-by: arichardson (via CheriBSD Jenkins CI)
Differential-Revision: https://reviews.freebsd.org/D28401

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36590
Build 33479: arc lint + arc unit

Event Timeline

Maybe Reported-by: arichardson (via CheriBSD Jenkins CI)

sys/fs/tmpfs/tmpfs_vnops.c
102

Instead of adding cached param, you can move vn_dir_check_exec() into tmpfs_lookup().

Just push the check back into tmpfs_lookup, note in tmpfs_lookup1 that the
caller should have ensured it's a valid access to make sure it's obvious to
readers that it's intentionally omitted from here.

kevans retitled this revision from tmpfs: do not recheck for VEXEC in VOP_CACHEDLOOKUP to tmpfs: push VEXEC check into tmpfs_lookup().Jan 28 2021, 10:40 PM
kevans edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jan 28 2021, 11:03 PM
This revision was automatically updated to reflect the committed changes.