Commit graph

136816 commits

Author SHA1 Message Date
Ruslan Ermilov 007b1b7bae Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
Christian Brueffer 935c968abe Correct the kernel config hint in a printf statement.
Submitted by:	R.Mahmatkhanov <cvs-src@yandex.ru>
Reviewed by:	scottl
Approved by:	rwatson (mentor)
MFC after:	3 days
2008-01-28 18:13:03 +00:00
Christian Brueffer 5760e921e8 Remove references to the obsolete card(4) manpage. 2008-01-28 18:08:41 +00:00
Christian S.J. Peron c52a508838 Make sure that the termid type is initialized to AU_IPv4 by default.
This makes sure that process tokens credentials with un-initialized
audit contexts are handled correctly.  Currently, when invariants are
enabled, this change fixes a panic by ensuring that we have a valid
termid family.  Also, this fixes token generation for process tokens
making sure that userspace is always getting a valid token.

This is consistent with what Solaris does when an audit context is
un-initialized.

Obtained from:	TrustedBSD Project
MFC after:	1 week
2008-01-28 17:33:46 +00:00
Mitsuru IWASAKI 0aeee4bd8a Don't repeat error logging about NOP message sending if
ciss_report_request() return an error (which is most likely data
underrun).

Noticed by:	Mark Atkinson
MFC after:	1 week
2008-01-28 16:21:34 +00:00
Andrew Gallatin 10882804c9 Only reset driver state when a hardware error is detected.
Preserve warning but do not reset if we enter the routine
without seeing a hardware error.
2008-01-28 13:20:51 +00:00
Randall Stewart 3ca1bceea5 - Fix a comment about prison.
- Fix it so the VRF is captured while locks are held.
MFC after:	1 week
2008-01-28 10:34:38 +00:00
Randall Stewart bf949ea2d4 - Change back to using prioity 0. Which means don't change the
prioity when running the thread. (this is for the sctp_interator thread).

MFC after:	1 week
2008-01-28 10:33:41 +00:00
Randall Stewart 257438fb6c - Fix a bug where the socket may have been closed which
could cause a crash in the auth code.
Obtained from:	Michael Tuexen
MFC after:	1 week
2008-01-28 10:31:12 +00:00
Randall Stewart f36d98069e - Fixes a comparison wrap issue with sack gap ack blocks that
span the 32 bit roll over mark.
2008-01-28 10:25:43 +00:00
Robert Watson 5ac3b03500 Properly return the error from mls_subject_privileged() in the ifnet
relabel check for MLS rather than returning 0 directly.

This problem didn't result in a vulnerability currently as the central
implementation of ifnet relabeling also checks for UNIX privilege, and
we currently don't guarantee containment for the root user in mac_mls,
but we should be using the MLS definition of privilege as well as the
UNIX definition in anticipation of supporting root containment at some
point.

MFC after:	3 days
Submitted by:	Zhouyi Zhou <zhouzhouyi at gmail dot com>
Sponsored by:	Google SoC 2007
2008-01-28 10:20:18 +00:00
Mitsuru IWASAKI 7572a9c749 Return errno value rather than boolean in this context.
MFC after:	1 week
2008-01-28 01:57:48 +00:00
David Schultz b134ea7211 Adjust the exponent before converting the result from double to
float precision. This fixes some double rounding problems for
subnormals and simplifies things a bit.
2008-01-28 01:19:07 +00:00
Giorgos Keramidas 86ca3fd005 Revive '-opt' flags which I accidentally removed.
Noticed by:	simon
2008-01-27 16:20:36 +00:00
Mitsuru IWASAKI 0c26519e5a Enter the sleep state immediately without waiting for timeout if
devd(8) is not running such as the system in single user mode.

MFC after:	1 week
2008-01-27 16:11:04 +00:00
Mitsuru IWASAKI 4f7f6238af Add devctl_process_running() so that power management system driver
can check whether devd(8) is running.

