HomeFreeBSD

arm64: initialize pcb in the TBI/PAC/etc. fault case

Description

arm64: initialize pcb in the TBI/PAC/etc. fault case

After 2c10be9e06d, we may jump to the bad_far label without pcb being
set, resulting in a follow-up fault as we may dereference it immediately
after the jump if td_intr_nesting_level == 0. In this branch, it should
be safe to dereference td as we're not handling the special case
mentioned below of accessing it during promotion/demotion.

This seems to fix a null ptr deref I hit during my most recent pkgbase
build attempt on the Windows DevKit, though that was admittedly
encountered while we were on the way to a panic from an apparent
use-after-free in ZFS bits.

Reviewed by: andrew, markj
Approved by: re (delphij)
Fixes: 2c10be9e06d ("arm64: Handle translation faults for thread [..]")

(cherry picked from commit 03d104888caea595960605a9ff010da7f39133dc)

Details

Provenance
kevansAuthored on Sep 1 2023, 2:10 AM
Parents
rG143371df7657: x86: Introduce APIC ID limit by default on AMD hardware
Branches
Unknown
Tags
Unknown