9011 Commits

Author SHA1 Message Date
rwatson
b4a1a92fb0 Merge kern_thread.c:1.226,1.227, kern_exit.c:1.279:
On process and thread exit, submit pending records and free thread audit
state.

Obtained from:	TrustedBSD Project
2006-09-02 17:29:57 +00:00
rwatson
d927dc6a7a Merge vfs_lookup.c:187, namei.h:1.48 from HEAD to RELENG_6:
Add AUDITVNODE[12] flags to namei(), which cause namei() to audit path
  and vnode attribute information for looked up vnodes during the lookup
  operation.  This will allow consumers of namei() to specify that this
  information be added to the in-process audit record.

Obtained from:	TrustedBSD Project
2006-09-02 17:24:36 +00:00
sam
bde6ea34d5 MFC 1.37: start threads stopped before adjusting priority to avoid
races, generate console msg if thread create fails
2006-09-02 15:28:09 +00:00
rwatson
a4006541ce Merge kern_exit.c:1.277, kern_fork.c:1.254 from HEAD to RELENG_6:
Hook up audit to fork() and exit() events.  These changes manage the
  audit state on processes, not auditing of these events.

Obtained from:  TrustedBSD Project
2006-09-02 13:24:19 +00:00
rwatson
4fecaa2b4a Merge init_main.c:1.260 from HEAD to RELENG_6:
Hook up audit to the initial process creation events (proc0, proc1).

Obtained from:  TrustedBSD Project
2006-09-02 13:15:58 +00:00
rwatson
081bb17939 Merge proc.h:1.449 and kern_thread.:1.225 from HEAD to RELENG_6:
Add new fields to process-related data structures:

  - td_ar to struct thread, which holds the in-progress audit record during
    a system call.

  - p_au to struct proc, which holds per-process audit state, such as the
    audit identifier, audit terminal, and process audit masks.

  In the earlier implementation, td_ar was added to the zero'd section of
  struct thread.  In order to facilitate merging to RELENG_6, it has been
  moved to the end of the data structure, requiring explicit
  initalization in the thread constructor.

Obtained from:  TrustedBSD Project
2006-09-02 12:48:49 +00:00
rwatson
8200f1382d Back out prematurely MFC'd audit changes, accidentally MFC'd by jeff in
vfs_syscalls.c:1.392.2.7.
2006-09-02 12:34:55 +00:00
ssouhlal
6a73ffa242 MFC r1.217:
The "taskqueue_fast" spinlocks were renamed to "fast_taskqueue" in
  subr_taskqueue.c:r1.32

  Reported by:    rdivacky
2006-09-02 05:42:16 +00:00
cperciva
7ec35607b9 MFC: Fix a signedness bug.
Security:	Local DoS
2006-08-25 12:36:54 +00:00
rwatson
672943c042 Merge vfs_lookup.c:1.92 from HEAD to RELENG_6:
We now spell "inode" as "vnode" in the VFS layer, so update comment
  for new world order.

  Pointed out by: mckusick
2006-08-18 14:03:29 +00:00
jhb
9701d35e4f MFC several DDB improvements including the simpler 'ps', 'show proc',
'show thread' (currently doesn't work due to a ddb bug that in 6.x
that causes 'show thread' to be treated as 'show threads'), 'show lockmgr',
'show sleepchain', 'show lockchain', 'show allchains', 'show locktree',
'show sleepq', and 'show turnstile'.
2006-08-17 19:53:06 +00:00
alc
e063b5f9c4 MFC revision 1.225
Use NET_LOCK_GIANT() and VFS_LOCK_GIANT() instead of unconditionally
  acquiring Giant in kern_sendfile().

  Guard against the forced reclamation of a vnode in kern_sendfile().
2006-08-15 18:48:51 +00:00
jhb
b01e8aa321 MFC: Fix error handling edge cases and register system calls later to make
system call modules more robust.
2006-08-11 19:23:49 +00:00
jhb
f31ad56d69 MFC: Adjust td_locks for non-spin mutexes and sx locks. 2006-08-11 18:54:10 +00:00
yar
06d94e5c79 MFC r1.170:
Kill an XXX remark that has been untrue since rev. 1.150 of this file.
2006-08-07 10:12:56 +00:00
jhb
4a569b95b2 MFC: Mark the thread pointer used during an adaptive spin volatile. 2006-08-01 18:39:39 +00:00
jhb
17f78c9df4 MFC: Write a magic value into mtx_lock when destroying a mutex. 2006-08-01 18:38:35 +00:00
jhb
12a43179a5 MFC: Sync up with HEAD in some of the locking primitive details:
- Teach WITNESS_SAVE() and WITNESS_RESTORE() to work with spin locks instead
  of only sleep locks.
- Do the extra step required when destroying a locked spin mutex.
- Initialize thread0.td_contested in init_turnstiles() rather than
  mutex_init().
