]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoInclude sys/sbuf.h directly.
Andrey V. Elsukov [Mon, 11 Jul 2011 05:22:31 +0000 (05:22 +0000)]
Include sys/sbuf.h directly.

Reviewed by: pjd

13 years agoInclude sys/sbuf.h directly.
Andrey V. Elsukov [Mon, 11 Jul 2011 05:19:28 +0000 (05:19 +0000)]
Include sys/sbuf.h directly.

13 years agoInclude sys/sbuf.h directly.
Andrey V. Elsukov [Mon, 11 Jul 2011 05:17:46 +0000 (05:17 +0000)]
Include sys/sbuf.h directly.

13 years agoMake sure we load kernel modules from the same path as the running kernel
Doug Barton [Sun, 10 Jul 2011 23:47:03 +0000 (23:47 +0000)]
Make sure we load kernel modules from the same path as the running kernel

13 years agoExtract the code to translate VM error into errno, into an exported
Konstantin Belousov [Sun, 10 Jul 2011 20:49:13 +0000 (20:49 +0000)]
Extract the code to translate VM error into errno, into an exported
function vm_mmap_to_errno(). It is useful for the drivers that implement
mmap(2)-like functionality, to be able to return error codes consistent
with mmap(2).

Sponsored by: The FreeBSD Foundation
No objections from: alc
MFC after: 1 week

13 years agoStyle.
Konstantin Belousov [Sun, 10 Jul 2011 20:45:13 +0000 (20:45 +0000)]
Style.

MFC after: 3 days

13 years agoCross reference nanobsd(8)
Ivan Voras [Sun, 10 Jul 2011 20:15:21 +0000 (20:15 +0000)]
Cross reference nanobsd(8)

13 years agoUpdate locking annotations for the struct vnode.
Konstantin Belousov [Sun, 10 Jul 2011 18:57:35 +0000 (18:57 +0000)]
Update locking annotations for the struct vnode.

MFC after: 3 days

13 years agosh(1): Extend documentation about subshells.
Jilles Tjoelker [Sun, 10 Jul 2011 15:02:25 +0000 (15:02 +0000)]
sh(1): Extend documentation about subshells.

Because sh executes commands in subshell environments without forking in
more and more cases (particularly from 8.0 on), it makes sense to describe
subshell environments more precisely using ideas from POSIX, together with
some FreeBSD-specific items.

In particular, the hash and times builtins may not behave as if their state
is copied for a subshell environment while leaving the parent shell
environment unchanged.

13 years agoAdd more obsolete files.
Antoine Brodin [Sun, 10 Jul 2011 15:01:14 +0000 (15:01 +0000)]
Add more obsolete files.

13 years agoposix_spawn: If an error is detected in the child process, reap the zombie.
Jilles Tjoelker [Sun, 10 Jul 2011 14:20:11 +0000 (14:20 +0000)]
posix_spawn: If an error is detected in the child process, reap the zombie.

Formerly, in this case an error was returned but the pid was also returned
to the application, requiring the application to use unspecified behaviour
(the returned pid in error situations) to avoid zombies.

Now, reap the zombie and do not return the pid.

MFC after: 2 weeks

13 years agoRevert the previous change and add xdr_sizeof
Kevin Lo [Sun, 10 Jul 2011 14:03:13 +0000 (14:03 +0000)]
Revert the previous change and add xdr_sizeof

Requested by: bde

