# DF-3189 verification

Kernel: DragonFly dfbsd 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64

## Bottom line

Code-certain: hammer_ioc_set_pseudofs loads the PFS with hammer_load_pseudofs and then unconditionally overwrites error with the copyin result, discarding every load failure (EIO from media failure, the DF-3109 cursor-init failure, EDEADLK) although the comment promises only ENOENT is ignored; hammer_mkroot_pseudofs and hammer_save_pseudofs then run against the zeroed template and can persist PFS state derived from a failed load. Dynamic triggering requires inducing a load failure mid-ioctl (degraded media), unavailable on this guest. Fix keeps only the intended ENOENT exemption; compile-validated.

## Kernel references
- sys/vfs/hammer/hammer_pfs.c:117-118

## Exploit chain
(none: availability/correctness finding; no privilege chain)

## Fix

if (error == ENOENT) error = 0 before the copyin

See fix.diff in this directory (git-apply-able against the read-only sys/
tree; applied only inside the disposable verification guest).

## Reproduction

build: n/a

run: n/a

expected: n/a

## Notes on the PoC (what changed vs the finding sketch)

(none)

## 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.
