Commit Graph

57750 Commits

Author SHA1 Message Date
Qing Li
737b12e98f Fixes a crash due to the memory of the newly allocated syncache entry
in syncache_lookup() is not cleared and may lead to an arbitrary and
bogus rtentry pointer which later gets free'd.

Reviewed by: andre
MFC after: 3 days
2006-02-07 19:59:46 +00:00
John Baldwin
222fdf4bff Provide some anti-footshooting. Don't allow the user to set the interval
for acctwatch() runs to be negative or zero as this could result in either
a possible hang (or panic if INVARIANTS is on).  Previously the accounting
code handled the <= 0 case by calling acctwatch on every clock tick (eww!)
due to an implementation detail of callout_reset().  (Tick counts of
<= 0 are converted to 1).

MFC after:	3 days
2006-02-07 18:59:47 +00:00
Warner Losh
37a395c110 This file isn't GENERIC, so change the header 2006-02-07 18:45:54 +00:00
Warner Losh
e51680a229 Rather than pull in all the phy, just pull in the lxt phy that we need
for this board (although our lxtphy driver isn't claiming it, but that's
a different problem).

This saves 57k in this kernel.
2006-02-07 18:43:46 +00:00
Warner Losh
ca6831c711 Allow one to subset phy. If you want the kitchen sink, use device
miibus (like today).  If you want a subset, choose device mii and zero
or more phy to include.  We always include unkphy.  We make use of
the | functionality that ruslan recently added to config.

This allowed me to trim 57k from my KB9202 kernel.
2006-02-07 18:41:56 +00:00
Warner Losh
22293c3afb Detach the children before we delete them. This is a little cleaner
than just deleting them.  Also add comments about why we do this.
Given the current behavior of delete_child, I don't think this changes
anything.  It just feels cleaner.
2006-02-07 18:38:51 +00:00
Yaroslav Tykhiy
a35ebcc25d INET doesn't belong to opt_inet6.h: INET6 belongs to it. 2006-02-07 18:13:56 +00:00
Christian Brueffer
9864500624 Clean up some sysctl descriptions, debug messages etc.
Approved by:	pjd
MFC after:	3 days
2006-02-07 17:23:22 +00:00
John Baldwin
505a14934e - Add a kthread to periodically call acctwatch() when accounting is active
instead of calling acctwatch() from softclock.  The acctwatch() function
  needs to hold an sx lock and also makes a VFS call, and neither of these
  are good things (or safe) to do from a callout.  The kthread only exists
  and is running when accounting is turned on; it is started and stopped
  as needed.  I didn't run acctwatch() via the thread taskqueue at Robert's
  request as he was worried that if the accounting file was over NFS the
  VFS_STAT() calls might stall other work on the taskqueue.
- Add an acct_disable() function to take care of closing the accounting
  vnode and cleaning up so we don't duplicate the same code in two
  different places.

MFC after:	3 days
2006-02-07 16:04:03 +00:00
Robert Watson
860ae58e3f Fix queue drop logic when the queue overflows: decrement queue length.
Obtained from:	TrustedBSD Project
2006-02-07 14:46:26 +00:00
Ruslan Ermilov
ee439c43ae Remove .depend when doing "make cleandir". 2006-02-07 13:37:26 +00:00
Gleb Smirnoff
d640400bc5 Since em(4) taskqueue is a new network context, we need to conditionally
lock Giant here.

Submitted by:	Andrey V. Elsukov <bu7cher yandex.ru>
2006-02-07 13:11:13 +00:00
Oleg Bulyzhin
6edb555dbc Fix five years old bug in ip_reass(): if we are using 'full' (i.e. including
pseudo header) hardware rx checksum offloading ip_reass() fails to calculate
TCP/UDP checksum for reassembled packet correctly.  This also should fix
recent 'NFS over UDP over bge' issue exposed by if_bge.c rev. 1.123

Reviewed by:	sam (earlier version), bde
Approved by:	glebius (mentor)
MFC after:	2 weeks
2006-02-07 11:48:10 +00:00
Jeff Roberson
fbf586bd40 - No need to WANTPARENT when we're just going to vrele it in a deadlock
prone way later.

Reported by:	kkenn
MFC After:	3 days
2006-02-07 11:31:32 +00:00
Marcel Moolenaar
f9d7b4d515 Allocate memory for the MCA state information with M_NOWAIT. We can
get a MCA event at any moment and it may not be safe to sleep.

MFC after: 3 days
2006-02-07 02:02:14 +00:00
Robert Watson
09daf1c828 Add support for audit pipe special devices, which allow user space
applications to insert a "tee" in the live audit event stream.  Records
are inserted into a per-clone queue so that user processes can pull
discreet records out of the queue.  Unlike delivery to disk, audit pipes
are "lossy", dropping records in low memory conditions or when the
process falls behind real-time events.  This mechanism is appropriate
for use by live monitoring systems, host-based intrusion detection, etc,
and avoids applications having to dig through active on-disk trails that
are owned by the audit daemon.