13 years ago- Removing some unneeded definitions of NULL(cruft related to 1970's C).
Tai-hwa Liang [Sun, 10 Jul 2011 07:25:34 +0000 (07:25 +0000)]
- Removing some unneeded definitions of NULL(cruft related to 1970's C).
  In C90, NULL is guaranteed to be declared in <stddef.h> and also in
  <string.h>.  Though the correct way to define NULL in FreeBSD is to
  include <sys/_null.h>, other parts of libstand still require <string.h>
  to build; therefore, we keep <string.h> in stand.h and add a note about
  this;
- Removing no longer used 'Prototype' definition.  Quote from bde@:

'Cruft related to getting incomplete struct declarations within
prototypes forward-declared before the structs.  It doesn't mean
"prototype" but only part of a prototype-related hack.  No longer
used.'

- Replacing iaddr_t with uintptr_t;
- Removing use of long double to determine alignment.  Use a fixed 16 byte
  alignment instead;

Reviewed by: bde
Obtained from: DragonFlyBSD (partially)
MFC after: 1 month

13 years agostyle(9) cleanup
Kevin Lo [Sun, 10 Jul 2011 07:14:32 +0000 (07:14 +0000)]
style(9) cleanup

13 years agoAdd a HISTORY section
Kevin Lo [Sun, 10 Jul 2011 06:57:00 +0000 (06:57 +0000)]
Add a HISTORY section

Requested by: arundel

13 years agoWhen first creating snapshots, we may free some blocks within it.
Kirk McKusick [Sun, 10 Jul 2011 05:34:49 +0000 (05:34 +0000)]
When first creating snapshots, we may free some blocks within it.
These blocks should not have TRIM applied to them.

Submitted by: Kostik Belousov

13 years agoUpdate tags build script
Kirk McKusick [Sun, 10 Jul 2011 00:53:04 +0000 (00:53 +0000)]
Update tags build script

13 years agoAllow disk partitions associated with UFS read-only mounted
Kirk McKusick [Sun, 10 Jul 2011 00:41:31 +0000 (00:41 +0000)]
Allow disk partitions associated with UFS read-only mounted
filesystems to be opened for writing. This functionality used to
be special-cased for just the root filesystem, but with this change
is now available for all UFS filesystems. This change is needed for
journaled soft updates recovery.

Discussed with: Jeff Roberson

13 years agoPer request of the docs team, install docs as packages, instead of via
Nathan Whitehorn [Sat, 9 Jul 2011 23:01:54 +0000 (23:01 +0000)]
Per request of the docs team, install docs as packages, instead of via
the normal distfile mechanism. Thanks to Marc Fonvieille for the patch and
for putting up with me taking entirely too long to commit this!

Submitted by: blackend

13 years agoRemove reviewed line from copyright header.
Hans Petter Selasky [Sat, 9 Jul 2011 20:16:52 +0000 (20:16 +0000)]
Remove reviewed line from copyright header.

Suggested by: joel @

13 years agoRemove the old vm_map_clean man page.
Alan Cox [Sat, 9 Jul 2011 19:09:20 +0000 (19:09 +0000)]
Remove the old vm_map_clean man page.

13 years agovm_map_clean() was long ago renamed to vm_map_sync(). Also, it no longer
Alan Cox [Sat, 9 Jul 2011 19:05:28 +0000 (19:05 +0000)]
vm_map_clean() was long ago renamed to vm_map_sync().  Also, it no longer
acquires Giant.

MFC after: 1 week

13 years agoFix the definition for PCPU_NAME_LEN, which is intended to fit
Marius Strobl [Sat, 9 Jul 2011 18:47:51 +0000 (18:47 +0000)]
Fix the definition for PCPU_NAME_LEN, which is intended to fit
("CPU %d", cpuid) where cpuid <= MAXCPU.

1. sizeof(__XSTRING(MAXCPU) + 1) is a typo: typeof(__XSTRING(...) + 1)
   is 'char *', so sizeof() will return the size of the pointer, not
   the size of the string contents. The proper expression should be
   'sizeof(__XSTRING(MAXCPU)) + 1'.

2. One should not add one, but substract it: sizeof() accounts for the
   trailing '\0' and we have two sizeof's, so the size of one '\0'
   should be substracted -- this will give the maximal string buffer
   length for CPU with its number, no less, no more.

Submitted by: rea

13 years agoOops. These changes should have been included in r223891.
Alan Cox [Sat, 9 Jul 2011 18:09:57 +0000 (18:09 +0000)]
Oops.  These changes should have been included in r223891.

MFC after: 1 week

13 years agoRemove manual pages for functions that no longer exist.
Alan Cox [Sat, 9 Jul 2011 18:05:27 +0000 (18:05 +0000)]
Remove manual pages for functions that no longer exist.

MFC after: 1 week

13 years agoDocument copyin_nofault, copyout_nofault, uiomove_nofault.
Konstantin Belousov [Sat, 9 Jul 2011 15:24:12 +0000 (15:24 +0000)]
Document copyin_nofault, copyout_nofault, uiomove_nofault.

Submitted by: alc

13 years agoAdd a facility to disable processing page faults. When activated,
Konstantin Belousov [Sat, 9 Jul 2011 15:21:10 +0000 (15:21 +0000)]
Add a facility to disable processing page faults. When activated,
uiomove generates EFAULT if any accessed address is not mapped, as
opposed to handling the fault.

Sponsored by: The FreeBSD Foundation
Reviewed by: alc (previous version)

13 years agoUse 'curthread_pflags' instead of 'thread_pflags' to signify that only
Konstantin Belousov [Sat, 9 Jul 2011 15:16:07 +0000 (15:16 +0000)]
Use 'curthread_pflags' instead of 'thread_pflags' to signify that only
curthread can be operated upon.

Requested by: attilio
MFC after: 1 week

13 years agoUse helper functions instead of manually managing TDP_INBDFLUSH.
Konstantin Belousov [Sat, 9 Jul 2011 14:42:45 +0000 (14:42 +0000)]
Use helper functions instead of manually managing TDP_INBDFLUSH.

Sponsored by: The FreeBSD Foundation
Reviewed by: alc (previous version)
MFC after: 1 week

13 years agoImplement a helper functions to locally set thread-private flag, and
Konstantin Belousov [Sat, 9 Jul 2011 14:41:28 +0000 (14:41 +0000)]
Implement a helper functions to locally set thread-private flag, and
restore it to the previous state. Note that only setting a flag locally
is supported.

Sponsored by: The FreeBSD Foundation
Reviewed by: alc (previous version)
MFC after: 1 week

13 years agoImplement pci_find_class(9), the function to find a pci device by its class.
Konstantin Belousov [Sat, 9 Jul 2011 14:30:13 +0000 (14:30 +0000)]
Implement pci_find_class(9), the function to find a pci device by its class.

Sponsored by: The FreeBSD Foundation
Reviewed by: jhb
MFC after: 1 week

13 years agoImplement bitcount16.
Konstantin Belousov [Sat, 9 Jul 2011 14:29:23 +0000 (14:29 +0000)]
Implement bitcount16.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

13 years agoFix style, since this file has just been touched in a major way.
Stefan Eßer [Sat, 9 Jul 2011 12:20:15 +0000 (12:20 +0000)]
Fix style, since this file has just been touched in a major way.
No actual code changes.

13 years agoSome refactoring for easier maintenance of the code. This is a follow-up
Stefan Eßer [Sat, 9 Jul 2011 12:14:57 +0000 (12:14 +0000)]
Some refactoring for easier maintenance of the code. This is a follow-up
to re-establishment of 64bit arithmetic, but is committed separately, to
not obscure that conversion. This commit does not change the observed
behaviour of expr in any way. Style will be fixed in a follow-up commit.

13 years agoMake /bin/expr support 64bit numeric range and range checks by default,
Stefan Eßer [Sat, 9 Jul 2011 12:05:53 +0000 (12:05 +0000)]
Make /bin/expr support 64bit numeric range and range checks by default,
again. This brings back the behaviour of expr in FreeBSD-4, which had been
reverted due to an assumed incompatbility with POSIX.1 for FreeBSD-5.

This issue has been discussed in the freebsd-standards list, and the
consensus was, that POSIX.1 is in fact not violated by this extension,
since it affects only cases of POSIX undefined behaviour (overflow of
signed long).

Other operating systems did upgrade their versions of expr to support
64bit range, after it had been initially brought to FreeBSD. They have
used it for a decade without problems, meanwhile.

The -e option is retained, but it will only select less strict checking
of numeric parameters (leading white-space, leading "+" are allowed and
skipped, an empty string is considered to represent 0 in numeric context.)
The call of check_utility_compat() as a means of establishing backwards
compatibility with FreeBSD-4 is considered obsolete, but preserved in
this commit. It is expected to be removed in a later revision of this
file.
Reviewed by: bde, das, jilles
MFC after: 2 month (those parts that do not violate POLA)

13 years agoAdd missing "swapuse" resource limit.
Edward Tomasz Napierala [Sat, 9 Jul 2011 08:42:23 +0000 (08:42 +0000)]
Add missing "swapuse" resource limit.

13 years ago- Add xdr_sizeof(3) to libc
Kevin Lo [Sat, 9 Jul 2011 07:43:56 +0000 (07:43 +0000)]
- Add xdr_sizeof(3) to libc
- Document xdr_sizeof(3); from NetBSD

Discussed with: kib

13 years agoAdd an option to have a fail point term only execute when run by a
Matthew D Fleming [Fri, 8 Jul 2011 20:41:12 +0000 (20:41 +0000)]
Add an option to have a fail point term only execute when run by a
specified pid.  This is helpful for automated testing involving a global
knob that would otherwise be executed by many other threads.

MFC after: 1 week

13 years agostyle(9) and cleanup fixes.
Matthew D Fleming [Fri, 8 Jul 2011 20:41:07 +0000 (20:41 +0000)]
style(9) and cleanup fixes.

MFC after: 1 week

13 years agoAdd device ID for the Davicom 56PDV PCI Modem.
John Baldwin [Fri, 8 Jul 2011 17:45:38 +0000 (17:45 +0000)]
Add device ID for the Davicom 56PDV PCI Modem.

PR: kern/75132
Submitted by: Mike Tancsa @ Sentex (older patch against puc(4))
MFC after: 1 week

13 years agoImplement basic support for memory attributes. At this time we only
Marcel Moolenaar [Fri, 8 Jul 2011 16:30:54 +0000 (16:30 +0000)]
Implement basic support for memory attributes. At this time we only
distinguish between UC and WB memory so that we can map the page to
either a region 6 address (for UC) or a region 7 address (for WB).

This change is only now possible, because previously we would map
regions 6 and 7 with 256MB translations and on top of that had the
kernel mapped in region 7 using a wired translation. The introduction
of the PBVM moved the kernel into its own region and freed up region
7 and allowed us to revert to standard page-sized translations.

This commit inroduces pmap_page_to_va() that respects the attribute.

13 years agoNote that -a, -C, -H, -j, and -z are also toggles.
John Baldwin [Fri, 8 Jul 2011 13:45:53 +0000 (13:45 +0000)]
Note that -a, -C, -H, -j, and -z are also toggles.

PR: bin/158682
Reported by: arundel
MFC after: 3 days

13 years agoFix the "passability" test in fdcopy().
Jonathan Anderson [Fri, 8 Jul 2011 12:19:25 +0000 (12:19 +0000)]
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

13 years agoClarify the meaning of a test.
Jonathan Anderson [Fri, 8 Jul 2011 12:16:30 +0000 (12:16 +0000)]
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

13 years agoAdd new USB 3G driver.
Hans Petter Selasky [Fri, 8 Jul 2011 10:58:56 +0000 (10:58 +0000)]
Add new USB 3G driver.

Submitted by: PseudoCylon <moonlightakkiy@yahoo.ca>
MFC after: 14 days

13 years agoIn the experimental soreceive_stream():
Andre Oppermann [Fri, 8 Jul 2011 10:50:13 +0000 (10:50 +0000)]
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

13 years agoPermit ARP to proceed for IPv4 host routes for which the gateway is the
Marko Zec [Fri, 8 Jul 2011 09:38:33 +0000 (09:38 +0000)]
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

13 years agoFixing building bustage on 32 bits platforms when WARNS >= 2. Note that
Tai-hwa Liang [Fri, 8 Jul 2011 01:35:33 +0000 (01:35 +0000)]
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

13 years agoDelete the /etc/rc.d/nfsserver script, since it is no
Rick Macklem [Fri, 8 Jul 2011 00:49:50 +0000 (00:49 +0000)]
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)

13 years agoNote the PF version.
David E. O'Brien [Thu, 7 Jul 2011 23:17:56 +0000 (23:17 +0000)]
Note the PF version.

Discussed with: bz

13 years agoFix the /etc/rc.d/nfsd script so that it no longer uses
Rick Macklem [Thu, 7 Jul 2011 20:59:42 +0000 (20:59 +0000)]
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)

