HomeFreeBSD

Ensure we check the program state set in the trap frame on arm and arm64.

Description

Ensure we check the program state set in the trap frame on arm and arm64.
This value may be set by userspace so we need to check it before using it.
If this is not done correctly on exception return the kernel may continue
in kernel mode with all registers set to a userspace controlled value. Fix
this by moving the check into set_mcontext, and also add the missing
sanitisation from the arm64 set_regs.

Discussed with: security-officer@
MFC after: 3 days
Sponsored by: DARPA, AFRL

Details

Provenance
andrewAuthored on
Parents
rS326136: bfd: avoid crash on corrupt binaries
Branches
Unknown
Tags
Unknown