DF-5341 / verdict.json
{ "finding_id": "DF-5341", "status": "untested", "reproduced": false, "impact": "none", "confidence": "likely", "verdict": "Defect is certain at code level; acceptance table proven on the audited guest. The floating-pointer scan matches only the 4-byte _MP_ signature (mptable.c:375). mptable_map() then adopts fps->pap with the sole check pap != 0 (mptable.c:512), maps 44 bytes at that arbitrary 32-bit physical address, adopts base_table_length from it (mptable.c:517-518), and re-maps up to 65535 bytes there for full parsing (mptable.c:531). pmap_mapdev_attr() (pmap.c:6192-6218) installs PTEs for ANY physical address with no bounds check, so every firmware-controlled value becomes an early-boot kernel read of an arbitrary physical address (MMIO holes, PCI space, spans crossing the 4GB wrap such as pap=0xFFFFFF00 + len=0x1000). The MPFPS checksum byte, MPCTH PCMP signature, and MPCTH checksum are NEVER read anywhere in the file (verified by grep), so any stray 4-byte-aligned _MP_ dword in the scanned 1K EBDA / 128K BIOS regions promotes arbitrary garbage into a parsed MP table; the downstream failure modes are the KKASSERT panics of the sibling findings and mis-enumerated CPU/IOAPIC topology. Guest-compiled decision-table reproducer prints every garbage pap accepted and the 4GB-crossing span. End-to-end manifestation UNTESTED (needs injected firmware tables; standard QEMU/SeaBIOS guest cannot express it). FreeBSDs historic mptable code validated both checksums and the PCMP signature; the fix restores the signature + floating-checksum checks.", "exploit_chain": "", "evidence": "run.log \u2014 pap 0xfebc0000/0xa0000000/0xffffff00/0xffffffff/0xdeadbeef all ACCEPTED, mapped + parsed as MP config table; map span [0x0ffffff00..0x100000f00) ** CROSSES THE 4GB WRAP **; the four never-performed validations listed with grep counts.", "kernel_refs": [ "sys/platform/pc64/x86_64/mptable.c:511", "sys/platform/pc64/x86_64/mptable.c:512", "sys/platform/pc64/x86_64/mptable.c:517", "sys/platform/pc64/x86_64/mptable.c:531", "sys/platform/pc64/x86_64/mptable.c:375", "sys/platform/pc64/x86_64/pmap.c:6192" ], "poc_changes": "No seed PoC existed; authored from scratch. Reproducer copies the cited mptable.c logic verbatim (u_int/u_char semantics preserved); KKASSERT is modeled as a kernel-panic path (setjmp-resumable in the harness), and pmap_mapdev/MMIO access is elided where userland cannot express it (clearly marked in the source header).", "attempts": 1, "guest_uname": "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", "runtime_sec": 300, "guest_dirty": 0, "build_cmd": "guest: cc -O2 -Wall -Wextra -o /tmp/pap_trust /tmp/pap_trust.c", "run_cmd": "guest: /tmp/pap_trust", "code_hash": "660ab4a9b5810c6121b22b7dce9a85f5b3fdf90710c111a23e3455c5ddac1016", "notes": "Boot-time, malicious-firmware/loader threat class (same bar as accepted DF-1034/DF-5326). Kernel-boot manifestation not armable on the standard QEMU/SeaBIOS guest (no MP-table/SMAP injection, no unprivileged in-guest path) \u2014 verification is the guest-executed verbatim-logic reproducer per the DF-5326 precedent. Guest left clean (only /tmp scratch).", "recommended_fix": "verify MPFPS checksum and MPCTH PCMP signature in mptable_map before adopting pap/length", "fix_status": "not_testable", "fix_baseline_reproduced": false, "fix_patched_reproduced": false, "fix_verdict": "fix.diff is authored against the read-only sys/ tree and passes git apply --check, but could not be kernel-build-validated: the bugs kernel manifestation cannot be armed on this guest (needs injected firmware tables), so there is no baseline to compare a patched kernel against.", "fix_evidence": "findings/poc/DF-5341/fix.diff (git apply --check passes); reasoning in VERDICT.md" } |