13 years agoGrab the rlock before checking if our interface is enabled, it could be
Andrew Thompson [Thu, 7 Jul 2011 20:02:09 +0000 (20:02 +0000)]
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

13 years agoEnsure that kqueue is not inherited across fork().
Jonathan Anderson [Thu, 7 Jul 2011 18:07:03 +0000 (18:07 +0000)]
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

13 years agoStyle fix - macros are supposed to be uppercase.
Edward Tomasz Napierala [Thu, 7 Jul 2011 17:44:42 +0000 (17:44 +0000)]
Style fix - macros are supposed to be uppercase.

13 years agoMake a comment more accurate.
Jonathan Anderson [Thu, 7 Jul 2011 17:00:42 +0000 (17:00 +0000)]
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

13 years agoFix memset sizeofs
Kevin Lo [Thu, 7 Jul 2011 15:41:40 +0000 (15:41 +0000)]
Fix memset sizeofs

Reviewed by: bschmidt

13 years agoAlways skip the kernel idle process if requested, it is not specific to
John Baldwin [Thu, 7 Jul 2011 13:37:46 +0000 (13:37 +0000)]
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

13 years agoAdd again the checking for log_arp_permanent_modify that was by accident
Andrey V. Elsukov [Thu, 7 Jul 2011 11:59:51 +0000 (11:59 +0000)]
Add again the checking for log_arp_permanent_modify that was by accident
removed in the r186119.

