9011 Commits

Author SHA1 Message Date
rwatson
6b59c6623b Merge kern_proc.c:1.255 from HEAD to RELENG_6:
Test that p_textvp is non-NULL be dereferencing, as no executable vnode is
  set for kernel processes.

  Reported by:    Skip Ford <skip at menantico dot com>

Approved by:    re (kensmith)
2007-11-24 19:45:57 +00:00
jb
a1dd99d2f5 MFC Add pathname to the linker_file structure. 2007-11-18 00:15:32 +00:00
jhb
6f26eff25b MFC: Make it easier to add more ptys to the pty(4) driver.
Approved by:	re (kensmith)
2007-11-15 20:20:54 +00:00
julian
f6218756ff MFC of un-neede singl-threading code. 2007-11-06 03:01:32 +00:00
phk
9291e301e6 MFC:
bus_alloc_resources() convenience API
2007-11-05 11:49:44 +00:00
csjp
95075604ca MFC revision 1.350, move where we audit the PID to ensure that it gets
audited even if it's invalid.
2007-11-04 18:22:25 +00:00
jhb
f62ca665b2 MFC 1.55: Fix another edge case in rman_manage_region() that could result
in the the resource list getting missorted.
2007-11-02 19:00:06 +00:00
emaste
a95f700077 MFC to RELENG_6 part of kern_intr.c revision 1.142:
- Don't do the interrupt storm protection stuff for software interrupt
    handlers.
2007-10-29 21:10:03 +00:00
cognet
62c34d6b2a Oops. Remove a debug printf.
Spotted out by:	delphij
2007-10-16 21:32:19 +00:00
cognet
82ceddb921 Use 16 - 1 instead of 16 as the align argument of uma_zcreate(), as it's
what is expected.
2007-10-16 21:10:26 +00:00
jhb
9ad5f6f445 MFC: Always use an exclusive lock on the leaf vnode during an open() when
shared lookups are enabled.  This closes a few races including a race where
concurrent opens of a fifo could result in different v_fifoinfo structures
in different threads.
2007-10-03 21:06:05 +00:00
jhb
3c7672b104 Remove the *_queue() variants of various sleepq and turnstile functions
and always require the queue to be specified to reduce diffs with HEAD.
These APIs are internal APIs only used to implement higher level primitives
such as locks and condition variables.

Approved by:	alfred
2007-09-27 20:24:56 +00:00
jhb
1248dc42fa MFC some comment updates to account for multi-queue support missed earlier
as well as a few other changes (whitespace, style, etc.) to reduce diffs
with HEAD.
2007-09-27 18:44:16 +00:00
jhb
bf60b344e1 - Remove some debugging nits in the MFC of rwlocks that looked for cases
where a reader blocked on a lock with no owner and just assert that it
  never happens like HEAD.
- Actually set td->td_tsqueue to the sub-queue of a turnstile that a
  thread is actually enqueued to.  Otherwise, the kernel would always
  think that threads were on the queue for exclusive (write) waiters
  (queue 0).  Thus, if the priority of a thread waiting on a read lock
  was adjusted while it was waiting it could result in corrupting the
  queue of waiting threads.
2007-09-27 18:39:18 +00:00
jhb
f8d0499c66 MFC 1.167: Use a UMA zone to handle the turnstile objects rather than
malloc(9).
2007-09-27 18:23:44 +00:00
jhb
a4cadc0209 Make td_sqqueue a char and move it into a pre-existing "hole" from
alignment padding to restore the ABI of 'struct thread' in 6.x.
2007-09-27 18:12:25 +00:00
jhb
bcef6cfce9 - Restore the 'show sleepq' DDB command.
- Trim some extra includes.
2007-09-27 18:10:40 +00:00
jhb
5c87605e74 Use lock_init() and lock_destroy(). 2007-09-27 18:08:09 +00:00
jhb
532b026a40 A few tweaks to reduce diffs with HEAD including using lock_init() and
lock_destroy() and adding a missing #include so that NO_ADAPTIVE_RWLOCKS
is honored.
2007-09-27 18:06:49 +00:00
obrien
fb0af2dfab MFC: new kernel config option, VERBOSE_SYSINIT.
(kern/init_main.c rev. 1.263)
2007-09-14 22:44:37 +00:00
alfred
d85be45214 FreeBSD 7 has a macro that converts calls to sx_init -> sx_init_flags,
however FreeBSD 6 needs this as a function to preserve binary compat.

Pointed out by: kmacy
2007-09-10 23:43:52 +00:00
alfred
6df6b1c5ea Remove/refactor calls to turnstile_release() as it turns out that
turnstile_unpend_queue() drops the lock that turnstile_release()
does.  This was triggering a mtx_unlock() of an already unlocked
mutex panic.

