Commit Graph

126817 Commits

Author SHA1 Message Date
David E. O'Brien
e2e1ab1c94 When building WITHOUT_ASSERT_DEBUG, we need to disable -Werror as its easy
to see "warning: unused variable `foo'".
2006-09-13 23:27:21 +00:00
John Baldwin
2511ffba93 Correct include path. 2006-09-13 21:11:13 +00:00
Joel Dahl
f832d58dc8 Remove reference to T/TCP.
Reviewed by:	andre
2006-09-13 19:48:00 +00:00
John Baldwin
fcf43477b8 intpm(4) meet style(9). style(9) meet intpm(4). 2006-09-13 18:56:39 +00:00
Mohan Srinivasan
7d7d9e2242 Fixes up the handling of shared vnode lock lookups in the NFS client,
adds a FS type specific flag indicating that the FS supports shared
vnode lock lookups, adds some logic in vfs_lookup.c to test this flag
and set lock flags appropriately.

- amd on 6.x is a non-starter (without this change). Using amd under
  heavy load results in a deadlock (with cascading vnode locks all the
  way to the root) very quickly.
- This change should also fix the more general problem of cascading
  vnode deadlocks when an NFS server goes down.

Ideally, we wouldn't need these changes, as enabling shared vnode lock
lookups globally would work. Unfortunately, UFS, for example isn't
ready for shared vnode lock lookups, crashing pretty quickly.

This change is the result of discussions with Stephan Uphoff (ups@).

Reviewed by:	ups@
2006-09-13 18:39:09 +00:00
Joel Dahl
cec65ede6c Bump .Dd.
Noticed by:	danger
2006-09-13 18:34:32 +00:00
Joel Dahl
3e1f331553 Remove references to the pam(8) manual page. It does not exist.
Requested by:	novel
Discussed with:	brueffer, simon
2006-09-13 17:46:20 +00:00
Scott Long
988129b824 Introduce a spinlock for synchronizing access to the video output hardware
in syscons.  This replaces a simple access semaphore that was assumed to be
protected by Giant but often was not.  If two threads that were otherwise
SMP-safe called printf at the same time, there was a high likelyhood that
the semaphore would get corrupted and result in a permanently frozen video
console.  This is similar to what is already done in the serial console
drivers.
2006-09-13 15:48:15 +00:00
Christian S.J. Peron
7ca6b7823d 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
Gleb Smirnoff
85bfbb5f09 Fix markup bug in last commit.
Submitted by:	ru
2006-09-13 15:47:26 +00:00
Pawel Jakub Dawidek
8e007c52fd 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
Gleb Smirnoff
708e9ef188 Document net.inet.tcp.maxtcptw and net.inet.tcp.nolocaltimewait.
Wording by:	Devon O'Dell
2006-09-13 15:24:27 +00:00
Andre Oppermann
67d828b162 Remove unessary includes and follow common ordering style. 2006-09-13 13:21:17 +00:00
Andre Oppermann
bf6d304ab2 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
Ruslan Ermilov
bb077f2d54 - 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
Scott Long
adab0fdc4f Remove duplicated code. Declare functions non-static that shouldn't be
inlined.
2006-09-13 09:35:59 +00:00
Robert Watson
9fa5f6b4b9 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
Pawel Jakub Dawidek
689f94bfe6 Fix a lock leak in an error case.
Reported by:	netchild
Reviewed by:	rwatson
2006-09-13 06:58:40 +00:00
Philippe Charnier
488633c7f4 initialize variable (WARNS=6) 2006-09-13 05:06:12 +00:00
Philippe Charnier
e55942e33c compile under WARNS=6 2006-09-13 05:01:25 +00:00
Philippe Charnier
d402d62c89 Reduce the number of errors under WARNS=6 2006-09-13 04:50:44 +00:00
John-Mark Gurney
c14c65ed52 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
Søren Schmidt
8a0b22718a Busmaster DMA address fix in VIA 6421 case. 2006-09-12 22:06:39 +00:00
Alexander Kabaev
f7a0a44b44 Remove redundant defines alerady set by Makefile.fe 2006-09-12 21:57:28 +00:00
Søren Schmidt
d5bddfcbfc Format mask lacks one bit.
Reported by:	jkim
2006-09-12 20:37:22 +00:00
David E. O'Brien
e9231ad68b Style sync. 2006-09-12 19:24:01 +00:00
Warner Losh
b4583894aa Put the osta.c license on osta.h. The license is the same.
Approved by: scottl@
2006-09-12 19:02:34 +00:00
Philippe Charnier
9833aeada2 Add FBSDID, rename local variable time to not conflict with time() 2006-09-12 17:54:35 +00:00
Warner Losh
32494417a8 Bump date, per ru@ 2006-09-12 15:48:22 +00:00
John Baldwin
9d042fe7aa Trim some unneeded includes. 2006-09-12 15:01:19 +00:00
Alexander Botero-Lowry
4f9019bb29 Add my birthday to the calendar, sadly I am only the fifth youngest.
Approved by:	novel
2006-09-12 09:05:00 +00:00
David E. O'Brien
eaa35077b4 Move to more global Makefile.tgt vs. having to define in the leaves. 2006-09-12 07:37:44 +00:00
David E. O'Brien
8d60fe4054 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
David E. O'Brien
124866d539 Default to big endian ARM if "TARGET_BIG_ENDIAN" is defined (& targeting ARM). 2006-09-12 07:09:45 +00:00
David E. O'Brien
6b31c6b17f Craft the FreeBSD/ARM ABI by hacking the New ARM ABI source.
Submitted by:	cognet
2006-09-12 07:03:58 +00:00
David E. O'Brien
da07c79f6a Default vector to big endian ARM if "TARGET_BIG_ENDIAN" is defined. 2006-09-12 07:02:15 +00:00
David E. O'Brien
25024d95e9 Build 'ld' supporting a big endian ARM if "TARGET_BIG_ENDIAN" is defined. 2006-09-12 06:59:39 +00:00
David E. O'Brien
fc2717a0d2 Configure for for big endian if TARGET_BYTES_BIG_ENDIAN is defined. 2006-09-12 06:39:27 +00:00
Philippe Charnier
b2eeeae049 WARNS=6 chocked on unitialized variable. 2006-09-12 05:08:36 +00:00
Christian S.J. Peron
d94f2a68f8 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
John Baldwin
3bb00f61a2 - 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
Warner Losh
788de9d472 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
Prafulla Deuskar
a21ff306d8 Fix issues found by Coverity (223392, 223393) due to TSO additions
Submitted by:	Matthew Jacob
2006-09-11 20:59:01 +00:00
John Baldwin
7048a99c30 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
John Baldwin
884ff1813f 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
John Baldwin
5c15c7e71d 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 Oppermann
384a05bfd0 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
Søren Schmidt
594e3d5d6f Add support for a few more Serverworks and lookalikes chips. 2006-09-11 19:48:30 +00:00
Søren Schmidt
92dc84876a Update to fit latest USB cleanup crusade. 2006-09-11 19:47:53 +00:00
John Baldwin
bd4b6eb964 Add prototype for bus_generic_add_child() missed in previous commit. 2006-09-11 19:42:27 +00:00