PR: kern/154831
MFC after: 1 week

13 years agoRemove the TCP_SORECEIVE_STREAM compile time option. The use of
Andre Oppermann [Thu, 7 Jul 2011 10:37:14 +0000 (10:37 +0000)]
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

13 years agoAdd an extra tab between fs_file and fs_vfstype
Kevin Lo [Thu, 7 Jul 2011 01:22:50 +0000 (01:22 +0000)]
Add an extra tab between fs_file and fs_vfstype

Reviewed by: nwhitehorn

13 years agoA fix to make the LINT-NOINET build happy, if this
Jack F Vogel [Thu, 7 Jul 2011 00:46:50 +0000 (00:46 +0000)]
A fix to make the LINT-NOINET build happy, if this
works out the ixgbe driver should be changed as well.

13 years agoAll the racct_*() calls need to happen with the proc locked. Fixing this
Edward Tomasz Napierala [Wed, 6 Jul 2011 20:06:44 +0000 (20:06 +0000)]
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".

13 years agoConditionally compile in the IPv4/IPv6 address family support.
Sergey Kandaurov [Wed, 6 Jul 2011 15:18:32 +0000 (15:18 +0000)]
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

13 years agoHandle a race between device_pager and devsw in a more graceful manner:
Attilio Rao [Wed, 6 Jul 2011 15:09:52 +0000 (15:09 +0000)]
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

