Commit Graph

164471 Commits

Author SHA1 Message Date
John Baldwin
18abed0c9b Note that -a, -C, -H, -j, and -z are also toggles.
PR:		bin/158682
Reported by:	arundel
MFC after:	3 days
2011-07-08 13:45:53 +00:00
Jonathan Anderson
5604e481b1 Fix the "passability" test in fdcopy().
Rather than checking to see if a descriptor is a kqueue, check to see if
its fileops flags include DFLAG_PASSABLE.

At the moment, these two tests are equivalent, but this will change with
the addition of capabilities that wrap kqueues but are themselves of type
DTYPE_CAPABILITY. We already have the DFLAG_PASSABLE abstraction, so let's
use it.

This change has been tested with [the newly improved] tools/regression/kqueue.

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-08 12:19:25 +00:00
Jonathan Anderson
345f2b96e2 Clarify the meaning of a test.
Rather than using err() if either of two failure conditions
fires (which can produce spurious error messages), just use
errx() if the one condition that really matters fires.

In practice, this single test is enough to detect the failure
mode we're looking for (kqueue being inherited across fork).

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-08 12:16:30 +00:00
Hans Petter Selasky
49901133a1 Add new USB 3G driver.
Submitted by:	PseudoCylon <moonlightakkiy@yahoo.ca>
MFC after:	14 days
2011-07-08 10:58:56 +00:00
Andre Oppermann
695da99eba In the experimental soreceive_stream():
o Move the non-blocking socket test below the SBS_CANTRCVMORE so that EOF
   is correctly returned on a remote connection close.
 o In the non-blocking socket test compare SS_NBIO against the so->so_state
   field instead of the incorrect sb->sb_state field.
 o Simplify the ENOTCONN test by removing cases that can't occur.

Submitted by:	trociny (with some further tweaks by committer)
Tested by:	trociny
2011-07-08 10:50:13 +00:00
Marko Zec
13e255fab7 Permit ARP to proceed for IPv4 host routes for which the gateway is the
same as the host address.  This already works fine for INET6 and ND6.

While here, remove two function pointers from struct lltable which are
only initialized but never used.

MFC after:	3 days
2011-07-08 09:38:33 +00:00
Tai-hwa Liang
728fc2d633 Fixing building bustage on 32 bits platforms when WARNS >= 2. Note that
this fix only applies to zalloc.c, the other part of libstand such like
qdivrem.c still gives compilation warnings on sparc64 tinderbox builds;
therefore, WARNS level isn't changed for now.

Submitted by:	Garrett Cooper <yanegomi@gmail.com>
Reviewed by:	bde
2011-07-08 01:35:33 +00:00
Rick Macklem
1e2cac7b7f Delete the /etc/rc.d/nfsserver script, since it is no
longer used by /etc/rc.d/nfsd and it is no longer necessary
to load the old nfs server by default, when nfs_server_enable="YES".

Tested by:	sgk at troutmask.apl.washington.edu
Reviewed by:	rc (Andrzej Tobola)
2011-07-08 00:49:50 +00:00
David E. O'Brien
cd2809fc68 Note the PF version.
Discussed with:	bz
2011-07-07 23:17:56 +00:00
Rick Macklem
c4c07ee035 Fix the /etc/rc.d/nfsd script so that it no longer uses
the /etc/rc.d/nfsserver script to load the old nfs server
module.

Tested by:	sgk at troutmask.apl.washington.edu
Reviewed by:	rc (hrs)
2011-07-07 20:59:42 +00:00
Andrew Thompson
6069a2c0bd Grab the rlock before checking if our interface is enabled, it could be
possible to hit a dead pointer when changing interfaces.

PR:		kern/156978
Submitted by:	Andrew Boyer
MFC after:	1 week
2011-07-07 20:02:09 +00:00
Jonathan Anderson
0136244a52 Ensure that kqueue is not inherited across fork().
Modify the existing unit test (from libkqueue) which already exercises process events via
fork() and kill(). Now, the child process simply checks that the 'kqfd' descriptor is invalid.

