]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add stricter checks on user changes to SSTATUS.
authorjhb <jhb@FreeBSD.org>
Fri, 31 Jan 2020 19:00:48 +0000 (19:00 +0000)
committerjhb <jhb@FreeBSD.org>
Fri, 31 Jan 2020 19:00:48 +0000 (19:00 +0000)
commitd57fc34f88209b609d84c055704a2babb257633e
tree5619d6b19160ec78e5c556d90c9438286400bcff
parent98ee34298dd1b8da9c3bb692ab773344368dbb4d
Add stricter checks on user changes to SSTATUS.

Rather than trying to blacklist which bits userland can't write to via
sigreturn() or setcontext(), only permit changes to whitelisted bits.

- Permit arbitrary writes to bits in the user-writable USTATUS
  register that shadows SSTATUS.

- Ignore changes in write-only bits maintained by the CPU.

- Ignore the user-supplied value of the FS field used to track
  floating point state and instead set it to a value matching the
  actions taken by set_fpcontext().

Discussed with: mhorne
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23338
sys/riscv/riscv/machdep.c