13 years agoAdd missing unlocks.
Gleb Smirnoff [Wed, 6 Jul 2011 09:43:25 +0000 (09:43 +0000)]
Add missing unlocks.

13 years agoOnly increment the ypcnt once per data record. The old implementation
Gordon Tetlow [Wed, 6 Jul 2011 06:34:08 +0000 (06:34 +0000)]
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

13 years agoUpdate to version 9.6-ESV-R4-P3
Doug Barton [Wed, 6 Jul 2011 00:48:31 +0000 (00:48 +0000)]
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

13 years agoApply bug fixes
Doug Barton [Wed, 6 Jul 2011 00:47:27 +0000 (00:47 +0000)]
Apply bug fixes

Submitted by: marius

13 years agoRemove the IDR_CHEETAH_MAX_BN_PAIRS limit from cheetah_ipi_selected().
Marius Strobl [Tue, 5 Jul 2011 20:05:06 +0000 (20:05 +0000)]
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.

13 years agoVendor import of BIND 9.6-ESV-R4-P3
Doug Barton [Tue, 5 Jul 2011 19:37:48 +0000 (19:37 +0000)]
Vendor import of BIND 9.6-ESV-R4-P3

13 years agoDelete files made obsolete because they were moved to sys/nfs
Rick Macklem [Tue, 5 Jul 2011 19:26:58 +0000 (19:26 +0000)]
Delete files made obsolete because they were moved to sys/nfs
in order to be shared by both NFS clients.