Some minor modifications were required to make err() work correctly. It seems that this test
was imported using the output of a configure script, but config.h was not included in key
places, nor was its syntax correct (need '#define HAVE_FOO 1' rather than '#define HAVE_FOO').

Finally, change main() to run the "proc" suite by default, but widened the '#if TODO' in
proc.c to include the non-functioning test event_trigger().

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-07 18:07:03 +00:00
Edward Tomasz Napierala
4fe8477539 Style fix - macros are supposed to be uppercase. 2011-07-07 17:44:42 +00:00
Jonathan Anderson
cd6dac7dff Make a comment more accurate.
This comment refers to CAP_NT_SMBS, which does not exist; it should refer to SMB_CAP_NT_SMBS.
Fixing this comment makes it easier for people interested in Capsicum to grep around for
capability rights, whose identifiers are of the form 'CAP_[A-Z_]'.

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-07 17:00:42 +00:00
Kevin Lo
d91933f4c0 Fix memset sizeofs
Reviewed by:	bschmidt
2011-07-07 15:41:40 +00:00
John Baldwin
034b7b80b2 Always skip the kernel idle process if requested, it is not specific to
the 'CPU' mode.

PR:		bin/158677
Reported by:	arundel
MFC after:	3 days
2011-07-07 13:37:46 +00:00
Andrey V. Elsukov
4659e09dcb Add again the checking for log_arp_permanent_modify that was by accident
removed in the r186119.

PR:		kern/154831
MFC after:	1 week
2011-07-07 11:59:51 +00:00
Andre Oppermann
1c6e7fa7f1 Remove the TCP_SORECEIVE_STREAM compile time option. The use of
soreceive_stream() for TCP still has to be enabled with the loader
tuneable net.inet.tcp.soreceive_stream.

Suggested by:	trociny and others
2011-07-07 10:37:14 +00:00
Kevin Lo
260923853f Add an extra tab between fs_file and fs_vfstype
Reviewed by:	nwhitehorn
2011-07-07 01:22:50 +00:00
Jack F Vogel
980729b244 A fix to make the LINT-NOINET build happy, if this
works out the ixgbe driver should be changed as well.
2011-07-07 00:46:50 +00:00
Edward Tomasz Napierala
afcc55f318 All the racct_*() calls need to happen with the proc locked. Fixing this
won't happen before 9.0.  This commit adds "#ifdef RACCT" around all the
"PROC_LOCK(p); racct_whatever(p, ...); PROC_UNLOCK(p)" instances, in order
to avoid useless locking/unlocking in kernels built without "options RACCT".
2011-07-06 20:06:44 +00:00
Sergey Kandaurov
6765aefcf3 Conditionally compile in the IPv4/IPv6 address family support.
Test it with feature_present(3), so that we do not end up with passing
an unsupported version to NgSendMsg(3).

Approved by:	glebius
2011-07-06 15:18:32 +00:00
Attilio Rao
91a1929f07 Handle a race between device_pager and devsw in a more graceful manner:
return an error code rather than panic the kernel.

Sponsored by:	Sandvine Incorporated
Reviewed by:	kib
Tested by:	pho
MFC after:	2 weeks
2011-07-06 15:09:52 +00:00
Gleb Smirnoff
acfc07098c Add missing unlocks. 2011-07-06 09:43:25 +00:00
Gordon Tetlow
c909243f40 Only increment the ypcnt once per data record. The old implementation
was incrementing it twice making it impossible to iterate the table
since the records were 1, 3, 5, 7 (or 2, 4, 6, 8 for the v3 records).

MFC after:	10 days
2011-07-06 06:34:08 +00:00
Doug Barton
7c9d9e417a Update to version 9.6-ESV-R4-P3
ALL BIND USERS ARE ENCOURAGED TO UPGRADE IMMEDIATELY

