HomeFreeBSD

amd64: Add a knob to flush RSB on context switches if machine has SMEP.

Description

amd64: Add a knob to flush RSB on context switches if machine has SMEP.

The flush is needed to prevent cross-process ret2spec, which is not handled
on kernel entry if IBPB is enabled but SMEP is present.
While there, add i386 RSB flush.

Reported by: Anthony Steinhauser <asteinhauser@google.com>
Reviewed by: markj, Anthony Steinhauser
Discussed with: philip
admbugs: 961
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on
Parents
rS361301: MFC r349577 (arichardson): Allow bootstrapping elftoolchain on MacOS and Linux
Branches
Unknown
Tags
Unknown