13 years agoIt can be useful to know which page still has mappings.
Marius Strobl [Tue, 5 Jul 2011 18:55:56 +0000 (18:55 +0000)]
It can be useful to know which page still has mappings.

13 years ago- pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c
Marius Strobl [Tue, 5 Jul 2011 18:50:40 +0000 (18:50 +0000)]
- pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c
  so static'ize them.
- Correct a typo.

13 years agoRemove #ifdef notyet code dating back to 4.3BSD Net/2 (and possibly earlier).
Colin Percival [Tue, 5 Jul 2011 18:49:55 +0000 (18:49 +0000)]
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

13 years agoIn pmap_remove_all() assert that the page is neither fictitious nor
Marius Strobl [Tue, 5 Jul 2011 18:46:19 +0000 (18:46 +0000)]
In pmap_remove_all() assert that the page is neither fictitious nor
unmanaged as also done on other architectures.

Reviewed by: alc

13 years agoDon't allow lro->len to exceed 65535, as this will result in overflow
Colin Percival [Tue, 5 Jul 2011 18:43:54 +0000 (18:43 +0000)]
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

13 years agoCorrect cpu_monitor() and cpu_mwait() for amd64. These instructions take
Jung-uk Kim [Tue, 5 Jul 2011 18:42:10 +0000 (18:42 +0000)]
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.

13 years agoCall pmap_qremove() before freeing or unwiring the pages, otherwise
Marius Strobl [Tue, 5 Jul 2011 18:40:37 +0000 (18:40 +0000)]
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

13 years agoDelete files made obsolete by the change in default NFS client
Rick Macklem [Tue, 5 Jul 2011 18:40:19 +0000 (18:40 +0000)]
Delete files made obsolete by the change in default NFS client
and the move of nfs_kdtrace.h to sys/nfs.

13 years agoFollow Linux by unconditionally stripping the RX vlan tag from incoming
Nathan Whitehorn [Tue, 5 Jul 2011 15:00:55 +0000 (15:00 +0000)]
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>

13 years agoUpdate manual page. Mention IPv6 support, and notice that main
Gleb Smirnoff [Tue, 5 Jul 2011 14:55:17 +0000 (14:55 +0000)]
Update manual page. Mention IPv6 support, and notice that main
argument isn't actually a node, but a netgraph path.

13 years agoRewrite the flowctl utility to add it support for displaying
Gleb Smirnoff [Tue, 5 Jul 2011 14:50:06 +0000 (14:50 +0000)]
Rewrite the flowctl utility to add it support for displaying
both IPv4 and IPv4 flows.

13 years agoo Eliminate flow6_hash_entry in favor of flow_hash_entry. We don't need
Gleb Smirnoff [Tue, 5 Jul 2011 14:48:39 +0000 (14:48 +0000)]
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.

13 years agoOnly print entries for which ut_host points to a character device.
Ed Schouten [Tue, 5 Jul 2011 14:12:48 +0000 (14:12 +0000)]
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.

13 years agoRework _fget to accept capability parameters.
Jonathan Anderson [Tue, 5 Jul 2011 13:45:10 +0000 (13:45 +0000)]
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

13 years agoRemove useless initialization.
Mikolaj Golub [Tue, 5 Jul 2011 06:12:28 +0000 (06:12 +0000)]
Remove useless initialization.

Approved by: pjd (mentor)
MFC after: 3 days

13 years agoThe algorithm used by nfscl_getopen() could have resulted in
Rick Macklem [Mon, 4 Jul 2011 23:32:09 +0000 (23:32 +0000)]
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

13 years ago- General grammar and mdoc(7) fixes. [1] [2]
Glen Barber [Mon, 4 Jul 2011 23:00:26 +0000 (23:00 +0000)]
- 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

13 years ago - Speed up pendingblock processing again. Having too much delay between
Jeff Roberson [Mon, 4 Jul 2011 22:08:04 +0000 (22:08 +0000)]
 - Speed up pendingblock processing again.  Having too much delay between
   ffs_blkfree() and the pending adjustment causes all kinds of
   space related problems.