This update addresses the following vulnerability:

CVE-2011-2464
=============
Severity:	High
Exploitable:	Remotely

Description:

A defect in the affected BIND 9 versions allows an attacker to remotely
cause the "named" process to exit using a specially crafted packet. This
defect affects both recursive and authoritative servers. The code location
of the defect makes it impossible to protect BIND using ACLs configured
within named.conf or by disabling any features at compile-time or run-time.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2464
https://www.isc.org/software/bind/advisories/cve-2011-2464
2011-07-06 00:48:31 +00:00
Doug Barton
09103e4808 Apply bug fixes
Submitted by:	marius
2011-07-06 00:47:27 +00:00
Marius Strobl
410cde006a Remove the IDR_CHEETAH_MAX_BN_PAIRS limit from cheetah_ipi_selected().
This is just a simple approach. For reasons unknown OpenSolaris uses a
more sophisticated one involving IPIing the remaining CPUs in reverse
order after the first batch of 32.
2011-07-05 20:05:06 +00:00
Doug Barton
8579a19211 Vendor import of BIND 9.6-ESV-R4-P3 2011-07-05 19:37:48 +00:00
Rick Macklem
0b46b417fc Delete files made obsolete because they were moved to sys/nfs
in order to be shared by both NFS clients.
2011-07-05 19:26:58 +00:00
Marius Strobl
6df19902a5 It can be useful to know which page still has mappings. 2011-07-05 18:55:56 +00:00
Marius Strobl
0e5b645f76 - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c
so static'ize them.
- Correct a typo.
2011-07-05 18:50:40 +00:00
Colin Percival
472ea5befb Remove #ifdef notyet code dating back to 4.3BSD Net/2 (and possibly earlier).
I think the benefit of making the code cleaner and easier to understand
outweighs the humour of leaving this intact (or possibly changing it to
#ifdef not_yet_and_probably_never).

MFC after:	2 weeks
2011-07-05 18:49:55 +00:00
Marius Strobl
63db5ba435 In pmap_remove_all() assert that the page is neither fictitious nor
unmanaged as also done on other architectures.

Reviewed by:	alc
2011-07-05 18:46:19 +00:00
Colin Percival
ca7122622b Don't allow lro->len to exceed 65535, as this will result in overflow
when len is inserted back into the synthetic IP packet and cause a
multiple of 2^16 bytes of TCP "packet loss".

This improves Linux->FreeBSD netperf bandwidth by a factor of 300 in
testing on Amazon EC2.

Reviewed by:	jfv
MFC after:	2 weeks
2011-07-05 18:43:54 +00:00
Jung-uk Kim
f0b28f005e Correct cpu_monitor() and cpu_mwait() for amd64. These instructions take
%rcx as "extensions" in long mode.  If any unused bit is set in %rcx, these
instructions cause general protection fault.  Fix style nits and synchronize
i386 with amd64.
2011-07-05 18:42:10 +00:00
Marius Strobl
2e569926f8 Call pmap_qremove() before freeing or unwiring the pages, otherwise
there's a window during which a page can be re-used before its previous
mapping is removed.

Reviewed by:	alc
MFC after:	1 week
2011-07-05 18:40:37 +00:00
Rick Macklem
8003fe6e31 Delete files made obsolete by the change in default NFS client
and the move of nfs_kdtrace.h to sys/nfs.
2011-07-05 18:40:19 +00:00
Nathan Whitehorn
534c6b8916 Follow Linux by unconditionally stripping the RX vlan tag from incoming
packets. It turns out that all firmware versions insert it, whether or not
they support VLAN tagging.

Submitted by:	glevand <geoffrey.levand at mail dot ru>
2011-07-05 15:00:55 +00:00
Gleb Smirnoff
a1068a7d47 Update manual page. Mention IPv6 support, and notice that main
argument isn't actually a node, but a netgraph path.
2011-07-05 14:55:17 +00:00
Gleb Smirnoff
37b425e9eb Rewrite the flowctl utility to add it support for displaying
both IPv4 and IPv4 flows.
2011-07-05 14:50:06 +00:00
Gleb Smirnoff
ea7e163882 o Eliminate flow6_hash_entry in favor of flow_hash_entry. We don't need
a separate struct to start a slist of semi-opaque structs. This
  makes some code more compact.
o Rewrite ng_netflow_flow_show() and its API/ABI:
  - Support for IPv6 is added.
  - Request and response now use same struct. Structure specifies
    version (6 or 4), index of last retrieved hash, and also index
    of last retrieved entry in the hash entry.
2011-07-05 14:48:39 +00:00
Ed Schouten
21632754d6 Only print entries for which ut_host points to a character device.
Now that we use utmpx, we more often have entries for which the ut_line
is left blank. To prevent us from returning struct stat for "/dev/",
check that the resulting stat structure belongs to a character device.
2011-07-05 14:12:48 +00:00
Jonathan Anderson
9acdfe6549 Rework _fget to accept capability parameters.
This new version of _fget() requires new parameters:
- cap_rights_t needrights
    the rights that we expect the capability's rights mask to include
    (e.g. CAP_READ if we are going to read from the file)

- cap_rights_t *haverights
    used to return the capability's rights mask (ignored if NULL)

- u_char *maxprotp
    the maximum mmap() rights (e.g. VM_PROT_READ) that can be permitted
    (only used if we are going to mmap the file; ignored if NULL)

- int fget_flags
    FGET_GETCAP if we want to return the capability itself, rather than
    the underlying object which it wraps

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-05 13:45:10 +00:00
Mikolaj Golub
0687d71e40 Remove useless initialization.
Approved by:	pjd (mentor)
MFC after:	3 days
2011-07-05 06:12:28 +00:00
Rick Macklem
98a7b279a2 The algorithm used by nfscl_getopen() could have resulted in
multiple instances of the same lock_owner when a process both
inherited an open file descriptor plus opened the same file itself.
Since some NFSv4 servers cannot handle multiple instances of
the same lock_owner string, this patch changes the algorithm
used by nfscl_getopen() in the new NFSv4 client to keep that
from happening. The new algorithm is simpler, since there is
no longer any need to ascend the process's parentage tree because
all NFSv4 Closes for a file are done at VOP_INACTIVE()/VOP_RECLAIM(),
making the Opens indistinct w.r.t. use with Lock Ops.
This problem was discovered at the recent NFSv4 interoperability
Bakeathon.

MFC after:	2 weeks
2011-07-04 23:32:09 +00:00
Glen Barber
ff19f85d50 - General grammar and mdoc(7) fixes. [1] [2]
- While here, remove a paragraph about userspace operation that
  has been outdated for some time. [2]

PR:		158623
Submitted by:	Ben Kudak (kaduk % mit!edu) [1]
Reviewed by:	glebius [2]
MFC after:	1 week
2011-07-04 23:00:26 +00:00
Jeff Roberson
e9b4d8327f - Speed up pendingblock processing again. Having too much delay between
ffs_blkfree() and the pending adjustment causes all kinds of
   space related problems.
2011-07-04 22:08:04 +00:00
Jeff Roberson
f2803e61fa - Handle D_JSEGDEP in the softdep_sync_buf() switch. These can now
find themselves on snapshot vnodes.

Reported by:	pho
2011-07-04 21:04:25 +00:00
Jeff Roberson
8e4f5b70b0 - It is impossible to run request_cleanup() while doing a copyonwrite.
This will most likely cause new block allocations which can recurse
   into request cleanup.
 - While here optimize the ufs locking slightly.  We need only acquire and
   drop once.
 - process_removes() and process_truncates() also is only needed once.
 - Attempt to flush each item on the worklist once but do not loop forever
   if some can not be completed.

Discussed with:	mckusick
2011-07-04 20:53:55 +00:00