HomeFreeBSD

riscv: Clear SUM in SSTATUS for supervisor mode exceptions.

Description

riscv: Clear SUM in SSTATUS for supervisor mode exceptions.

Previously, a page fault taken during copyin/out and related functions
would run the entire fault handler while permitting direct access to
user addresses. This could also leak across context switches (e.g. if
the page fault handler was preempted by an interrupt or slept for disk
I/O).

To fix, clear SUM in assembly after saving the original version of
SSTATUS in the supervisor mode trapframe.

Reviewed by: mhorne, jrtc27
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D29763

Details

Provenance
jhbAuthored on Apr 21 2021, 8:57 PM
Reviewer
mhorne
Differential Revision
D29763: riscv: Clear SUM in SSTATUS for supervisor mode exceptions.
Parents
rGc4473add1d3d: pmcstat: fix the usage message for -t
Branches
Unknown
Tags
Unknown