DF-2835 / verdict.json
{ "finding_id": "DF-2835", "status": "reproduced", "reproduced": 1, "impact": "none", "confidence": "certain", "verdict": "Verified on the stock INVARIANTS kernel as unprivileged uid 1001 with vm.vkernel_enable=1: create(id=NULL, 0, NULL) is accepted (rc=0), a second NULL create returns EEXIST proving the NULL id became a live key in the per-process vmspace RB tree (key stored verbatim at sys/vm/vm_vmspace.c:184, inserted at :190, compared by pointer at :581-589), and create(id, type=123, data=0xdead0000) is accepted with type and data never read anywhere in the function - the documented contract at sys/vm/vm_vmspace.c:134-139 (id NULL cannot be used, type and data must be 0) is not enforced. No memory-safety consequence today (type is never used to index anything, data is never dereferenced), so impact none / severity Info is correct; the value is contract hardening so a future typed-vmspace extension cannot silently mis-parse old callers and the NULL sentinel stays reserved. Fix validated A/B on a patched kernel: NULL id and nonzero type/data now return EINVAL at the vkernel_enable gate while the documented normal create and destroy behave identically (rc=0).", "exploit_chain": "", "evidence": "run.log (stock kernel: [1] NULL accepted rc=0, [2] EEXIST proving live RB key, [3] type=123 data=0xdead0000 accepted rc=0, [4] legit create rc=0), run.fixed.log (patched kernel: [1] and [3] EINVAL, [4] rc=0), VERDICT.md table, build.log warning-free", "kernel_refs": [ "sys/vm/vm_vmspace.c:134-139", "sys/vm/vm_vmspace.c:146-201", "sys/vm/vm_vmspace.c:155-156", "sys/vm/vm_vmspace.c:184", "sys/vm/vm_vmspace.c:190", "sys/vm/vm_vmspace.c:581-589" ], "poc_changes": "no seed pack existed (findings/poc/DF-2835 was empty); PoC written fresh in verify phase using syscall 486 via libc syscall(); test folded into one program that also proves the EEXIST second-create and exercises destroy cleanup so repeated runs start from a clean tree", "attempts": 2, "guest_uname": "DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64", "runtime_sec": 1200, "guest_dirty": 0, "build_cmd": "cc -O2 -Wall -o /tmp/vmsp_abi /tmp/vmsp_abi.c", "run_cmd": "dfbsd-qemu/vm.sh run_root sysctl vm.vkernel_enable=1 && dfbsd-qemu/vm.sh run_user /tmp/vmsp_abi; echo EXIT=$? && dfbsd-qemu/vm.sh run_root sysctl vm.vkernel_enable=0", "code_hash": "259b26fed78914f0b45968c1ce64837c5404ff933a6b54bc92a048af2d066c6c", "notes": "impact none is the honest ceiling for an ABI-enforcement hardening finding; the defect genuinely manifests (status reproduced). Requires vm.vkernel_enable=1 which is root-set and defaults to 0; restored to 0 and guest reset to with-src snapshot after verification. Shares fix.diff with DF-2834 (single patch adds the EINVAL guards and the cap).", "recommended_fix": "reject at entry next to the vkernel_enable gate: if (uap->id == NULL || uap->type != 0 || uap->data != NULL) return (EINVAL);" } |