freebsd-skq/sys/amd64/linux
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
..
linux_dummy.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
linux_genassym.c
linux_locore.s Add a forgotten in r283424 .eh_frame section with CFI & FDE records to allow 2016-05-09 07:38:47 +00:00
linux_machdep.c Sort headers in MD Linuxulator files 2018-03-23 17:16:36 +00:00
linux_proto.h Regenerated Linuxulator syscall tables for r314782 2017-03-06 18:20:37 +00:00
linux_ptrace.c Linuxolator whitespace cleanup 2018-02-05 17:29:12 +00:00
linux_support.s Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
linux_syscall.h Regenerated Linuxulator syscall tables for r314782 2017-03-06 18:20:37 +00:00
linux_syscalls.c Regenerated Linuxulator syscall tables for r314782 2017-03-06 18:20:37 +00:00
linux_sysent.c Regenerated Linuxulator syscall tables for r314782 2017-03-06 18:20:37 +00:00
linux_systrace_args.c Regenerated Linuxulator syscall tables for r314782 2017-03-06 18:20:37 +00:00
linux_sysvec.c Fix PSL_T inheritance on exec for x86. 2018-04-12 20:43:39 +00:00
linux_vdso.lds.s
linux.h Rationalize license text on Linuxolator files 2018-03-01 13:52:18 +00:00
Makefile Don't use an .OBJDIR for 'make sysent'. 2018-01-29 19:14:15 +00:00
syscalls.conf
syscalls.master Use linux types for linux-specific syscalls 2018-02-23 19:09:27 +00:00