MFC after:	1 week
2008-01-27 16:06:37 +00:00
Tom Rhodes a4b8759227 Bring the DIAGNOSTICS section in ed.4 closer to reality by removing missing
diagnostic messages and adding a few found in the code.

PR:	51891
2008-01-27 15:37:49 +00:00
Mike Makonnen 82e9dc59ce Add a dummynet_enable knob to go with firewall_enable. If this knob
is enabled dummynet(4) is added to the list of required modules.

Discussed on:	#freebsd-bugbusters (rwatson, trhodes)
PR:		conf/79196
MFC after:	1 week
2008-01-27 15:15:12 +00:00
Alexander Motin 57f2b25dfa Run expire even without export hook connected.
PR:	kern/119839
2008-01-27 15:01:16 +00:00
Mike Makonnen 73981c381a Clarify that devfs_system_ruleset should contain a name, not a number.
Prompted by PR conf/85363

MFC after: 3 days
2008-01-27 13:45:20 +00:00
Mike Makonnen 43cb08ceb6 Add the -M command-line option, which will set home directory permissions.
Works both in interactive or batch mode. This is a heavily modified version
of the patch submitted in the PR.

PR: bin/105060
MFC after: 1 week
2008-01-27 10:15:36 +00:00
Alexander Motin cfcb2a4c82 Fix memory leak when export hook is not connected. 2008-01-27 09:22:10 +00:00
Alexander Motin f704a24b20 Remove one very strange unneded if. 2008-01-27 08:52:41 +00:00
Kip Macy 6edc218ea1 Fix loading for case where we don't overload tcp_usrreqs by calling tcp_drop directly 2008-01-27 04:39:38 +00:00
Kip Macy a57927a1e6 fix DISABLE_MBUF_IOVEC case by initializing mbuf header completely 2008-01-27 04:37:02 +00:00
David E. O'Brien 16ea8822d9 Add to the history section. 2008-01-27 03:58:22 +00:00
Alexander Motin f8e5127d49 Slightly simplify code. 2008-01-27 02:04:12 +00:00
Marius Strobl 82f358ff2a - Fix a typo in a comment.
- Fix whitespace according to style(9).
- Sync the comment describing why we have to wait in nsphy_reset()
  with nsphyter_reset(). It's true that the manual tells to not do a
  reset within 500us of applying power but that's unlikely the cause
  of problems seen here. Generally having to wait 500us after a reset
  however is.
2008-01-27 01:30:02 +00:00
John Birrell 91d55a13ee fts_pathlen is now a size_t rather than an int so a cast is needed.
I'm not sure why warn() and err() string formatted variables need
to be right-justified.
2008-01-27 01:19:47 +00:00
Marius Strobl 4f3b854461 Fix a typo in a comment. 2008-01-27 01:11:57 +00:00
Marius Strobl d47d37af9b Add a driver for the National Semiconductor DP83815, DP83843 and
DP83847 PHYs. The main reason for using a specific driver for these
PHYs are reset quirks similar to the nsphy(4) driven DP83840A.

PR:		112654
Obtained from:	NetBSD
MFC after:	2 weeks
Thanks to:	mlaier for testing w/ DP83815
2008-01-27 01:10:41 +00:00
Marius Strobl a9e28d7d0b Sort values according to style.Makefile(5). 2008-01-27 01:02:29 +00:00
Robert Watson a384163c5e Increase maximum DDB capture buffer size to 5MB.
PR:		119993
MFC after:	2 months
Suggested by:	Scot Hetzel <swhetzel at gmail dot com>
2008-01-26 23:02:14 +00:00
Alexander Motin 5716b3f192 Improve multilink receive performance by netgraph item reuse. 2008-01-26 22:42:47 +00:00
Alexander Motin f9ec69904b Improve multilink xmit performance by netgraph item reuse. 2008-01-26 22:41:14 +00:00
Alexander Motin 93caf2e299 Improve multilink receive performance with fragment headers preallocation. 2008-01-26 22:39:05 +00:00
Sam Leffler 650bd88c74 rx mbufs must have a pkthdr; use m_gethdr to populate the rx ring
(and while here correct the mbuf type)

