DF-3019
devfs_spec_open clone path: EPERM/EBUSY early returns after securelevel/mounted-RW checks leak the cloned vp exclusively locked and referenced forever
| Field | Value |
|---|---|
| ID | DF-3019 |
| Status | new |
| Severity | Low |
| CVSS 3.1 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:L |
| CWE | CWE-401 (locked vnode leak) |
| File | sys/vfs/devfs/devfs_vnops.c |
| Lines | 1006-1024 (cf. correct handling :992-998, :1063-1064) |
| Area | vfs/devfs |
| Confidence | likely |
| Discovered | 2026-09-02 |
| Pass | 2 (GLM 5.3 second pass) |
| Bucket | base:vfs |
| Reported | pending |
| Known CVE | none |
| CVE match | novel |
Summary
After a successful clone (devfs_allocv returned the new vp locked+ref'd and ap->a_vp was swapped at :933-935), the D_DISK write-open security checks at :1006-1024 'return EPERM/EBUSY' directly: the cloned vp keeps devfs_allocv's reference and EXCLUSIVE lock forever (vn_open's caller only balances the original vp). The vnode can never be reused — permanent vnode leak + permanently locked vnode (any later vget on it hangs). Realistic only for cloned D_DISK devices opened FWRITE with securelevel>=2 or mounted RW (vn(4) is an autoclone D_DISK) — root-only devices, hence Low; but each triggering open permanently burns a vnode. Not executed (needs root + a configured vn device). Fix: add 'if (orig_vp) vput(vp);' before each of the three returns.
Timeline
- 2026-09-02 Discovered during pass-2 audit of devfs_vnops.c (GLM 5.3).
No comments yet.