- Add LOCK_CLASS() macro and sync with HEAD on its usage.  For RELENG_6
  this just maps to lock->lo_class.  (In HEAD lo_class was removed an array
  index was encoded into lo_flags instead.)
- Add subr_lock.c including adding lock_init() and lock_destroy() functions
  as we as moving the 'show lock' command into this file from kern_mutex.c.
2006-08-01 17:40:13 +00:00
jhb
7136395c52 MFC: Add a mutex to protect the list of interrupt config hooks. 2006-07-31 18:53:55 +00:00
rwatson
cefd778efa Merge sysv_shm.c:1.104 from HEAD to RELENG_6:
Re-order MAC and DAC checks in shmget() in order to give precedence to
  the MAC result, as well as avoid losing the DAC check result when MAC
  is enabled.

  Reported by:    Patrick LeBlanc <Patrick dot LeBlanc at sparta dot com>

Reminded by:	shangjie dot li at gmail dot com
2006-07-24 23:41:38 +00:00
pjd
677f00c71a MFC: sys/kern/vfs_vnops.c 1.244
Simplify the code and remove two mutex operations.
2006-07-16 16:05:50 +00:00
njl
1295d3c737 MFC 1.190: notify devd of resume events 2006-07-15 22:53:53 +00:00
maxim
772cc4fda4 MFC rev. 1.168: for sockets with LOCAL_CREDS option remove all previous
linked SCM_CREDS control messages and then add a control message with
struct sockcred so the process specifically asked for the peer credentials
by LOCAL_CREDS option always gets struct sockcred.
2006-07-13 13:42:37 +00:00
imp
34d3db45f9 MFC: subr_bus.c 1.194, bus_if.m 1.30, bus.h 1.75:
Create bus_enumerate_hinted_children.  This routine will allow
	drivers to use the hinted child system.  Bus drivers that use
	this need to implmenet the bus_hinted_child method, where they
	actually add the child to their bus, as they see fit.  The bus
	is repsonsible for getting the attribtues for the child,
	adding it in the right order, etc.  ISA hinting will be
	updated to use this method.
2006-07-12 22:57:57 +00:00
glebius
f1f47c97e3 MFC: sync taskqueue api with HEAD modulo preserving the calling
convention for taskqueue_create

This is replay of [1], that was backed out before 6.1-RELEASE
due to breaking ACPI on certain laptops. The [2] commit has
fixed this problem. bsam@, who once reported the breakage
confirms that after [2] the problem has vanished and now it
is safe to merge [1] again.

[1] http://lists.freebsd.org/pipermail/cvs-src/2006-March/061203.html
[2] http://lists.freebsd.org/pipermail/cvs-src/2006-June/065256.html

Tested by:	bsam
2006-07-06 08:32:50 +00:00
kib
6b3c448bc0 MFC rev. 1.637:
Fix the LOR that occurs when the MAC compiled into the kernel
and vnode is destroyed.

LOR:		189
Approved by:	kan (mentor)
2006-07-05 16:34:16 +00:00
maxim
1ff9d689a9 o MFC rev. 1.50: expand an exclusive lock scope. 2006-06-29 03:27:04 +00:00
rwatson
18cd364e3b Merge uipc_socket.c:1.267 from HEAD to RELENG_6:
Rearrange code in soalloc() so that it's less indented by returning
  early if uma_zalloc() from the socket zone fails.  No functional
  change.
2006-06-28 15:01:08 +00:00
rwatson
7880900fff Merge uipc_socket2.c:1.158 and socketvar.h:1.150 from HEAD to RELENG_6:
Remove sbinsertoob(), sbinsertoob_locked().  They violate (and have
  basically always violated) invariannts of soreceive(), which assume
  that the first mbuf pointer in a receive socket buffer can't change
  while the SB_LOCK sleepable lock is held on the socket buffer,
  which is precisely what these functions do.  No current protocols
  invoke these functions, and removing them will help discourage them
  from ever being used.  I should have removed them years ago, but
  lost track of it.

  Prodded almost by accident by:  peter
2006-06-28 14:33:47 +00:00
alfred
f34c6266e1 MFC: don't deref NULL for really old modules. 2006-06-20 19:56:26 +00:00
rodrigc
e122f21ee1 MFC: msdosfs_vfsops.c:1.150, ntfs_vfsops.c:1.83, udf_vfsops.c:1.41
ext2_vfsops.c:1.157, cd9660_vfsops.c:1.145, ffs_vfsops.c:1.314,
     reiserfs_vfsops.c:1.5

  Remove calls to vfs_export() for exporting a filesystem for NFS mounting
  from individual filesystems.  Call it instead in vfs_mount.c,
  after we call VFS_MOUNT() for a specific filesystem.
2006-06-17 20:02:28 +00:00
gnn
1b59068b4f MFC a forgotten fix
Make sure that there actually is a next packet before setting
nextrecord to that field.