Submitted by:	Sam Banks <w0lfie@clear.net.nz>
MFC after:	1 week
2008-01-26 22:35:57 +00:00
Robert Watson f33dc69dfb Allow DDB_CAPTURE_DEFAULTBUFSIZE and DDB_CAPTURE_MAXBUFSIZE to be
overridden at compile-time using kernel options of the same names.

Rather than doing a compile-time CTASSERT of buffer sizes being
even multiples of block sizes, just adjust them at boottime, as
the failure mode is more user-friendly.

MFC after:	2 months
PR:		119993
Suggested by:	Scot Hetzel <swhetzel at gmail dot com>
2008-01-26 22:32:23 +00:00
Christian Brueffer 877729518e OLDCARD is gone, release imp's lock.
Approved by:	imp
2008-01-26 21:58:52 +00:00
Christian Brueffer 7133bff46c OLDCARD is long gone, so finally remove the oldcard.4 manpage.
Confirmed by:	imp
2008-01-26 20:23:25 +00:00
Yaroslav Tykhiy 48aaad5fbc Our fts(3) API, as inherited from 4.4BSD, suffers from integer
fields in FTS and FTSENT structs being too narrow.  In addition,
the narrow types creep from there into fts.c.  As a result, fts(3)
consumers, e.g., find(1) or rm(1), can't handle file trees an ordinary
user can create, which can have security implications.

To fix the historic implementation of fts(3), OpenBSD and NetBSD
have already changed <fts.h> in somewhat incompatible ways, so we
are free to do so, too.  This change is a superset of changes from
the other BSDs with a few more improvements.  It doesn't touch
fts(3) functionality; it just extends integer types used by it to
match modern reality and the C standard.

Here are its points:

o For C object sizes, use size_t unless it's 100% certain that
  the object will be really small.  (Note that fts(3) can construct
  pathnames _much_ longer than PATH_MAX for its consumers.)

o Avoid the short types because on modern platforms using them
  results in larger and slower code.  Change shorts to ints as
  follows:

	- For variables than count simple, limited things like states,
	  use plain vanilla `int' as it's the type of choice in C.

	- For a limited number of bit flags use `unsigned' because signed
	  bit-wise operations are implementation-defined, i.e., unportable,
	  in C.

o For things that should be at least 64 bits wide, use long long
  and not int64_t, as the latter is an optional type.  See
  FTSENT.fts_number aka FTS.fts_bignum.  Extending fts_number `to
  satisfy future needs' is pointless because there is fts_pointer,
  which can be used to link to arbitrary data from an FTSENT.
  However, there already are fts(3) consumers that require fts_number,
  or fts_bignum, have at least 64 bits in it, so we must allow for them.

o For the tree depth, use `long'.  This is a trade-off between making
  this field too wide and allowing for 64-bit inode numbers and/or
  chain-mounted filesystems.  On the one hand, `long' is almost
  enough for 32-bit filesystems on a 32-bit platform (our ino_t is
  uint32_t now).  On the other hand, platforms with a 64-bit (or
  wider) `long' will be ready for 64-bit inode numbers, as well as
  for several 32-bit filesystems mounted one under another.  Note
  that fts_level has to be signed because -1 is a magic value for it,
  FTS_ROOTPARENTLEVEL.

o For the `nlinks' local var in fts_build(), use `long'.  The logic
  in fts_build() requires that `nlinks' be signed, but our nlink_t
  currently is uint16_t.  Therefore let's make the signed var wide
  enough to be able to represent 2^16-1 in pure C99, and even 2^32-1
  on a 64-bit platform.  Perhaps the logic should be changed just
  to use nlink_t, but it can be done later w/o breaking fts(3) ABI
  any more because `nlinks' is just a local var.

