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
Fixes: 2c10be9e06d ("arm64: Handle translation faults for thread [..]")
Differential Revision: https://reviews.freebsd.org/D41677

Details

Provenance
kevansAuthored on Sep 1 2023, 2:10 AM
Reviewer
rG2c10be9e06d4: arm64: Handle translation faults for thread structures
Differential Revision
D41677: arm64: initialize pcb in the TBI/PAC/etc. fault case
Parents
rGd88983333447: src.conf.5: regen
Branches
Unknown
Tags
Unknown