DragonFlyBSD Kernel Audit
← triage · dashboard
DF-3041

hammer_install_volume dereferences the volume header after brelse(bp) — buffer-cache use-after-release read of vol0_stat_bigblocks into f_blocks

Field Value
ID DF-3041
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-416 / CWE-362
File sys/vfs/hammer/hammer_ondisk.c
Lines 250-257
Area vfs/hammer
Confidence likely
Discovered 2026-09-02
Pass 2 (GLM 5.3 second pass)
Bucket memcorrupt
Reported pending
Known CVE none
CVE match novel

Summary

In the root-volume special case, hammer_install_volume releases the header buffer (brelse at :251, bp=NULL at :252) and then reads ondisk->vol0_stat_bigblocks twice (:254, :257) through the stale pointer captured at :183. After brelse the bp is owned by the buffer cache: a concurrent raw-device access to the same devvp or buffer-cache pressure can recycle/reuse the bp between the release and the two loads, so the kernel reads freed-or-reassigned buffer-cache memory and adds it (×512) into f_blocks/mnt_vstat.f_blocks. Impact is a racy stale kernel read whose value only corrupts statfs accounting (attacker-groomable bp content could inflate f_blocks, breaking quota/df arithmetic). Not built (below Phase V threshold — static proof code-evident). Fix: move the two f_blocks updates above the brelse (row diff).

Timeline

  • 2026-09-02 Discovered during pass-2 audit of hammer_ondisk.c (GLM 5.3).

Discussion (0)

No comments yet.