Obtained from:	TrustedBSD Project
2006-02-06 22:50:39 +00:00
Robert Watson
c9d97251e3 Alphabetize. 2006-02-06 22:34:29 +00:00
Robert Watson
cba07e4acc Manage audit record memory with the slab allocator, turning
initialization routines into a ctor, tear-down to a dtor, cleaning
up, etc.  This will allow audit records to be allocated from
per-cpu caches.

On recent FreeBSD, dropping the audit_mtx around freeing to UMA is
no longer required (at one point it was possible to acquire Giant
on that path), so a mutex-free thread-local drain is no longer
required.

Obtained from:	TrustedBSD Project
2006-02-06 22:30:54 +00:00
Olivier Houchard
ea9f99ddcd - Call mii_phy_probe() after we allocated an ifp. mii has this evil
hack where it assumes the first field of the driver softc is the struct
ifnet, and it copies its value in mii_phy_probe().
- In the interrupt handler, set the mbuf m_len field on packet receive.
2006-02-06 22:17:42 +00:00
Robert Watson
ce41b52994 Regenerate. 2006-02-06 22:15:00 +00:00
Robert Watson
68b21daa64 Assign audit event identifiers to ibcs2 system calls.
Obtained from:	TrustedBSD Project
2006-02-06 22:14:50 +00:00
John Baldwin
8917b8d28c - Always call exec_free_args() in kern_execve() instead of doing it in all
the callers if the exec either succeeds or fails early.
- Move the code to call exit1() if the exec fails after the vmspace is
  gone to the bottom of kern_execve() to cut down on some code duplication.
2006-02-06 22:06:54 +00:00
John Baldwin
809f984b21 Add a kern_eaccess() function and use it to implement xenix_eaccess()
rather than kern_access().

Suggested by:	rwatson
2006-02-06 22:00:53 +00:00
John Baldwin
934ba9b2cf - Move the wakeup() for exiting kthreads out of exit1() and into
kthread_exit() as that is cleaner and less obscured.  It also does the
  wakeup sooner.
- Add some comments to kthread_exit().
2006-02-06 21:56:13 +00:00
John Baldwin
2c9d9d392a We don't need the proc lock to check P_KTHREAD on curthread since it is
only set before the kthread starts executing and is never cleared.
2006-02-06 21:54:47 +00:00
Søren Schmidt
52c7e322b2 Unbreak DMA dumo on Intel 31224. 2006-02-06 19:17:48 +00:00
Olivier Houchard
123f34932c Use memory clobbers, to be on the safe side.
Suggested by:	jhb
2006-02-06 18:29:05 +00:00
Olivier Houchard
2a3b10658d rwlock expects the struct thread to be aligned on 8 bytes, so make sure
thread0 is.
2006-02-06 16:03:10 +00:00
Ruslan Ermilov
e497d0cdba Two fixes:
- Run send queue down to completion, not just one packet.
  It has been observed to cause a stall queue otherwise.

- Prevent queueing multiple function calls to a node.

MFC after:	3 days
2006-02-06 14:30:21 +00:00
Jeff Roberson
04f6d3effa - Add a ref count to the mount structure. Sleep for up to 3 seconds in
vfs_mount_destroy waiting for this ref to hit 0.  We don't print an
   error if we are rebooting as the root mount always retains some refernces
   by init proc.
 - Acquire a mnt ref for every vnode allocated to a mount point.  Drop this
   ref only once vdestroy() has been called and the mount has been freed.
 - No longer NULL the v_mount pointer in delmntque() so that we may release
   the ref after vgone() has been called.  This allows us to guarantee
   that the mount point structure will be valid until the last vnode has
   lost its last ref.
 - Fix a few places that rely on checking v_mount to detect recycling.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:19:50 +00:00
Jeff Roberson
2f0bca553a - Don't check v_mount for NULL to determine if a vnode has been recycled.
Use the more appropriate VI_DOOMED flag instead.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:15:27 +00:00
Jeff Roberson
b73f64c484 - Fix silly VI locking that is used to check a single flag. The vnode
lock also protects this flag so it is not necessary.
 - Don't rely on v_mount to detect whether or not we've been recycled, use
   the more appropriate VI_DOOMED instead.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:14:12 +00:00
Jeff Roberson
36a52c3cae - Add the global 'rebooting' variable that is used to detect when
boot() has been called.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
2006-02-06 10:12:00 +00:00
Jeff Roberson
c4be19469a - Remove ifdef disabled code that doesn't have a chance of working anymore. 2006-02-06 10:10:42 +00:00
David Xu
ea8e65b0fa Add members pl_sigmask and pl_siglist into ptrace_lwpinfo to get lwp's
signal mask and pending signals.
2006-02-06 09:41:56 +00:00
Robert Watson
9653775b18 Regenerate. 2006-02-06 02:00:32 +00:00
Robert Watson
c983324ef5 Prefer AUE_FOO audit identifiers to AUE_O_FOO, which are largely left
over from the Darwin implementation.

When we implement a system call as a wrapper to sysctl(), audit it as
AUE_SYSCTL.  This leads to greater compatibility with Solaris audit
trails as sysctl() argument tokens are not the same as the ones for
the originaly system calls (i.e., setdomainname()).

