1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00
freebsd/sys/amd64
Konstantin Belousov 7c5d1690e9 Fix PSL_T inheritance on exec for x86.
The miscellaneous x86 sysent->sv_setregs() implementations tried to
migrate PSL_T from the previous program to the new executed one, but
they evaluated regs->tf_eflags after the whole regs structure was
bzeroed.  Make this functional by saving PSL_T value before zeroing.

Note that if the debugger is not attached, executing the first
instruction in the new program with PSL_T set results in SIGTRAP, and
since all intercepted signals are reset to default dispostion on
exec(2), this means that non-debugged process gets killed immediately
if PSL_T is inherited.  In particular, since suid images drop
P_TRACED, attempt to set PSL_T for execution of such program would
kill the process.

Another issue with userspace PSL_T handling is that it is reset by
trap().  It is reasonable to clear PSL_T when entering SIGTRAP
handler, to allow the signal to be handled without recursion or
delivery of blocked fault.  But it is not reasonable to return back to
the normal flow with PSL_T cleared.  This is too late to change, I
think.

Discussed with:	bde, Ali Mashtizadeh
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D14995
2018-04-12 20:43:39 +00:00
..
acpica Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
amd64 Fix PSL_T inheritance on exec for x86. 2018-04-12 20:43:39 +00:00
cloudabi32 Use TO_PTR() to convert integers to pointers. 2017-11-26 14:45:56 +00:00
cloudabi64 Use TO_PTR() to convert integers to pointers. 2017-11-26 14:45:56 +00:00
conf Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4). 2018-03-30 15:28:25 +00:00
ia32 Fix PSL_T inheritance on exec for x86. 2018-04-12 20:43:39 +00:00
include Add the ability to control the CPU topology of created VMs 2018-04-08 19:24:49 +00:00
linux Fix PSL_T inheritance on exec for x86. 2018-04-12 20:43:39 +00:00
linux32 Fix PSL_T inheritance on exec for x86. 2018-04-12 20:43:39 +00:00
pci sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
sgx Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
vmm Add the ability to control the CPU topology of created VMs 2018-04-08 19:24:49 +00:00
Makefile