freebsd-nq/sys/i386
Konstantin Belousov 349216589d A different fix for the issue from r323722.
Split the handlers for pop of invalid selectors from the trap frame
into usermode and kernel variants.  Usermode handler is kept as is, it
restores the already loaded parts of the trap frame and jumps to set
up a signal delivery to the user process.

New kernel part of the handler emulates IRET treatment of the segments
which would violate access right.  It loads NUL selector in the
segment register which load causes the fault, and then continues the
return to interrupted kernel code.  Since invalid selectors in the
segment registers in the kernel mode can only exist while kernel still
enters or exits from userspace, we only zero invalid userspace
selectors.  If userspace tries to use the segment register, it gets a
signal, as if the processor segment descriptor cache was reloaded.

Reported by:	Maxime Villard <max@m00nbsd.net>
Suggested and reviewed by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-09-28 09:01:28 +00:00
..
acpica
bios Remove Micro Channel Architecture support. Of the commonly available 2017-02-15 23:04:25 +00:00
cloudabi32 Move struct syscall_args syscall arguments parameters container into 2017-06-12 21:03:23 +00:00
conf Fix indentation for r323068 2017-09-19 20:40:05 +00:00
i386 A different fix for the issue from r323722. 2017-09-28 09:01:28 +00:00
ibcs2 Remove register keyword from sys/ and ANSIfy prototypes 2017-05-17 00:34:34 +00:00
include Restore a part of r323722. 2017-09-28 08:46:15 +00:00
isa Revert r323722. A better fix will be committed shortly, as well as 2017-09-28 08:38:24 +00:00
linux Avoid using [LINUX_]SHAREDPAGE constant directly in the vdso code. 2017-07-30 21:24:20 +00:00
pci Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
xbox
Makefile