Kernel-internal VOP_ACCESS(3-arg) callers silently get access(2)-style REAL-ID authorization semantics from vop_helper_access
| Field | Value |
|---|---|
| ID | DF-2935 |
| Status | new |
| Severity | Info |
| CVSS 3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L |
| CWE | CWE-284 |
| File | sys/kern/vfs_helper.c |
| Lines | 88-94, 120-150 (macro: sys/sys/vfsops.h:1040-1041) |
| Area | kern/vfs |
| Confidence | certain |
| Discovered | 2026-09-02 |
| Pass | 2 (GLM 5.3 second pass) |
| Bucket | base:kern |
| Reported | pending |
| Known CVE | none |
| CVE match | novel |
Summary
vop_helper_access selects cr_ruid/cr_rgid (real IDs) whenever a_flags lacks AT_EACCESS. That is correct for access(2)/faccessat(2) and exec is correct via VOP_EACCESS. But the bare 3-arg VOP_ACCESS macro also passes flags=0, so kernel-internal authorization callers of that macro get REAL-ID permission checks — inconsistent with the kernel's primary open(2)/path gate naccess_lva which uses EFFECTIVE uid/groups. On every currently-reachable internal path the deviation is deny-only (spurious EACCES for euid≠ruid processes): sys_fhopen is euid-0-gated; fp_vpopen serves only kernel consumers; tmpfs_lookup and ext2 lookup/rename VWRITE checks sit behind nlookup's effective-ID gate; the NFS server sees only client creds where ruid==uid (flagged 'XXX ruid/rgid vs uid/gid' by the authors). The hazard is latent: any new internal caller of VOP_ACCESS — or any reordering letting the helper's check run before an effective-ID gate — silently converts real-ID matching into an authorization GRANT for setuid/setgid contexts. Fix: internal authorization callers should use VOP_EACCESS (one-line changes at vfs_syscalls.c:4888, kern_fp.c:162, tmpfs_vnops.c:180, ext2 sites).
Timeline
- 2026-09-02 Discovered during pass-2 audit of vfs_helper.c (GLM 5.3).
No comments yet.