Replace references to AUE_ events that are equivilent to AUE_NULL with
AUE_NULL.  In the case of process signal configuration, this is
because these events do not require auditing.

Move from the Darwin spelling of getsockopt() to the FreeBSD/Solaris
one.

Audit nmount().

Obtained from:	TrustedBSD Project
2006-02-06 02:00:06 +00:00
Robert Watson
89964dd284 When exiting a thread, submit any pending record. Today, we don't
audit thread exit, but should that happen, this will prevent
unhappiness, as the thread exit system call will never return, and
hence not commit the record.

Pointed out by/with:	cognet
Obtained from:		TrustedBSD Project
2006-02-06 01:51:08 +00:00
Robert Watson
3f4b50a482 Regenerate. 2006-02-06 01:40:48 +00:00
Robert Watson
35d982a761 Assign audit event identifiers to Linux i386 system calls.
Obtained from:	TrustedBSD Project
2006-02-06 01:40:30 +00:00
Robert Watson
6b28a1b2a3 Regenerate. 2006-02-06 01:16:00 +00:00
Robert Watson
4790bb223e Reflect fix in Linux setfsgid() event name from OpenBSM in the alpha
linux system call table.

Obtained from:	TrustedBSD Project
2006-02-06 01:13:47 +00:00
Robert Watson
8c32c1901b Merge OpenBSM 1.0 alpha 3 include file changes from contrib/openbsm/bsm
to sys/bsm:

- Correct error in definition of audit event for Linux setfsgid().
- Add audit event identifier for sysarch().

Obtained from:	TrustedBSD Project
2006-02-06 01:12:46 +00:00
Wayne Salamon
2f8a46d5ff Audit the arguments (user/group IDs) for the system calls that set these IDs.
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-06 00:32:33 +00:00
Wayne Salamon
ad20c8f325 Audit the args to rfork(), and the child PID for all fork system calls.
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-06 00:28:50 +00:00
Wayne Salamon
de3007e8f3 Audit the pid being requested in wait4().
Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-06 00:19:09 +00:00
Wayne Salamon
a750d0b2a2 Add auditing of arguments to the close() and fstat() system calls. Much more
argument auditing yet to come, for remaining system calls in this file.

Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-05 23:57:32 +00:00
Robert Watson
570d840b52 Regenerate. 2006-02-05 23:28:46 +00:00
Robert Watson
b11c14d6e9 Assign audit event identfiers to Xenix system calls. Note: AUE_EACCESS
is assigned to xenix_eaccess() instead of AUE_ACCESS, as that is the
intended meaning of the system call.  xenix_eaccess() should be
reimplemented using our native eaccess() implementation so that it
works as intended.

Obtained from:	TrustedBSD Project
2006-02-05 23:28:01 +00:00
Robert Watson
ad3a6a7d36 Correct help line: list targets, not names of files generated by targets
when no argument is provided to make.

MFC after:	1 week
2006-02-05 23:25:19 +00:00
Robert Watson
4334cc4f81 Regenerate (accidentally also committed in commit that updated
syscalls.isc).
2006-02-05 23:16:20 +00:00
Robert Watson
60be92dd8d Assign audit event identifiers to ibcs2 ISC system calls.
Obtained from:	TrustedBSD Project
2006-02-05 23:15:22 +00:00
Olivier Houchard
697e7cb715 Backout rev 1.12. It would have been a good thing, if gcc was smart enough
not to generate bad code.
2006-02-05 22:06:12 +00:00
Robert Watson
00c28d9678 On process exit, audit the return value of the process, and commit the
record immediately, as this system call never returns.

Obtained from:	TrustedBSD Project
2006-02-05 21:08:25 +00:00
Robert Watson
6e8525ce84 When GC'ing a thread, assert that it has no active audit record.
This should not happen, but with this assert, brueffer and I would
not have spent 45 minutes trying to figure out why he wasn't
seeing audit records with the audit version in CVS.

Obtained from:	TrustedBSD Project
2006-02-05 21:06:09 +00:00
Alexander Leidinger
9d978cc757 Convert NULL checks into KASSERT (and move them before the first
dereferencing) since a NULL value would be a bug here.

Note: Both affected functions look very similar. A refactoring may
be beneficial.

CID:		483, 485
Found with:	Coverity Prevent(tm)
Discussed with:	ariff
MFC after:	5 days
2006-02-05 17:47:26 +00:00
Warner Losh
d87076c835 an driver not endian clean, so don't enable on sparc64 2006-02-05 17:38:28 +00:00
Alexander Leidinger
cd9de7ee61 A pointer was checked for NULL after dereferencing it. The check is not
needed here, except there's a bug which results in detaching the device
twice.

Move the NULL pointer check to the beginning of the function and convert
it into a KASSERT.

CID:		420
Found with:	Coverity Prevent(tm)
Discussed with:	ariff
MFC after:	5 days
2006-02-05 17:33:18 +00:00
Max Laier
5bba2114d0 Make pflog a seperate module. As a result pflog_packet() becomes a function
pointer that is declared in pf_ioctl.c

