On a CPU without FEAT_E0PD, a user-mode store to a mapped kernel
address takes a permission fault, which data_abort() passes to
pmap_fault() with the process's pmap. pmap_pte() then finds the user
mapping whose address has the same low-order bits. If that mapping is
writable, pmap_fault() marks it dirty, although nothing wrote it, and
returns KERN_SUCCESS. The store is retried and faults again, so the
thread spins instead of receiving SIGSEGV. Access flag faults, which
loads also take, have the same flaw when a kernel mapping lacks
ATTR_AF; this fixes them as well.
Like amd64's trap_pfault(), send SIGSEGV for a user-mode fault in the
kernel address space without calling pmap_fault() or vm_fault_trap().
The thread gets the same SIGSEGV, with SEGV_MAPERR, as on a CPU with
FEAT_E0PD, where the store takes a translation fault that
vm_fault_trap() rejects. As on amd64, ktrace(2) no longer records
these faults.
Also, in pmap_fault(), assert that a kernel address comes with the
kernel pmap and a user address with a user pmap. The assertion
follows the stage 2 case, whose address is a guest physical address.
Found by: Claude Code (Opus 5.5)