13 years ago - Handle D_JSEGDEP in the softdep_sync_buf() switch. These can now
Jeff Roberson [Mon, 4 Jul 2011 21:04:25 +0000 (21:04 +0000)]
 - Handle D_JSEGDEP in the softdep_sync_buf() switch.  These can now
   find themselves on snapshot vnodes.

Reported by: pho

13 years ago - It is impossible to run request_cleanup() while doing a copyonwrite.
Jeff Roberson [Mon, 4 Jul 2011 20:53:55 +0000 (20:53 +0000)]
 - 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

13 years ago - Fix an inode quota leak. We need to decrement the quota once and only
Jeff Roberson [Mon, 4 Jul 2011 20:52:23 +0000 (20:52 +0000)]
 - Fix an inode quota leak.  We need to decrement the quota once and only
   once.

Tested by: pho
Reviewed by: mckusick

13 years agoFix build with NETGRAPH_DEBUG.
Gleb Smirnoff [Mon, 4 Jul 2011 20:50:09 +0000 (20:50 +0000)]
Fix build with NETGRAPH_DEBUG.

13 years agopf(4) tags now store the state key but tcp_respond tries to reuse a mbuf as an optimi...
Ermal Luçi [Mon, 4 Jul 2011 17:43:04 +0000 (17:43 +0000)]
pf(4) tags now store the state key but tcp_respond tries to reuse a mbuf as an optimization.
This makes pf find the wrong state and cause errors reported with state mismatches.
Clear the cached state link on the pf(4) tag to avoid the state mismatches.

Approved by: bz

13 years agoAdd a trivial script for creating memstick images. These are not
Marcel Moolenaar [Mon, 4 Jul 2011 17:03:19 +0000 (17:03 +0000)]
Add a trivial script for creating memstick images. These are not
bootable yet, but proven to be useful without it already.

13 years agoDisable PREEMPTION for now. See also PR ia64/147501.
Marcel Moolenaar [Mon, 4 Jul 2011 16:59:26 +0000 (16:59 +0000)]
Disable PREEMPTION for now. See also PR ia64/147501.

13 years agoAdd kernel functions to unwrap capabilities.
Jonathan Anderson [Mon, 4 Jul 2011 14:40:32 +0000 (14:40 +0000)]
Add kernel functions to unwrap capabilities.

cap_funwrap() and cap_funwrap_mmap() unwrap capabilities, exposing the
underlying object. Attempting to unwrap a capability with an inadequate
rights mask (e.g. calling cap_funwrap(fp, CAP_WRITE | CAP_MMAP, &result)
on a capability whose rights mask is CAP_READ | CAP_MMAP) will result in
ENOTCAPABLE.

Unwrapping a non-capability is effectively a no-op.

These functions will be used by Capsicum-aware versions of _fget(), etc.

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc

13 years agoFix build with NETGRAPH_DEBUG.
Gleb Smirnoff [Mon, 4 Jul 2011 13:55:55 +0000 (13:55 +0000)]
Fix build with NETGRAPH_DEBUG.

13 years ago- Remove the now unused CPU_NAND_ATOMIC()
Attilio Rao [Mon, 4 Jul 2011 12:18:12 +0000 (12:18 +0000)]
- Remove the now unused CPU_NAND_ATOMIC()
- Add a comment explaining that CPU_OR_ATOMIC() and
  CPU_COPY_STORE_REL() are special wrappers used to cater particular
  cases.

13 years agoWith retirement of cpumask_t and usage of cpuset_t for representing a
Attilio Rao [Mon, 4 Jul 2011 12:04:52 +0000 (12:04 +0000)]
With retirement of cpumask_t and usage of cpuset_t for representing a
mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient.

Remove them and replace their usage with custom pc_cpuid magic (as,
atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and
pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))).

This change is not targeted for MFC because of struct pcpu members
removal and dependency by cpumask_t retirement.

MD review by: marcel, marius, alc
Tested by: pluknet
MD testing by: marcel, marius, gonzo, andreast