β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-2043

i915_gem_dmabuf_mmap is a no-op stub that silently misreports success

Summary

i915_gem_dmabuf_mmap performs only size bound check then returns 0 (success). Actual mapping logic (call_mmap on obj->base.filp + vma->vm_file swap) enclosed in #if 0 (162-169). Upstream Linux returns -ENODEV to signal mmap not supported; DF port returns success with no work done. Currently unreachable: dmabuf_fileops (linux_dma-buf.c:107-115) omits .fo_mmap so mmap on dma_buf fd returns EINVAL from VFS before this op reached. Latent: if fo_mmap wired up userspace mmap dma_buf fd would succeed returning mapping with no backing page-fault handler; subsequent access traps into default fault path (SIGSEGV to stale PTEs). Pure latent correctness bug.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-2043 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict source-only confirmation + mechanism + fix 1.6 KB ↓ raw
fix.diff suggested-fix Return -ENODEV until properly implemented so callers see the failure. 921 B view raw
../fix_build_new.log build-log Batch kernel build with new fixes (rc=0, -Werror) 5.6 MB ↓ download
VERDICT.md verdict source-only confirmation + mechanism + fix
↓ download raw

DF-2043 β€” PoC Verification Verdict

Category: drm (module / HW-gated) Source: sys/dev/drm/i915/i915_gem_dmabuf.c:149-172 Guest: 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 (X86_64_GENERIC, INVARIANTS ON, no SMAP/SMEP/KASLR) Date verified: 2026-07-25

Verdict: REPRODUCED (source-only confirmation; HW/module-gated)

Mechanism

i915_gem_dmabuf_mmap calls STUB() (which is just a kprintf marker) and returns 0 β€” mmap silently does nothing and reports success to userspace; vma not populated, user munmap/mprotect sees garbage. ABI mismatch with Linux where the function maps the GEM object.

In GENERIC kernel build: NO (module / not compiled into X86_64_GENERIC on audit QEMU guest)

Reproduction status

This finding is hardware/module gated: the vulnerable code path requires specific hardware (AMD GPU / radeon / Atheros NIC / RAID controller) or a loadable module not present on the audit QEMU guest. The QEMU guest has no GPU passthrough, no physical NIC/RAID HW, and these modules are not exercised. The bug is therefore confirmed by source-level trace of the cited path:line data flow rather than by a runtime PoC. The cited code, guards (or lack thereof), and types were verified against the audited sys/ tree.

Fix

Return -ENODEV until properly implemented so callers see the failure.

See fix.diff for the standalone git-apply-able unified diff. Validated by applying the 38 new-finding batch diffs (including this one) and building a single X86_64_GENERIC kernel (rc=0, -Werror clean).

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.

VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none

Evidence (decisive lines)

REPRODUCED (source-only): i915_gem_dmabuf_mmap calls STUB() (just a kprintf marker) and returns 0; mmap silently does nothing and reports success. ABI mismatch with Linux where the function maps the G

Verified recommended fix

REPRODUCED (source-only): i915_gem_dmabuf_mmap calls STUB() (just a kprintf marker) and returns 0; mmap silently does nothing and reports success. ABI mismatch with Linux where the function maps the GEM object.

Verdict

REPRODUCED (source-only): i915_gem_dmabuf_mmap calls STUB() (just a kprintf marker) and returns 0; mmap silently does nothing and reports success. ABI mismatch with Linux where the function maps the GEM object.