Commit Graph

126922 Commits

Author SHA1 Message Date
csjp
3927aa4474 Back out one of the Giant removals from revision 1.272. Giant was not here to
protect the vnode, it was present to synchronize access to TTY session
information between exit(2) and the TTY code. While we are here, note that
Giant is required for TTY protection.

Clue from:	bde
Discussed with:	jhb
MFC after:	1 week
2006-09-13 15:47:53 +00:00
glebius
ef665c74ec Fix markup bug in last commit.
Submitted by:	ru
2006-09-13 15:47:26 +00:00
pjd
610c4b7a06 Fix synchronization in gmirror and graid3 which I broken. Synchronization
request can still have bio_to set to sc_provider (this is READ part of a
synchronization request) and in this case g_{mirror,raid3}_sync() wasn't
called as it should be.

MFC after:	1 week
2006-09-13 15:46:49 +00:00
glebius
2264a48ff4 Document net.inet.tcp.maxtcptw and net.inet.tcp.nolocaltimewait.
Wording by:	Devon O'Dell
2006-09-13 15:24:27 +00:00
andre
fc2dc7ce4e Remove unessary includes and follow common ordering style. 2006-09-13 13:21:17 +00:00
andre
b859d7a1c9 Rewrite of TCP syncookies to remove locking requirements and to enhance
functionality:

 - Remove a rwlock aquisition/release per generated syncookie.  Locking
   is now integrated with the bucket row locking of syncache itself and
   syncookies no longer add any additional lock overhead.
 - Syncookie secrets are different for and stored per syncache buck row.
   Secrets expire after 16 seconds and are reseeded on-demand.
 - The computational overhead for syncookie generation and verification
   is one MD5 hash computation as before.
 - Syncache can be turned off and run with syncookies only by setting the
   sysctl net.inet.tcp.syncookies_only=1.

This implementation extends the orginal idea and first implementation
of FreeBSD by using not only the initial sequence number field to store
information but also the timestamp field if present.  This way we can
keep track of the entire state we need to know to recreate the session in
its original form.  Almost all TCP speakers implement RFC1323 timestamps
these days.  For those that do not we still have to live with the known
shortcomings of the ISN only SYN cookies.  The use of the timestamp field
causes the timestamps to be randomized if syncookies are enabled.

The idea of SYN cookies is to encode and include all necessary information
about the connection setup state within the SYN-ACK we send back and thus
to get along without keeping any local state until the ACK to the SYN-ACK
arrives (if ever).  Everything we need to know should be available from
the information we encoded in the SYN-ACK.

A detailed description of the inner working of the syncookies mechanism
is included in the comments in tcp_syncache.c.

Reviewed by:	silby (slightly earlier version)
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-13 13:08:27 +00:00
ru
33d6440a5a - Change the example CFLAGS entry to match our default in sys.mk.
- Document that -fno-strict-aliasing is required for -O2.

Prodded by:	users of stable@
2006-09-13 10:20:56 +00:00
scottl
bee41c3ee3 Remove duplicated code. Declare functions non-static that shouldn't be
inlined.
2006-09-13 09:35:59 +00:00
rwatson
bd76450bdb dd a series of regression tests to validate that privilege requirements are
implemented properly for a number of kernel subsystems.  In general, they
try to exercise the privilege first as the root user, then as a test user,
in order to determine when privilege is being checked.

Currently, these tests do not compare inside/outside jail, and probably
should be enhanced to do that.

Sponsored by:	nCircle Network Security, Inc.
Obtained from:	TrustedBSD Project
2006-09-13 09:05:39 +00:00
pjd
166e57c29a Fix a lock leak in an error case.
Reported by:	netchild
Reviewed by:	rwatson
2006-09-13 06:58:40 +00:00
charnier
2318032d41 initialize variable (WARNS=6) 2006-09-13 05:06:12 +00:00
charnier
5b67866b9a compile under WARNS=6 2006-09-13 05:01:25 +00:00
charnier
200c31fad8 Reduce the number of errors under WARNS=6 2006-09-13 04:50:44 +00:00
jmg
8b66317cb4 document that PAE kernels needs twice the value of non-PAE kernels
for KVA_PAGES, and that it it likely needed for >4GB memory boxes..

