1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00
freebsd/sys
Bruce Evans a4b8c657a3 Use a critical region to protect pushing of the parent's npx state to the
pcb for fork().  It was possible for the state to be saved twice when an
interrupt handler saved it concurrently.  This corrupted (reset) the state
because fnsave has the (in)convenient side effect of doing an implicit
fninit.  Mundane null pointer bugs were not possible, because we save to
an "arbitrary" process's pcb and not to the "right" place (npxproc).

Push the parent's %gs to the pcb for fork().  Changes to %gs before
fork() were not preserved in the child unless an accidental context
switch did the pushing.  Updated the list of pcb contents which is
supposed to inhibit bugs like this.  pcb_dr*, pcb_gs and pcb_ext were
missing.  Copying is correct for pcb_dr*, and pcb_ext is already
handled specially (although XXX'ly).

Reducing the savectx() call to an npxsave() call in rev.1.80 was a
mistake.  The above bugs are duplicated in many places, including in
savectx() itself.

The arbitraryness of the parent process pointer for the fork()
subroutines, the pcb pointer for savectx(), and the save87 pointer
for npxsave(), is illusory.  These functions don't work "right" unless
the pointers are precisely curproc, curpcb, and the address of npxproc's
save87 area, respectively, although the special context in which they
are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy)
to work.  cpu_fork() just doesn't work unless the parent process
pointer is curproc, or the caller has pushed %gs to the pcb, or %gs
happens to already be in the pcb.
2001-05-13 07:44:14 +00:00
..
alpha Simply the vm fault trap handling code a bit by using if-else instead of 2001-05-11 23:17:54 +00:00
amd64 Use a critical region to protect pushing of the parent's npx state to the 2001-05-13 07:44:14 +00:00
arm/include
boot FICL 2.05 has a flawed definition of BASE. Fix it. 2001-05-10 05:13:09 +00:00
cam Exploit recent improvements in the disk minilayer to simplify error 2001-05-08 08:30:48 +00:00
coda Implement vop_std{get|put}pages() and add them to the default vop[]. 2001-05-01 08:34:45 +00:00
compat Avoid overflow when converting ticks to jiffies. 2001-05-09 11:41:54 +00:00
compile
conf I'll be making some rather substantial changes to the pci attachment 2001-05-13 01:52:55 +00:00
contrib/dev Actually biofinish(struct bio *, struct devstat *, int error) is more general 2001-05-06 20:00:03 +00:00
crypto
ddb Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
dev Remove safety belt that checks for miibus in the config file. This 2001-05-13 05:38:59 +00:00
fs GC prototype for procfs_bmap() missed during a previous commit. 2001-05-11 23:37:37 +00:00
geom Polish error handling with biofinish(). 2001-05-08 09:10:27 +00:00
gnu When running with soft updates, track the number of blocks and files 2001-05-08 07:42:20 +00:00
i4b pseudo-device -> device in kernel config. 2001-05-01 11:26:14 +00:00
i386 Use a critical region to protect pushing of the parent's npx state to the 2001-05-13 07:44:14 +00:00
ia64 Simplify the vm fault trap handling code a bit by using if-else instead of 2001-05-11 23:50:08 +00:00
isa Actually biofinish(struct bio *, struct devstat *, int error) is more general 2001-05-06 20:00:03 +00:00
isofs/cd9660 Implement vop_std{get|put}pages() and add them to the default vop[]. 2001-05-01 08:34:45 +00:00
kern Simplify the vm fault trap handling code a bit by using if-else instead of 2001-05-11 23:50:08 +00:00
libkern
miscfs GC prototype for procfs_bmap() missed during a previous commit. 2001-05-11 23:37:37 +00:00
modules Update makefile to reflect vlan support. 2001-05-13 00:04:02 +00:00
msdosfs Implement vop_std{get|put}pages() and add them to the default vop[]. 2001-05-01 08:34:45 +00:00
net Get IP multicast working on VLAN devices: 2001-05-02 16:12:58 +00:00
netatalk
netatm
netgraph Don't reference a node after we dropped a reference to it 2001-04-11 22:04:47 +00:00
netinet In in_ifadown(), differentiate between whether the interface goes 2001-05-11 14:37:34 +00:00
netinet6 Fix typo in previous commit. 2001-04-20 08:43:20 +00:00
netipx Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
netkey Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
netnatm
netncp Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
netns
netsmb Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
nfs Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
nfsclient Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
nfsserver Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
ntfs Implement vop_std{get|put}pages() and add them to the default vop[]. 2001-05-01 08:34:45 +00:00
nwfs Implement vop_std{get|put}pages() and add them to the default vop[]. 2001-05-01 08:34:45 +00:00
pc98 - Split out the support for per-CPU data from the SMP code. UP kernels 2001-05-10 17:45:49 +00:00
pccard Return errors for unsupported operations on pcic_get_res_flags rather 2001-05-13 04:44:45 +00:00
pci I'll be making some rather substantial changes to the pci attachment 2001-05-13 01:52:55 +00:00
posix4 o First step in cleaning up authorization code for the posix4 2001-05-06 16:15:42 +00:00
powerpc Trim lots of stuff that is now in MI code along with MD alpha code. 2001-05-10 17:58:35 +00:00
rpc
svr4
sys Add a new macro to test if a process' proc lock is held by the current 2001-05-11 21:28:37 +00:00
tools
ufs Remove yet another deadlock case. 2001-05-11 07:12:03 +00:00
vm Actually biofinish(struct bio *, struct devstat *, int error) is more general 2001-05-06 20:00:03 +00:00
Makefile