This commit also inludes supporting stuff for the fts change:

o Preserve the old versions of fts(3) functions through libc symbol
versioning because the old versions appeared in all our former releases.

o Bump __FreeBSD_version just in case.  There is a small chance that
some ill-written 3-rd party apps may fail to build or work correctly
if compiled after this change.

o Update the fts(3) manpage accordingly.  In particular, remove
references to fts_bignum, which was a FreeBSD-specific hack to work
around the too narrow types of FTSENT members.  Now fts_number is
at least 64 bits wide (long long) and fts_bignum is an undocumented
alias for fts_number kept around for compatibility reasons.  According
to Google Code Search, the only big consumers of fts_bignum are in
our own source tree, so they can be fixed easily to use fts_number.

o Mention the change in src/UPDATING.

PR:		bin/104458
Approved by:	re (quite a while ago)
Discussed with:	deischen (the symbol versioning part)
Reviewed by:	-arch (mostly silence); das (generally OK, but we didn't
		agree on some types used; assuming that no objections on
		-arch let me to stick to my opinion)
2008-01-26 17:09:40 +00:00
Mike Makonnen ae4d6ea88f Generally, anything that runs rc.d scripts internally should
start using the quiet prefix (i.e. quietstart, quietstop, etc...).
2008-01-26 14:02:19 +00:00
Robert Watson 8a4d372e93 Rename DB_ constants in db_capture.c to DDB_ so that when they are
exposed as kernel compile options, they have more meaningful names.

PR:		119993
MFC after:	2 months
Suggested by:	Scot Hetzel <swhetzel at gmail dot com>
2008-01-26 13:55:52 +00:00
Mike Makonnen 8511b3cb47 Generally, anything that runs rc.d scripts internally should
start using the quiet prefix (i.e. quietstart, quietstop, etc...).
2008-01-26 13:50:38 +00:00
Mike Makonnen 016cb0ba87 Use 'quietstart' so as not to get spammed with informational diagnostics. 2008-01-26 13:37:48 +00:00
Mike Pritchard 5338828a37 Explain how the passno field in /etc/fstab works with fsck
and quotacheck in some more detail.
2008-01-26 13:03:35 +00:00
Giorgos Keramidas a502340a03 Document the no-op -r option of BSD xargs(1).
PR:		docs/106416
Submitted by:	Pete Slagle, freebsd-stable at voidcaptain.com
MFC after:	3 days
2008-01-26 12:38:19 +00:00
Robert Watson c55376e791 Remove Giant acquisition around soreceive() and sosend() in fifofs. The
bug that caused us to reintroduce it is believed to be fixed, and Kris
says he no longer sees problems with fifofs in highly parallel builds.
If this works out, we'll MFC it for 7.1.

MFC after:	3 months
Pointed out by:	kris
2008-01-26 12:34:23 +00:00
Mike Pritchard 3b9401db6f Sync up quotacheck's preen.c with fsck's. This makes quotacheck
process parallel checks in the same way as fsck, since fsck supports
pass numbers other than 0, 1 or 2.  Without this, quotacheck would
ignore file systems with pass numbers > 2.

The -l (maxrun) option is now deprecated and can be tuned with pass
numbers in /etc/fstab if needed.
2008-01-26 12:03:26 +00:00
Mike Makonnen a850398f3b Re-implement: do not silently fail when a command is not carried
out because the rc.conf(5) variable was not enabled. Display a
message that the command wasn't run and offer suggestions on
what the user can do.

Implement a quiet prefix, which will disable some diagnostics. The
fast prefix also implies quiet. During boot we use either fast or
quiet. For shutdown we already use 'faststop'. So, this informational
message should only appear during interactive use.

An additional benefit of having a quiet prefix is that we can start
putting some of our diagnostic messages behind this knob and start
"de-cluttering" the console during boot and shutdown.
2008-01-26 11:22:12 +00:00