MFC after:	3 days
2006-09-13 01:23:08 +00:00
sos
6e6b04c407 Busmaster DMA address fix in VIA 6421 case. 2006-09-12 22:06:39 +00:00
kan
fe0a1dc586 Remove redundant defines alerady set by Makefile.fe 2006-09-12 21:57:28 +00:00
sos
d58c4f01d8 Format mask lacks one bit.
Reported by:	jkim
2006-09-12 20:37:22 +00:00
obrien
c0b8338231 Style sync. 2006-09-12 19:24:01 +00:00
imp
478d307596 Put the osta.c license on osta.h. The license is the same.
Approved by: scottl@
2006-09-12 19:02:34 +00:00
charnier
990b2be3b7 Add FBSDID, rename local variable time to not conflict with time() 2006-09-12 17:54:35 +00:00
imp
00a7738e90 Bump date, per ru@ 2006-09-12 15:48:22 +00:00
jhb
0c8b412181 Trim some unneeded includes. 2006-09-12 15:01:19 +00:00
alexbl
9fa3888195 Add my birthday to the calendar, sadly I am only the fifth youngest.
Approved by:	novel
2006-09-12 09:05:00 +00:00
obrien
a78f3f2302 Move to more global Makefile.tgt vs. having to define in the leaves. 2006-09-12 07:37:44 +00:00
obrien
26e5f5c59e Default to big endian ARM if "TARGET_BIG_ENDIAN" is defined, and set an ARM
target default.
2006-09-12 07:37:02 +00:00
obrien
a43aa801ce Default to big endian ARM if "TARGET_BIG_ENDIAN" is defined (& targeting ARM). 2006-09-12 07:09:45 +00:00
obrien
1a1b7c160c Craft the FreeBSD/ARM ABI by hacking the New ARM ABI source.
Submitted by:	cognet
2006-09-12 07:03:58 +00:00
obrien
611804cd1c Default vector to big endian ARM if "TARGET_BIG_ENDIAN" is defined. 2006-09-12 07:02:15 +00:00
obrien
5945365a2c Build 'ld' supporting a big endian ARM if "TARGET_BIG_ENDIAN" is defined. 2006-09-12 06:59:39 +00:00
obrien
e5aca57eb8 Configure for for big endian if TARGET_BYTES_BIG_ENDIAN is defined. 2006-09-12 06:39:27 +00:00
charnier
d189165b4f WARNS=6 chocked on unitialized variable. 2006-09-12 05:08:36 +00:00
csjp
63e89c05d2 Introduce a new entry point, mac_create_mbuf_from_firewall. This entry point
exists to allow the mandatory access control policy to properly initialize
mbufs generated by the firewall. An example where this might happen is keep
alive packets, or ICMP error packets in response to other packets.

This takes care of kernel panics associated with un-initialize mbuf labels
when the firewall generates packets.

[1] I modified this patch from it's original version, the initial patch
    introduced a number of entry points which were programmatically
    equivalent. So I introduced only one. Instead, we should leverage
    mac_create_mbuf_netlayer() which is used for similar situations,
    an example being icmp_error()

    This will minimize the impact associated with the MFC

Submitted by:	mlaier [1]
MFC after:	1 week

This is a RELENG_6 candidate
2006-09-12 04:25:13 +00:00
jhb
c74e70f7a8 - Revert making bus_generic_add_child() the default for BUS_ADD_CHILD().
Instead, we want busses to explicitly specify an add_child routine if they
  want to support identify routines, but by default disallow having outside
  drivers add devices.
- Give smbus(4) an explicit bus_add_child() method.

Requested by:	imp
2006-09-11 22:20:37 +00:00
imp
e2689a926c Add note about identify routines needing to use BUS_ADD_CHILD rather
than device_add_child.  The latter is only for busses adding children,
not children drivers telling a bus that they have an instance...
2006-09-11 22:17:18 +00:00
pdeuskar
4c318f22c8 Fix issues found by Coverity (223392, 223393) due to TSO additions
Submitted by:	Matthew Jacob
2006-09-11 20:59:01 +00:00
jhb
375fa0aa41 Minor overhaul of SMBus support:
- Change smbus_callback() to pass a void * rather than caddr_t.
- Change smbus_bread() to pass a pointer to the count and have it be an
  in/out parameter.  The input is the size of the buffer (same as before),
  but on return it will contain the actual amount of data read back from
  the bus.  Note that this value may be larger than the input value.  It
  is up to the caller to treat this as an error if desired.
- Change the SMB_BREAD ioctl to write out the updated struct smbcmd which
  will contain the actual number of bytes read in the 'count' field.  To
  preserve the previous ABI, the old ioctl value is mapped to SMB_OLD_BREAD
  which doesn't copy the updated smbcmd back out to userland.  I doubt anyone
  actually used the old BREAD anyway as it was rediculous to do a bulk-read
  but not tell the using program how much data was actually read.
- Make the smbus driver and devclass public in the smbus module and
  push all the DRIVER_MODULE()'s for attaching the smbus driver to
  various foosmb drivers out into the foosmb modules.  This makes all
  the foosmb logic centralized and allows new foosmb modules to be
  self-contained w/o having to hack smbus.c everytime a new smbus driver
  is added.
- Add a new SMB_EINVAL error bit and use it in place of EINVAL to return
  an error for bad arguments (such as invalid counts for bread and bwrite).