Requested by:	yar (as part of the module build reorg)
MFC after:	1 week
X-MFC with:	yar's module reorg
2006-02-05 17:17:32 +00:00
Alexander Leidinger
f31eef8b22 Fix memory leak in some failure cases.
CID:		420
Found with:	Coverity Prevent(tm)
2006-02-05 17:10:52 +00:00
Robert Watson
95fea57c65 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.

Submitted by:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-05 15:42:01 +00:00
Hajimu UMEMOTO
8c76311215 shut up strict-aliasing rules warning. 2006-02-05 09:52:40 +00:00
Ken Smith
4d286e9426 Move asr driver from global NOTES to i386-specific NOTES. Requestor
reports it is neither endian-clean or 64-bit clean.  :-)

Requested by:	scottl
2006-02-05 05:06:04 +00:00
Scott Long
5d9299772e Squash a couple more invalid long casts. 2006-02-05 05:05:27 +00:00
David Xu
25c926f1b0 Regenerate. 2006-02-05 02:23:41 +00:00
David Xu
9e7d72246f Implement thr_set_name to set a name for thread.
Reviewed by: julian
2006-02-05 02:18:46 +00:00
Warner Losh
1248f2322b Import support for the Atmel AT91RM9200 CPU/Microcontroller. This SoC
is a ARM920T based CPU with a bunch of built-in peripherals.  The
inital import supports the SPI bus, the TWI bus (although iicbus
integration is not complete), the uarts, the system timer and the
onboard ethernet.  Support for the Kwikbyte KB9202
(http://www.kwikbyte.com) board is also included, although there's no
reason why the 9200 and the 9201 wouldn't also work.  Primitive
support for running under the skyeye emulator is also provided
(although skyeye's support for the AT91RM9200 is a little weak).

The code has been structured so that other members of Atmel's arm family can
be supported in the future.  The AT91SAM9260 is not presently supported
due to lack of hardware.  The arm7tdmi families are also not supported
becasue they lack an MMU.

Many thanks to cognet@ for his help and assistance in bringing up this
board.  He did much of the vm work and wrote parts of the uart and
system timer code as well as the bus space implementation.

The system boots to single user w/o problem, although the serial
console is a little slow and the ethernet driver is still in flux.

This work was sponsored by Timing Solutions, Corporation.  I am
grateful to their support of the FreeBSD project in this manner.
2006-02-04 23:32:13 +00:00
Marius Strobl
ea227b498b - Add support for using LOM (Lights Out Management) and RSC (Remote System
Control) devices as console. These are microcontrollers which are either
  on-board or part of an add-on card and provide terminal server, remote
  power switch and monitoring functionality. For console usage these are
  connected to the rest of the system via a SCC or an UART. This commit adds
  support for the following variants (corresponds to what 'input-device' and
  'output-device' have to be set to):
  rsc		found on-board in E250 and supposedly some Netra, connected
		via a SAB82532, com. parameters can be determined via OFW
  rsc-console	RSC card found in E280R, Fire V4x0, Fire V8x0, connected
		via a NS16550, hardwired to 115200 8N1
  lom-console	LOMlite2 card found in Netra 20/T4, connected via a NS16550,
		hardwired to 9600 8N1

- Add my copyright to uart_cpu_sparc64.c as I've rewritten about one third
  of that file over time.

Tested on:	E250, E280R
Thanks to:	dwhite@ for providing access to an E280R
OK'ed by:	marcel
MFC after:	1 week
2006-02-04 23:27:16 +00:00
Warner Losh
ccc0f2f0af Silence the strict-alias warnings. Make a trip through (void *) when
casting a structure to a uint32_t *.  Many drivers in the tree do this, but
I'll not update them until these changes can be reviewed by the pedantic
standards folks.
2006-02-04 22:51:03 +00:00
Alan Cox
3b7db47d7e Remove an unnecessary call to pmap_remove_all(). The given page is not
mapped because its contents are invalid.
2006-02-04 22:37:10 +00:00
Warner Losh
53920ff8d9 Type of overrun_buf doesn't matter to this code, but does to gcc.
Make it a void *.
2006-02-04 22:33:08 +00:00
Warner Losh
2805b31bdf Use void * for pointer rather than u_int8_t *, since it doesn't
matter.  Well it does for type punning warnings.
2006-02-04 22:14:20 +00:00
Warner Losh
44dc92eb94 Now that TUNABLE_ULONG is in the tree, and has been for a while, use it.
This also avoids typepunning.
2006-02-04 21:56:14 +00:00
Warner Losh
ed3eb6ebe2 Don't type pun accidentally. Instead, be explicit that we're type
punning with an union so that the compiler knows.
2006-02-04 21:37:39 +00:00
Wayne Salamon
4f9ac41fba Call the audit syscall enter/exit functions for the amd64 architecture,
both 32-bit and 64-bit paths. System calls will now be audited.

Obtained from: TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-04 20:37:20 +00:00
Bill Paul
55ad415824 When ndis_attach() runs, it has to very briefly initialize the card
in order to query the underlying Windows driver for the station address
and some other properties. There is a slim chance that the card may
receive a packet and indicate it up to us before ndis_attach() can call
ndis_halt_nic(). This is bad, because both the softc structure and
the ifnet structure aren't fully initialized yet: many pointers are
still NULL, so if we make it into ndis_rxeof(), we will panic.

To fix this, we need to do the following:

- Move the calls to IoAllocateWorkItem() to before the call to ndis_init_nic().
- Move the initialization of the RX DPC and status callback function pointers
  to before ndis_init_nic() as well.
- Modify ndis_rxeof() to check if the IFF_DRV_RUNNING flag is set. If it
  isn't, we return any supplied NDIS_PACKETs to the NIC without processing
  them.

This fixes a crash than can occur when activating a wireless NIC in
close proximity to a very busy wireless network, reported by Ryan
Beasley (ryan%^$!ATgoddamnbastard-****!!!DOTorg.

MFC after:	3 days
2006-02-04 19:42:49 +00:00
Olivier Houchard
0cc56a19e1 Don't forget to set the address of the next descriptor to 0 when we're
zeroing a physical page, or we could end up re-zeroing portions of
memory we have zeroed before, which is clearly not wanted.
2006-02-04 18:01:15 +00:00
Scott Long
1107d45356 Squash another use of vtophys. Instead of creating separate busdma objects
for doing static memory transfers, start collecting them into a single
object.
2006-02-04 17:56:17 +00:00
Olivier Houchard
19d5d0da40 MFi386:
revision 1.288
date: 2006/02/04 14:11:33;  author: wsalamon;  state: Exp;  lines: +4 -1
Hook up the audit system to system call entry and exit. System calls will
now be audited.

Obtained from:  TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-04 17:01:19 +00:00
Scott Long
73450b30c8 Now that the em driver no longer needs to directly touch the scheduler, remove some
unneeded headers.
2006-02-04 16:50:14 +00:00
Wayne Salamon
c62ccf20b2 Hook up the audit system to system call entry and exit. System calls will
now be audited.

Obtained from:	TrustedBSD Project
Approved by: rwatson (mentor)
2006-02-04 14:11:33 +00:00
David Xu
7f96995ebd Create childproc_jobstate function to report job control state, this
also fixes a bug in childproc_continued which ignored PS_NOCLDSTOP.
2006-02-04 14:10:57 +00:00
Robert Watson
01bcdff15d Assign audit identifiers to alpha/linux system calls so that they will
be audited.

Obtained from:	TrustedBSD Project
2006-02-04 14:03:22 +00:00
Robert Watson
ef572cf5bb Regenerate. 2006-02-04 13:29:09 +00:00
Robert Watson
2b8d08f814 Audit FreeBSD 32-bit system calls on 64-bit FreeBSD systems.
Obtained from:	TrustedBSD Project
2006-02-04 13:28:55 +00:00
Robert Watson
1ba0723bd6 Merge OpenBSM 1.0 alpha 2 kernel audit events into src/sys/bsm. Almost
entirely new audit event identifiers for FreeBSD, Linux, and POSIX.1b
system calls.

Obtained from:	TrustedBSD Project
2006-02-04 13:22:44 +00:00
Rink Springer
aaadec7cac Patch to allow XBox-users to use the onboard nve(4) nForce ethernet driver.
The patch crudely forces the NIC out of operating mode before the nve(4)
driver can initialize it; this is required to properly initialize the NIC.

It is XBox-specific, as this condition can only occur on XBoxes (Most loaders
will simply leave the NIC running, forcing us to use a crude workaround like
this to get it in a workable condition). Due to the XBox-only aspect, this has
been solved in XBox-specific initialization code and not within nve(4).

Reviewed by:	imp
Approved by:	imp (mentor)
No objection:	bz@, obrien@, q@ontheweb.com.au
2006-02-04 10:01:33 +00:00
Scott Long
b0cb1aaf7c Add the start of busdma infrastructure to this driver. Convert the
ASR_resetIOPR function to use it.
2006-02-04 08:45:19 +00:00
Matt Jacob
51effc8cd5 Actually, no, I had it wrong in 1.109. The arguments to bus_dma_create_tag
are bus_addr_t, not bus_size_t.

In any case, turn off DAC support entirely until it is revamped to actually
work *correctly* for 64 bit platforms (not using a PAE definition and for
both initiator and target mode).
2006-02-04 08:39:02 +00:00
Scott Long
b32f2b9a08 Now that the U32 type is a really 32-bits wide, eliminate a bunch of other
bad assumptions and long values.
2006-02-04 08:20:23 +00:00
Warner Losh
d68da9fe4f Fix mismerge after last cvs update for the IFQ_DRV_DEQUEUE changes. 2006-02-04 08:19:00 +00:00
Warner Losh
e0c1d667ec Remove ifdef notyet SIOCGHWADDR vestige. 2006-02-04 08:16:41 +00:00
Warner Losh
70346a6275 Remove ifdef notdef SIOCHWADDR vestige. 2006-02-04 08:16:07 +00:00
Warner Losh
28383e51e2 Remove ifdef notyet for SIOCGHWADDR
Treat SIOCADDMULTI and SIOCDELMULTI the same, since they had the same code
Remove redundant assignment to error
Convert to using the altq interface completely.
2006-02-04 08:15:29 +00:00
Scott Long
90acf956d3 Give correct definitions to some basic types. 2006-02-04 08:01:49 +00:00
Hajimu UMEMOTO
d5e8a67ee9 Never select the PCB that has INP_IPV6 flag and is bound to :: if
we have another PCB which is bound to 0.0.0.0.  If a PCB has the
INP_IPV6 flag, then we set its cost higher than IPv4 only PCBs.

Submitted by:	Keiichi SHIMA <keiichi__at__iijlab.net>
Obtained from:	KAME
MFC after:	1 week
2006-02-04 07:59:17 +00:00
David Xu
a99f7ca21e Axe unused code. 2006-02-04 06:36:39 +00:00
Warner Losh
85aa25ca8e Fix minor inconsistancy between kernel built modules and stand-alone
built buildes.  I believe this gives the same flags on the command
line for both.
2006-02-04 06:22:27 +00:00
Scott Long
04ab3022a9 Fix a possible memory leak in asr_attach. 2006-02-04 06:08:19 +00:00
Scott Long
4b2dc3c447 i386/PAE defines bus_size_t to be 32-bits when it likely should be 64-bits.
Fixing it is left for another day, so just hack around it for now.
2006-02-04 03:41:48 +00:00
Robert Watson
a02a1efa9f Cast pointers to (uintptr_t) before down-casting to (int). This avoids
an incompatible conversion from a 64-bit pointer to a 32-bit integer on
64-bit platforms.  We will investigate whether Solaris uses a 64-bit
token here, or a new record here, in order to avoid truncating user
pointers that are 64-bit.  However, in the mean time, truncation is fine
as these are rarely/never used fields in audit records.

Obtained from:	TrustedBSD Project
2006-02-04 00:14:06 +00:00
Robert Watson
fac3e318aa Fix INVARIANTS build on amd64; (unsigned unsigned long) != u_int64_t.
Submitted by:	mlaier
2006-02-03 23:50:26 +00:00
Oleg Bulyzhin
3ecf1851df Properly initialize args structure before passing it to ipfw_chk(): having
uninitialized args.inp is unhealthy for uid/gid/jail ipfw rules.

PR:		kern/92589
Approved by:	glebius (mentor)
MFC after:	1 week
2006-02-03 23:03:07 +00:00
John Baldwin
37f84a6018 Add a comment. 2006-02-03 21:09:40 +00:00
Ruslan Ermilov
bbe9814a5b Fix compilation with -Wundef (NBPF is undefined on FreeBSD >4). 2006-02-03 20:55:30 +00:00
John Baldwin
b0864d13ab Sort includes. 2006-02-03 16:37:55 +00:00
Robert Watson
fdcba197a8 Add AUDIT to NOTES, as it's probably ready to get regular build testing
by the tinderboxes.
2006-02-03 15:53:37 +00:00
Robert Watson
563267dae3 Remove user.h include in audit.h, it is unneeded, and also can cause
build problems for other components that include audit.h.
2006-02-03 15:49:07 +00:00
Robert Watson
59428b0bad In fchdir(), Giant must be separately acquired and dropped if the old
vnode is from a file system that is not MPSAFE, as vrele() expects
Giant to be held when it is called on a non-MPSAFE vnode.

Spotted by:	kris
Tested by:	glebius
2006-02-03 15:42:16 +00:00
Will Andrews
937a238777 Make UDF endian-safe.
Submitted by:	Pedro Martelletto <pedro@ambientworks.net> (via scottl)
Tested on:	sparc64
2006-02-03 15:25:52 +00:00
Marius Strobl
8d727356c6 - Don't shift the clock frequency in MHz left by 8 before assigning it
to sbus_mdvec.dv_clock as sbus_mdvec.dv_clock is meant to be specified
  in MHz. While this was a bug it shouldn't have affected FreeBSD/sparc64
  as sbus_mdvec.dv_clock is used to limit the clock rate of chips when
  a machine isn't able to support them at maximum speed which isn't the
  case for sun4u machines.
- Remove the code that checks whether the clock frequency returned by
  sbus_get_clockfreq() is 0 and falls back to 25MHz if it is as that's
  already done in sbus(4).

Approved by:	mjacob
MFC after:	3 days
2006-02-03 12:35:42 +00:00
Robert Watson
d7bd3313e2 Regenerate. 2006-02-03 11:51:19 +00:00
Robert Watson
62646c07f6 Assign audit event identifiers to many system calls.
Much work by:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-03 11:48:37 +00:00
Gleb Smirnoff
a7908db153 Dropping the lock in the transmit_event() is not safe, because we
store some pipe pointers on stack. If user reconfigures dummynet
in the interlock gap, we can work with freed pipes after relock.

To fix this, we decided not to send packets in transmit_event(),
but fill a queue. At the end of dummynet() and dummynet_io(),
after the lock is dropped, if there is something in the queue
we run dummynet_send() to process the queue.

In collaboration with:	ru
2006-02-03 11:38:19 +00:00
Gleb Smirnoff
ce62866023 Axe unused function. 2006-02-03 10:42:28 +00:00
Warner Losh
d0e50224e8 MFp4: Small cleanup of cpu messages at boot. 2006-02-03 06:39:57 +00:00
Warner Losh
f037afb7ea Merge from p4: minor formatting nits. 2006-02-03 06:27:51 +00:00
David Xu
6d7c1bdccd MFi386:
Clear carry flag in get_mconetxt so that setcontext does not
	return a bogus error.
2006-02-03 02:49:14 +00:00
David Xu
97794f4eb3 Clear carry flag in get_mcontext so that setcontext does not
return a bogus error.

PR: misc/92110
2006-02-03 02:33:01 +00:00
Matt Jacob
df7418f32f !$(*&!($!&$(!&$&(!$(&!&($!($
Forget to commit this.
2006-02-03 00:36:19 +00:00
Peter Wemm
e2a5e4efdb Make PV entries dynamic on amd64. i386 has a pre-reserved block of kva
dedicated to storing pv entries, originally so that kva didn't have to be
allocated at inconvenient times.  For amd64, we can get the same effect by
using the direct map area.  Allocating pages is the same as with the object
backed method, but now we can just lookup the page in the direct map area.
Thus, no more pageable kva is reserved.  This is the single largest
consumer of kva on our work machines and this change should help conserve
the fixed size 2GB pageable kva on the amd64 kernel.

There are a pair of sysctl nodes introduced, named the same as their
tunable counterparts.  vm.pmap.shpgperproc and vm.pmap.pv_entry_max
They work just like the tunables of the same path, except the values are
linked.  The pv entry cap is now dynamically changeable.

I didn't make them totally unlimited because we need some sort of safety
limit still.  One could consume all physical memory without a cap.
2006-02-03 00:16:36 +00:00
Warner Losh
6117d67f88 If the device has a PNPID, don't bother to attach. There were some
instances where the probe that was here would falsely grab a device.
2006-02-02 23:57:31 +00:00
Marcel Moolenaar
8c4f6925c4 Remove devices acpi & mem, as they are in defaults already. 2006-02-02 23:41:08 +00:00
Gleb Smirnoff
05a2398f32 In vlan_config() first call vlan_inithash(), then lock mutex, because
vlan_inithash() calls malloc(M_WAITOK).
2006-02-02 22:11:38 +00:00
Tor Egge
44ed341759 Adjust old comment (present in rev 1.1) to match changes in rev 1.82.
PR:	kern/92509
Submitted by:   "Bryan Venteicher" <bryanv@daemoninthecloset.org>
2006-02-02 21:55:38 +00:00
Tor Egge
c78226329a For low memory situations, non-VMIO buffers didnt't release pages back to
the system when brelse() was called with B_RELBUF set on the buffer.  This
could be a problem when the system was low on memory, had many buffers on
QUEUE_EMPTYKVA and started to traverse directories.  For each getnewbuf(),
pages were allocated from the system, driving the free reserve downwards.
For each brelse(), the system put the buffer on QUEUE_CLEAN, with B_INVAL
set.

This commit changes the semantics of B_RELBUF to also free pages from
non-VMIO buffers.

Reviewed by:	alc
2006-02-02 21:37:39 +00:00
Matt Jacob
53af7d226e Remove use of inlines and use the functions as a library.
Larger code space, possibly performance hit, but more portable.
Certainly less questionable use of inlining.

Suggested by: des
2006-02-02 21:31:34 +00:00
Olivier Houchard
56db7f4cc6 Don't destroy the slave /dev entry until someone figures out why devfs seems
to behave badly when we do so.
2006-02-02 20:35:45 +00:00
Christian S.J. Peron
fa918e1ef7 define lock.h before rwlock.h for DEBUG_LOCKS 2006-02-02 20:33:10 +00:00
John Baldwin
f6b457923d Whitespace fix.
Submitted by:	Wojciech A. Koszek <dunstan at zsno ids czest pl>
2006-02-02 20:14:52 +00:00
Paul Saab
19cf04981a Implement SIOCGIFCONF for 32bit binaries. 2006-02-02 19:58:37 +00:00
Paul Saab
0e74562fbc Enable 64bit SGL's on PERC 4/DC 2006-02-02 17:51:47 +00:00
Paul Saab
447c943f68 - Move the command setup from amr_start1 into the card specific submit
routines.
- Add or replace cpu_spinwait() with DELAY(1) to a few of the busy
  loops when reading from the controller to work around firmware bugs
  which can crash the controller.
2006-02-02 17:50:59 +00:00
Christian S.J. Peron
f5cdbcf14c Use PFIL_HOOKED macros in if_bridge and pass the right argument to
rw_assert. This un-breaks the build.

Submitted by:	Kostik Belousov
Pointy hat to:	csjp
2006-02-02 16:41:20 +00:00
David Xu
165ba65d7b Under verbose mode, correctly report L2 cache information
for CPU which supports CPUID function 8000_0006h.

Tested on: Pentum-M 750
2006-02-02 12:44:09 +00:00
David Xu
ec4275eefa Fix bug in L2 cache size detection code for CPU which supports CPUID
function 8000_0006h.

Tested on: Pentum-M 750
2006-02-02 11:54:40 +00:00
Hajimu UMEMOTO
92cb1c3210 make IPV6_V6ONLY socket option work for UDP as well.
PR:		ports/92620
Reported by:	Kurt Miller <kurt__at__intricatesoftware.com>
MFC after:	1 week
2006-02-02 11:46:05 +00:00
Yoshihiro Takahashi
df55e78b6f MFi386: Enable the ce(4). 2006-02-02 11:14:13 +00:00
Oleg Bulyzhin
ee7ef91c36 Enable 'complete' rx checksum offloading (i.e. let chip calculate checksums
with pseudo header for tcp/udp packets). This could save one in_pseudo() call
per incoming tcp/udp packet.

Approved by:	glebius (mentor)
MFC after:	3 weeks
2006-02-02 09:58:31 +00:00
Matt Jacob
b7918ba53a Make sure we don't pick up a loopid that's larger than our
current portdb max (MAX_FC_TARG == 256) now that we support
2K Login f/w.

MFC after:	3 days
2006-02-02 09:02:16 +00:00
Jeff Roberson
68ce4375c4 - textvp may have been from a different mountpoint than ndp->ni_vp and
we may need to acquire giant to vrele it.

Found by:	mjacob
MFC After:	3 days
2006-02-02 08:39:39 +00:00
David Xu
7aa9d01bf4 Correctly report L2 cache size according to its code comment.
Tested on my Dual PIII machine.
2006-02-02 06:35:50 +00:00
Christian S.J. Peron
604afec496 Somewhat re-factor the read/write locking mechanism associated with the packet
filtering mechanisms to use the new rwlock(9) locking API:

- Drop the variables stored in the phil_head structure which were specific to
  conditions and the home rolled read/write locking mechanism.
- Drop some includes which were used for condition variables
- Drop the inline functions, and convert them to macros. Also, move these
  macros into pfil.h
- Move pfil list locking macros intp phil.h as well
- Rename ph_busy_count to ph_nhooks. This variable will represent the number
  of IN/OUT hooks registered with the pfil head structure
- Define PFIL_HOOKED macro which evaluates to true if there are any
  hooks to be ran by pfil_run_hooks
- In the IP/IP6 stacks, change the ph_busy_count comparison to use the new
  PFIL_HOOKED macro.
- Drop optimization in pfil_run_hooks which checks to see if there are any
  hooks to be ran, and returns if not. This check is already performed by the
  IP stacks when they call:

        if (!PFIL_HOOKED(ph))
                goto skip_hooks;

- Drop in assertion which makes sure that the number of hooks never drops
  below 0 for good measure. This in theory should never happen, and if it
  does than there are problems somewhere
- Drop special logic around PFIL_WAITOK because rw_wlock(9) does not sleep
- Drop variables which support home rolled read/write locking mechanism from
  the IPFW firewall chain structure.
- Swap out the read/write firewall chain lock internal to use the rwlock(9)
  API instead of our home rolled version
- Convert the inlined functions to macros

Reviewed by:	mlaier, andre, glebius
Thanks to:	jhb for the new locking API
2006-02-02 03:13:16 +00:00
Robert Watson
06f2859f6d Regenerate. 2006-02-02 01:45:01 +00:00
Robert Watson
35d29f5091 Map audit-related system calls to audit event identifiers.
Much work by:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-02 01:44:30 +00:00
Robert Watson
fcf7f27a36 Hook up audit to fork() and exit() events. These changes manage the
audit state on processes, not auditing of these events.

Much work by:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-02 01:32:58 +00:00
Robert Watson
3683665bbd Hook up audit to the initial process creation events (proc0, proc1).
Much help from:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-02 01:16:31 +00:00
Robert Watson
911b84b08d 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.

Much help from:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-02 00:37:05 +00:00
Robert Watson
07881ef960 Add 'options AUDIT' and associate various .c files with the AUDIT
option.  We always build audit_syscalls.c so that the system call
stubs can return ENOSYS rather than the system call code
generating SIGSYS for the system calls.  We are not yet ready to
add AUDIT to LINT, as the prototypes for system call arguments
won't be there until after the system calls for audit are added.

Much work from:	wsalamon
Obtained from:	TrustedBSD Project
2006-02-01 21:00:16 +00:00
Robert Watson
718c851086 Import kernel audit framework:
- Management of audit state on processes.
- Audit system calls to configure process and system audit state.
- Reliable audit record queue implementation, audit_worker kernel
  thread to asynchronously store records on disk.
- Audit event argument.
- Internal audit data structure -> BSM audit trail conversion library.
- Audit event pre-selection.
- Audit pseudo-device permitting kernel->user upcalls to notify auditd
  of kernel audit events.

Much work by:	wsalamon
Obtained from:	TrustedBSD Project, Apple Computer, Inc.
2006-02-01 20:01:18 +00:00