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

Memory leak of dirfs_mount structure on mount-time stat failure

Summary

dirfs_vfsops.c:148-150 stat-fail branch goto failure without kfree(dmp). Other error paths (:131 copyinstr :144 not-dir) do kfree. VFS framework does NOT call VFS_UNMOUNT on mount failure (vfs_syscalls.c:456-474). Each mount against nonexistent path leaks sizeof(dirfs_mount). Fix: add kfree(dmp) to stat-fail branch.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0909 Β· 1 files
FileTypeDescriptionSize
fix.diff suggested-fix Memory leak of dirfs_mount structure on mount-time stat failure 244 B view raw

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

fix.diff applied + combined nativekernel build rc=0 (-Werror)

fix.diff applied + combined nativekernel build rc=0 (-Werror)
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Info severity)

Evidence (decisive lines)

Source-confirmed at sys/vfs/dirfs/dirfs_vfsops.c:148: memory leak of dirfs_mount structure on mount-time stat failure

Verified recommended fix

Source-confirmed at sys/vfs/dirfs/dirfs_vfsops.c:148: memory leak of dirfs_mount structure on mount-time stat failure

Verdict

Source-confirmed at sys/vfs/dirfs/dirfs_vfsops.c:148: memory leak of dirfs_mount structure on mount-time stat failure