Obtained from: Juniper Networks
2007-09-05 22:18:39 +00:00
alfred
7740e0f542 Unbreak "options DDB" breakage from previous commit. 2007-09-05 17:38:28 +00:00
alfred
bf462b58be Backport of optimized sx locks and rwlocks from FreeBSD 7.0.
Reviewed by: attilio, jhb
Obtained from: Juniper Networks
2007-09-04 22:40:40 +00:00
jinmei
94c889fde1 MFC:
Fix a kernel panic based on receiving an ICMPv6 Packet too Big message.
  (MFC was planned but has been missed)

PR:		99779
Submitted by:	Jinmei Tatuya
Reviewed by:	clement, rwatson
Approved by:	gnn (mentor)

src/sys/kern/uipc_socket.c:	1.280
2007-08-23 18:17:08 +00:00
njl
0e4a0c6c62 MFC 1.26 and 1.27: use proper loop variables and sched_bind() behavior 2007-08-22 04:55:05 +00:00
cvs2svn
c37f50f631 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2007-08-18 04:08:54 +00:00
jhb
153695bbdc MFC 1.87: Avoid manipulating semu_list outside of the scope of
SEMUNDO_LOCK().  This would lead to an occasional hang with a cycle in
semu_list.
2007-08-08 16:42:47 +00:00
kib
b06a1c7235 MFC rev. 1.273, submitted by peter:
Change kn_hook value from cdev to struct tty to avoid dereferencing freed
cdev.
In ttygone(), wake up select(), sigio and kevent() users in addition
to the queue sleepers.
Return EV_EOF from kevent filters if TS_GONE is set.
2007-08-03 14:24:38 +00:00
jhb
31ca82f7fe MFC: Close race conditions between fork() and [sg]etpriority()'s
PRIO_USER case, and possibly also other places that deference p_ucred.
2007-07-19 18:46:32 +00:00
netchild
47a37c3274 MFC (3 of X):
- In preparation of further linuxulator fixes MFC kern_descrip.c rev 1.296 and
   syscallsubr.h rev 1.41 by jhb:
   Add a kern_close() so that the ABIs can close a file descriptor w/o having
   to populate a close_args struct and change some of the places that do.

Tested by:	scf (i386, as part of a mega-MFC-patch),
		Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
2007-07-08 08:44:48 +00:00
jhb
27111628aa MFC 1.306: Conditionally acquire Giant when dropping a reference on the
ktrace vnode during execve().
2007-06-25 23:58:46 +00:00
emaste
149b7332ae MFC compat32 argument to do_wait() to make it use fuword32() for readling
longs from 32 bit processes.

Submitted by:	jhb
2007-06-23 19:18:50 +00:00
jhb
9d52499b7d MFC: Support for running 32-bit multithreaded binaries using libthr on
amd64 including:
- Add 32-bit wrappers for thr_new(), thr_suspend(), and the umtx system
  calls.
- Add support to amd64 for constructing thread upcalls for 32-bit
  processes.
- Leave %fs and %gs alone in the signal trampoline for 32-bit processes on
  amd64.
- Add 'casuword32()' to amd64 and ia64.

Tested by:	emaste
2007-06-18 22:44:59 +00:00
kib
871318d35c MFC
rev. 1.521 of src/sys/kern/vfs_bio.c
rev. 1.477 of src/sys/sys/proc.h

Disable nesting of BOP_BDFLUSH().
2007-06-11 11:27:04 +00:00
kib
b75617bf6d MFC:
rev. 1.11 of src/sys/geom/geom_vfs.c
rev. 1.516 of src/sys/kern/vfs_bio.c
rev. 1.35 of src/sys/nfs4client/nfs4_vnops.c
rev. 1.272 of src/sys/nfsclient/nfs_vnops.c
rev. 1.195 of src/sys/sys/buf.h
rev. 1.18 of src/sys/sys/bufobj.h
rev. 1.73 of src/sys/ufs/ffs/ffs_extern.h
rev. 1.133 of src/sys/ufs/ffs/ffs_snapshot.c
rev. 1.324 of src/sys/ufs/ffs/ffs_vfsops.c

Avoid dealing with buffers in bdwrite() that are from other side of
snaplock divisor in the lock order then the buffer being written. Add
new BOP, bop_bdwrite(), to do dirty buffer flushing for same vnode in
the bdwrite(). Default implementation, bufbdflush(), refactors the code
from bdwrite(). For ffs device buffers, specialized implementation is
used.

This commit changes KPI/KBI, thus recompilation of out of tree kernel
modules is required.

