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

DF-added kprintf leaks drm_device/amdgpu_device kernel pointers to dmesg at amdgpu attach

Summary

A DragonFly-port debug leftover printing '%p' of two kernel objects to the console on every amdgpu attach; upstream does not have it. Unprivileged users can read the message buffer on default DragonFly, disclosing kernel heap addresses. Info (near-zero value on KASLR-less DF today; gratuitous disclosure that would defeat future randomization). Delete-the-lines fix (validated).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-4358 Β· 8 files
FileTypeDescriptionSize
README.md β€” 1.0 KB ↓ raw
VERDICT.md β€” 1.1 KB ↓ raw
env.txt β€” 414 B view raw
fix.diff β€” 320 B view raw
fix_apply_check.log β€” 146 B view raw
fix_build.log β€” 1.2 MB ↓ download
verdict.json β€” 2.2 KB view raw
manifest.json β€” 626 B view raw

DF-4358 β€” DF-added kprintf leaks kernel pointers at amdgpu load (Info)

Where

sys/dev/drm/amd/amdgpu/amdgpu_kms.c:185-186 (amdgpu_driver_load_kms):

    kprintf("amdgpu_driver_load_kms(): flags=%ld drm_device=%p adev=%p\n",
        flags, dev, adev);

This kprintf does not exist upstream (v5.0/v5.2/v5.4 verified) β€” it is a DragonFly-port debug leftover. It prints the kernel virtual addresses of the drm_device and the struct amdgpu_device heap object to the console message buffer every time an amdgpu card attaches, i.e. at boot on any system with an AMD GPU. Unprivileged users can read the message buffer (dmesg, /var/log) on a default DragonFly system.

Impact is deliberately rated Info: DragonFly has no KASLR, so heap addresses carry little exploitation value today; the value is (a) removing gratuitous %p disclosure that would defeat any future KASLR/slab-random hardening and (b) diverging noise from upstream. Same class as DF-2008.

Fix

fix.diff deletes the two lines (upstream state).

VERDICT.md
↓ download raw

DF-4358 VERDICT β€” kprintf %p pointer disclosure (Info)

Status: UNTESTED (Info-severity hardening finding; no PoC required per audit contract β€” "Skip for Low/Info hardening findings").

Certainty of the finding itself: certain (source is one grep away, amdgpu_kms.c:185-186, and upstream v5.0/5.2/5.4 verified not to have it). Demonstrating the print at runtime requires an AMD GPU to attach, which this audit guest does not have; the kprintf is unconditional at attach, so behavioral verification would be trivial on any AMD-equipped host.

Impact ceiling: kernel heap pointer disclosure to unprivileged local users via dmesg; near-zero practical value on KASLR-less DragonFly today.

Fix: remove the kprintf (fix.diff; apply-check OK on guest /usr/src; compile-validated by the patched buildkernel run).

Fix status (batch validation)

Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean

fix.diff deletes the two kprintf lines (restores upstream state). patch --dry-run apply-check OK on guest pristine /usr/src; amdgpu module rebuilt cleanly with the deletion (make -j6 -> amdgpu.ko, zero warnings, mod_done_0, fix_build.log). Behavioral print-absence check requires an AMD GPU attach, unavailable here.

fix_apply_check.log (DF-4358_APPLY_CHECK_OK); fix_build.log (FULL module build: amdgpu_kms.o zero warnings, amdgpu.ko linked, mod_done_0)
↓ fix.diffDragonFly dfbsd 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 (buildkernel compile-validation only)

Confirmed kernel references

Detail

Evidence (decisive lines)

README.md (source quote + upstream comparison); VERDICT.md

PoC changes

n/a

Verified recommended fix

Delete the DF-added kprintf of drm_device/adev pointers in amdgpu_driver_load_kms (amdgpu_kms.c:185-186).

Verdict

Info-severity hardening finding; PoC intentionally not run per audit contract (skip Low/Info hardening). amdgpu_kms.c:185-186 contains a DragonFly-port-added kprintf that prints kernel virtual addresses of the drm_device and amdgpu_device heap objects to the console/dmesg on every amdgpu attach; upstream v5.0/v5.2/v5.4 verified not to have it. On KASLR-less DragonFly the disclosure has near-zero exploit value today; it is gratuitous %p noise that would defeat future randomization hardening. Fix: delete the two lines.