- Map SMB bus error bits to EIO in smbus_error().
- Make the smbus driver call bus_generic_probe() and require child drivers
  such as smb(4) to create device_t's via identify routines.  Previously,
  smbus just created one anonymous device during attach, and if you had
  multiple drivers that could attach it was just random chance as to which
  driver got to probe for the sole device_t first.
- Add a mutex to the smbus(4) softc and use it in place of dummy splhigh()
  to protect the 'owner' field and perform necessary synchronization for
  smbus_request_bus() and smbus_release_bus().
- Change the bread() and bwrite() methods of alpm(4), amdpm(4), and
  viapm(4) to only perform a single transaction and not try to use a
  loop of multiple transactions for a large request.  The framing and
  commands to use for a large transaction depend on the upper-layer
  protocol (such as SSIF for IPMI over SMBus) from what I can tell, and the
  smb(4) driver never allowed bulk read/writes of more than 32-bytes
  anyway.  The other smb drivers only performed single transactions.
- Fix buffer overflows in the bread() methods of ichsmb(4), alpm(4),
  amdpm(4), amdsmb(4), intpm(4), and nfsmb(4).
- Use SMB_xxx errors in viapm(4).
- Destroy ichsmb(4)'s mutex after bus_generic_detach() to avoid problems
  from child devices making smb upcalls that would use the mutex during
  their detach methods.

MFC after:	1 week
Reviewed by:	jmg (mostly)
2006-09-11 20:52:41 +00:00
jhb
35312a59c3 Add a new ddb command 'show lapic' to dump details about the local APIC
registers for the current CPU.

MFC after:	3 days
2006-09-11 20:12:42 +00:00
jhb
5845d0195b Actually hook up the IPI_INVLCACHE IDT vectors backing
pmap_invalidate_cache() in the SMP case so pmap_mapdev() in multiuser
doesn't panic with a trap 30.  I broke this many months ago when I
added pmap_invalidate_cache() as early parts of the PAT work.

Patience from:	jmg
Pointy hat:	jhb
2006-09-11 20:10:42 +00:00
andre
c4015db86a Fix a NULL pointer dereference of ro->ro_rt->rt_flags by checking for the
validity of ro->ro_rt first.  This prevents crashing on any non-normally
routed IP packet.

Coverity CID:	162 (incorrectly, it was re-introduced by previous commit)
2006-09-11 19:56:10 +00:00
sos
320be4d762 Add support for a few more Serverworks and lookalikes chips. 2006-09-11 19:48:30 +00:00
sos
902d47f294 Update to fit latest USB cleanup crusade. 2006-09-11 19:47:53 +00:00
jhb
1a5dc2dc26 Add prototype for bus_generic_add_child() missed in previous commit. 2006-09-11 19:42:27 +00:00
jhb
7be67f8a93 Add a default method for BUS_ADD_CHILD() that just calls
device_add_child_ordered().  Previously, a device driver that wanted to
add a new child device in its identify routine had to know if the parent
driver had a custom bus_add_child method and use BUS_ADD_CHILD() in that
case, otherwise use device_add_child().  Getting it wrong in either
direction would result in panics or failure to add the child device.  Now,
BUS_ADD_CHILD() always works isolating child drivers from having to know
intimate details about the parent driver.

Discussed with:	imp
MFC after:	1 week
2006-09-11 19:41:31 +00:00
simon
0b24ec1e7c Add myself as OpenSSL janitor/maintainer. 2006-09-11 19:39:46 +00:00
jhb
da508a0aae Give the ACPI I/O rman's unique description strings to make 'devinfo -u'
output less confusing.

MFC after:	3 days
2006-09-11 19:32:54 +00:00
jhb
896ceebabd - Fix rman_manage_region() to be a lot more intelligent. It now checks
for overlaps, but more importantly, it collapses adjacent free regions.
  This is needed to cope with BIOSen that split up ports for system devices
  (like IPMI controllers) across multiple system resource entries.
- Now that rman_manage_region() is not so dumb, remove extra logic in the
  x86 nexus drivers to populate the IRQ rman that manually coalesced the
  regions.

MFC after:	1 week
2006-09-11 19:31:52 +00:00
sos
8047e03934 CF devices are ATA not ATAPI. 2006-09-11 18:33:59 +00:00
obrien
b41312be09 Define build 'as' TARGET_BYTES_BIG_ENDIAN if "TARGET_BIG_ENDIAN" is defined.
This is needed for bi-sex architectures.
2006-09-11 18:07:09 +00:00
mjacob
8e603b5137 null commit to provide commit message to previous
at the request of Sam Leffler: The previous commit
established min and maxtags for VMware pseudo disks
to fix a submitted PR.
2006-09-11 17:57:23 +00:00
mjacob
9cfbe0a344 PR: 103130
Submitted by:	Shusuke Shinomiya
MFC after:	1 day
2006-09-11 17:34:28 +00:00