Approved by:	re (kensmith)
2007-06-11 10:53:48 +00:00
jhb
d7d8ad2d28 MFC: Add support for kernel modules with a single PT_LOAD section. 2007-06-06 21:43:35 +00:00
jhb
8cb531edb0 MFC 1.176: Add vm map and object locking to each_writable_segment(). 2007-06-06 21:30:42 +00:00
kib
70815715b0 MFC rev. 1.309 of sys/kern/kern_descrip.c,
rev. 1.438 of sys/kern/vfs_syscalls.c,
    rev. 1.77 of sys/sys/filedesc.h:
Mark the filedescriptor table entries with VOP_OPEN being performed for them
as UF_OPENING. Disable closing of that entries. This should fix the crashes
caused by devfs_open() (and fifo_open()) dereferencing struct file * by
index, while the filedescriptor is closed by parallel thread.

RELENG_6 testing by:	Mark Kane <mark at mkproductions org>
2007-05-29 10:09:43 +00:00
des
dc22b24953 MFC: expose vdropl() 2007-05-24 16:09:38 +00:00
jhb
63a2b7e3f0 MFC 1.308: Use kern_open() to open /dev/null in fdcheckstd(). 2007-05-23 20:36:24 +00:00
jhb
348f936c25 Revert previous commit, was part of a different change.
Reported by:	kib
2007-05-23 20:29:41 +00:00
jhb
3464b119cd MFC: Rework the support used by ABIs to override resource limits so that
a 64-bit process exec'd by a 32-bit process doesn't end up with 32-bit
limits.

This doesn't break the ABI as neither of the 32-bit ABIs (COMPAT_LINUX32
and COMPAT_IA32) are buildable as modules on 6.x/amd64 and none of the
other ABIs use this hook.
2007-05-23 18:24:43 +00:00
jhb
26d5a031e1 MFC: Move cpu_exit() earlier in exit1() to close a race between
SIGCHLD/kevent(2) notification and wait().
2007-05-17 13:52:37 +00:00
rwatson
24ce98f8af Merge uipc_usrreq.c:1.193 from HEAD to RELENG_6:
Change unp_mtx to supporting recursion, and do not drop the unp_mtx over
  sonewconn() in unp_connect().  This avoids a race that occurs due to
  v_socket being an uncounted reference, as the lock was being released in
  order to call sonewconn(), which otherwise recurses into the UNIX domain
  socket code via pru_attach, as well as holding the lock over a sleeping
  memory allocation in uipc_attach().  Switch to a non-sleeping memory
  allocation during UNIX domain socket attach.

  This fix non-ideal in that it requires enabling recursion, but is a much
  smaller change than moving to using true references for v_socket.  The
  reported panic occurs in unp_connect() following the return of
  sonewconn().

  Update copyright year.

  Panic reported by:      jhb

Tested by:	jhb
2007-05-10 20:00:35 +00:00
kib
895c6e63c2 MFC rev. 1.259:
Allow the dounmount() to proceed even for doomed coveredvp.
2007-05-10 09:18:07 +00:00
rwatson
fd61efb850 Merge uipc_usrreq.c:1.196 from HEAD to RELENG_6:
Add an additional MAC check to the UNIX domain socket connect path:
  check that the subject has read/write access to the vnode using the
  vnode MAC check.

  Submitted by:   Spencer Minear <spencer_minear at securecomputing dot com>
  Obtained from:  TrustedBSD Project
2007-05-08 11:50:57 +00:00
rwatson
494d24c324 Merge uipc_usrreq.c:1.187 from HEAD to RELENG_6:
Minor white space tweaks.
2007-05-08 11:47:19 +00:00
rwatson
6535ebc20e Merge uipc_usrreq.c:1.186, uipc_proto.c:1.27, domain.h:1.22, files:1.1137
from HEAD to RELENG_6:

  Move definition of UNIX domain socket protosw and domain entries from
  uipc_proto.c to uipc_usrreq.c, making localdomain static.  Remove
  uipc_proto.c as it's no longer used.  With this change, UNIX domain
  sockets are entirely encapsulated in uipc_usrreq.c.
2007-05-08 11:45:12 +00:00
rwatson
161ac9e37c Merge uipc_proto.c:1.26 from HEAD to RELENG_6:
Remove UNIX domain socket raw socket support.  This feature is documented
  as being undocumented in Stevens, and was broken in 1997 during network
  stack infrastructure work.  It is the one remaining (and incorrect)
  direct protocol reference to raw_usrreq.pru_attach; this is incorrect
  because the raw socket code assumes that raw_uattach is called only after
  the protocol has allocated a PCB.
2007-05-08 11:07:24 +00:00