PR: 83885
Submitted by: hirose@comm.yamaha.co.jp
2006-06-17 17:47:05 +00:00
jhb
d426800e18 MFC: Change msleep() and tsleep() to not alter the calling thread's
priority if the specified priority is zero.
2006-06-16 22:11:55 +00:00
rwatson
d695f65f2a Merge uipc_socket2.c:1.153 from HEAD to RELENG_6:
Add a sysctl, regression.sonewconn_earlytest, which when options
  REGRESSION is enabled, allows user space to dictate that sonewconn()
  should skip it's "skip the hard work" check to see if the listen
  queue is full, and instead proceed with allocation of a socket and
  trimming of the overflowed queue.  This makes it easier to test the
  queue overflow logic.
2006-06-11 16:23:44 +00:00
rodrigc
1ab8d17367 MFC:
1.207:
	Add "errmsg" to list of global mount options.

1.225:
	Add "update" mount option to global_opts array,
	for use with vfs_filteropt().
2006-06-03 21:47:11 +00:00
tegge
8ca437edd4 MFC: Close race between vmspace_exitfree() and exit1() and races between
vmspace_exitfree() and vmspace_free() which could result in the same
     vmspace being freed twice.

     Factor out part of exit1() into new function vmspace_exit().  Attach
     to vmspace0 to allow old vmspace to be freed earlier.

     Add new function, vmspace_acquire_ref(), for obtaining a vmspace
     reference for a vmspace belonging to another process.  Avoid changing
     vmspace refcount from 0 to 1 since that could also lead to the same
     vmspace being freed twice.

     Change vmtotal() and swapout_procs() to use vmspace_acquire_ref().
2006-06-02 00:26:27 +00:00
ps
c1361e659d MFC: Allow concurrent read(2)/readv(2) access to a file. Lock file
offset against multiple read calls.
2006-05-30 02:58:36 +00:00
rodrigc
6cfcaeedd1 MFC: 1.208
In devfs_first(), set mp->mnt_opt to a valid empty list of mount options
instead of leaving it NULL.  This eliminates a kernel panic
when trying to do a mount -o update of /dev.

Noticed by:	cjsp
Reviewed by:	phk
2006-05-28 18:44:47 +00:00
jkim
fa42b82744 MFC: src/lib/libstand/printf.c 1.9
src/sys/kern/subr_prf.c		1.123

Implement printf 'X' conversion for both libstand and kernel.
2006-05-22 23:51:14 +00:00
maxim
f9edac6fd5 MFC rev. 1.167: inherit LOCAL_CREDS option from listen socket
for sockets returned by accept(2).
2006-05-21 09:12:24 +00:00
csjp
1b728c44bc MFC revision 1.288
date: 2006/04/10 14:07:28;  author: csjp;  state: Exp;  lines: +0 -2
Kill the last Giant acquisition in the exit(2) code. This Giant acquisition
doesn't appear to be protecting anything. Most of consumers funsetownlst(9)
do not appear to be picking up Giant anywhere. This was originally a part
of my Giant exit(2) clean up revision 1.272 but I thought it was a good idea
to leave it out until we were able to analyze it better.
2006-05-20 02:54:34 +00:00
davidxu
c07d62133b MFC following revisions:
sys/ptrace.h		1.27
	kern/sys_process	1.135

	get LWP's signal info.
2006-05-17 00:41:49 +00:00
ps
ba7f78e7d1 MFC: Allow for nmbclusters and maxsockets to be increased via sysctl. 2006-05-16 07:27:49 +00:00
davidxu
846f661226 MFC revision 1.101 2006-05-16 00:23:44 +00:00
ps
01b2a3d145 MFC: rev 1.329
Don't try to kill embryonic processes in  killpg1().  This prevents
a race condition between fork() and kill(pid,sig) with pid < 0 that
can cause a kernel panic.
2006-05-15 18:53:00 +00:00
ps
2f5ab57b80 MFC: Properly support for FreeBSD 4 32bit System V shared memory.
Submitted by:	peter
2006-05-15 18:47:52 +00:00
ps
c3bbc5629b MFC: 32bit sendfile support 2006-05-15 18:34:06 +00:00
tegge
09952cce7b MFC: Call vn_finished_write() before calling the coredump handler which will
indirectly call vn_start_write() as necessary for each write.
2006-05-14 01:07:48 +00:00
tegge
d09d10cb05 MFC: Temporarily unlock vnode for new image being executed to avoid lock
order reversals that can lead to deadlocks.  Normally vn_close(),
     namei() or vrele() should not be called while holding vnode locks.
2006-05-14 00:46:13 +00:00
pjd
0b852a3c37 MFC: sys/kern/vfs_subr.c 1.671
vn_start_write()/vn_finished_write() is not needed here, because
vn_start_write() is always called earlier in the code path and calling
the function recursively may lead to a deadlock.

Confirmed by:	tegge
2006-05-13 14:01:35 +00:00