HomeFreeBSD

amd64: only set PCB_FULL_IRET pcb flag when #gp or similar exception comes

Description

amd64: only set PCB_FULL_IRET pcb flag when #gp or similar exception comes
from usermode.

If CPU supports RDFSBASE, the flag also means that userspace fsbase
and gsbase are already written into pcb, which might be not true when
we handle #gp from kernel.

The offender is rdmsr_safe(), and the visible result is corrupted
userspace TLS base.

Reported by: pstef
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Details

Provenance
kibAuthored on Nov 13 2019, 10:39 PM
Parents
rGeee39f5e9372: elf_aux_info: Add support for AT_EXECPATH.
Branches
Unknown
Tags
Unknown

Event Timeline