fp_mmap maps VCHR vnodes without the revoked-device (v_rdev == NULL) guard its sibling kern_mmap has: NULL-deref panic in vm_mmap
| Field | Value |
|---|---|
| ID | DF-2899 |
| 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:H |
| CWE | CWE-476 NULL Pointer Dereference |
| File | sys/kern/kern_fp.c |
| Lines | 473, 489-551 (sink: vm/vm_mmap.c:1356) |
| Area | kern |
| Confidence | likely |
| Discovered | 2026-09-02 |
| Pass | 2 (GLM 5.3 second pass) |
| Bucket | base:kern |
| Reported | pending |
| Known CVE | none |
| CVE match | novel |
Summary
fp_mmap validates a VCHR vnode only via vp->v_type and iszerodev(vp->v_rdev) (pure pointer compare, no deref), then unconditionally passes handle=vp to vm_mmap. vm_mmap dereferences vp->v_rdev->si_ops->d_uksmap (vm_mmap.c:1356/1367) and hands v_rdev to dev_dmmap_single/dev_pager_alloc. If the char device was revoked/destroyed (v_rdev cleared on the live vnode), this is a NULL-page kernel fault β panic. The syscall path kern_mmap performs exactly this check ("Make sure a device has not been revoked", vm_mmap.c:285-288 β EBADF); fp_mmap β a line-for-line snarf of that code β omitted it. Only in-tree route is CKPT_THAW gated by ckptgroup=0 (wheel), racing device revocation between fp_vpopen and fp_mmap β semi-privileged, narrow race, NULL-deref panic (DoS) as the realistic ceiling. Not built (Low; per-contract skip) β maintainer sketch in the summary.
Recommended fix
Mirror the kern_mmap revoked-device check in fp_mmap's VCHR path
(if (vp->v_type == VCHR && vp->v_rdev == NULL) return (EBADF);).
Timeline
- 2026-09-02 Discovered during pass-2 audit of kern_fp.c (GLM 5.3).
No comments yet.