freebsd-dev/sys
Matthew N. Dodd 37ee08bcab From Christian Zander:
This patch addresses a bug that can cause a GPF in the kernel - if a
process makes use of i386_set_ldt to install a LDT entry, then loads
a corresponding segment descriptor into %gs, forks, and if the child
execs.

In this scenario, setregs executes user_ldt_free and then determines
how to reset the %gs register:

    /* reset %gs as well */
    if (pcb == curpcb)
        load_gs(_udatasel);
    else
        pcb->pcb_gs = _udatasel;

This is insufficient in the fork/exec case, since pcb will be equal
to curpcb when the child execs; load_gs will reset %gs to _udatasel
but it doesn't reset pcb->pcb_gs; upon return from the system call,
cpu_switch_load_gs will thus attempt to restore %gs from pcb->pcb_gs
and trigger a GPF since all LDT entries have already been cleared.

The fix is to always reset pcb->pcb_gs to _udatasel.

Submitted by:	Christian Zander <zander@minion.de>
Reviewed by:	jake
2002-09-19 18:46:25 +00:00
..
alpha Implement C99's va_copy() macro. 2002-09-18 07:33:16 +00:00
amd64 From Christian Zander: 2002-09-19 18:46:25 +00:00
arm Initiate deorbit burn for the i386-only a.out related support. Moves are 2002-09-17 01:49:00 +00:00
boot MFi386: Remove a.out support. 2002-09-19 13:47:18 +00:00
cam Make SCSI_DELAY setable at boot time and runtime via the 2002-09-02 20:10:19 +00:00
coda Remove all use of vnode->v_tag, replacing with appropriate substitutes. 2002-09-14 09:02:28 +00:00
compat Completely redo thread states. 2002-09-11 08:13:56 +00:00
conf - added macio and psim files 2002-09-19 05:11:15 +00:00
contrib Fix kernel build breakage when ACPI_DEBUG option is specified. 2002-08-29 08:31:06 +00:00
crypto Fix some really pedantic GCC warnings. 2002-07-15 13:45:15 +00:00
ddb Garbage-collected __ELF__ ifdefs. 2002-09-15 22:28:39 +00:00
dev move <machine/iic.h> and <machine/smb.h> to <dev/iicbus/iic.h> and 2002-09-19 03:25:46 +00:00
fs VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link() 2002-09-19 13:32:45 +00:00
geom "Fix" printf format issues by using %j 2002-09-13 11:41:25 +00:00
gnu VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link() 2002-09-19 13:32:45 +00:00
i4b It's bad enough people can't figure out to use the same code, or in 2002-09-11 12:44:58 +00:00
i386 From Christian Zander: 2002-09-19 18:46:25 +00:00
ia64 Implement C99's va_copy() macro. 2002-09-18 07:33:16 +00:00
isa Restore status register A of RTC at resume time. 2002-09-18 07:34:04 +00:00
isofs/cd9660 Remove any VOP_PRINT that redundantly prints the tag. 2002-09-18 20:42:04 +00:00
kern VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link() 2002-09-19 13:32:45 +00:00
libkern Use sys/libkern.h not /usr/include/string.h 2002-09-06 06:04:36 +00:00
modules Add the rest of the kernel support for the sem_ API in kern/uipc_sem.c. 2002-09-19 00:43:32 +00:00
net Optimize the way we call BPF a tiny bit: If we chop the ether-header off 2002-09-18 19:50:48 +00:00
netatalk Add more ethernet types and move AppleTalk types into proper location. 2002-09-06 17:02:29 +00:00
netatm Make netatm/spans compile in the kernel without depending on userland 2002-09-17 08:57:52 +00:00
netgraph Reference the socket we're accepting. 2002-09-14 08:56:10 +00:00
netinet Use m_fixhdr() rather than roll our own. 2002-09-18 19:43:01 +00:00
netinet6 Lock the sysctl(8) knobs that turn ip{,6}fw(8) firewalling and 2002-08-25 03:50:29 +00:00
netipx Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
netkey - fixed the order of searching SA table for packets. 2002-07-10 16:39:38 +00:00
netnatm Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
netncp Wire the sysctl output buffer before grabbing any locks to prevent 2002-07-28 19:59:31 +00:00
netns Use m_length() instead of home-rolled versions. 2002-09-18 19:44:14 +00:00
netsmb Use m_length() instead of home-rolled versions. 2002-09-18 19:44:14 +00:00
nfs nfsnode.h was moved to ../nfsclient ages ago. I forgot to remove it here. 2002-09-06 05:47:33 +00:00
nfsclient Use m_length() instead of home-rolled versions. 2002-09-18 19:44:14 +00:00
nfsserver Use m_length() instead of home-rolled versions. 2002-09-18 19:44:14 +00:00
pc98 MFi386: revisions 1.534 and 1.535. 2002-09-19 13:42:11 +00:00
pccard For boot verbose, print resources assigned in a more asthetically pleasing 2002-09-13 16:23:41 +00:00
pci simos.c needs a to be updated from the old pci shims. Yell loudly but 2002-09-19 03:40:17 +00:00
posix4 Add the rest of the kernel support for the sem_ API in kern/uipc_sem.c. 2002-09-19 00:43:32 +00:00
powerpc Updated to somewhat match sparc64/conf/GENERIC 2002-09-19 11:20:13 +00:00
rpc
security Remove un-needed stack variable 'ops'. 2002-09-18 22:35:02 +00:00
sparc64 Implement C99's va_copy() macro. 2002-09-18 07:33:16 +00:00
sys Regen for added syscalls. 2002-09-19 00:48:57 +00:00
tools - Add two new debugging macros: ASSERT_VI_LOCKED and ASSERT_VI_UNLOCKED 2002-08-21 06:19:29 +00:00
ufs VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link() 2002-09-19 13:32:45 +00:00
vm - Use my freebsd email alias in the copyright. 2002-09-19 06:05:32 +00:00
Makefile Milestone #1 in cross-arch make releases. 2002-04-26 17:55:27 +00:00