]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoFix build breakage. Initialize error variables explicitely for !MAC case.
Konstantin Belousov [Wed, 17 Aug 2011 12:37:14 +0000 (12:37 +0000)]
Fix build breakage. Initialize error variables explicitely for !MAC case.

Pointy hat to: kib
Approved by: re (bz)

13 years agoAlways check current HPET counter value after comparator programming to
Alexander Motin [Tue, 16 Aug 2011 21:51:29 +0000 (21:51 +0000)]
Always check current HPET counter value after comparator programming to
avoid lost timer interrupts. Previous optimization attempt doing it only
for intervals less then 5000 ticks (~300us) reported to be unreliable by
some people. Probably because of some heavy SMI code on their boards.
Introduce additional safety interval of 128 counter ticks (~9us) between
programmed comparator and counter values to cover different cases of
delayed write found on some chipsets.

Approved by: re (kib)

13 years agoFix the handling of [gs]etsockopt() unconnected 1-to-1 style sockets.
Michael Tuexen [Tue, 16 Aug 2011 21:04:18 +0000 (21:04 +0000)]
Fix the handling of [gs]etsockopt() unconnected 1-to-1 style sockets.
While there:
* Fix a locking issue in setsockopt() of SCTP_CMT_ON_OFF.
* Fix a bug in setsockopt() of SCTP_DEFAULT_PRINFO, where the pr_value
  was ignored.

Approved by: re@
MFC after: 2 months.

13 years agoUpdate LibUSB v1.0 manual page:
Hans Petter Selasky [Tue, 16 Aug 2011 21:04:04 +0000 (21:04 +0000)]
Update LibUSB v1.0 manual page:
 - fix some minor spelling
 - fix some style
 - add description of new function

MFC after: 1 week
Approved by: re (kib)

13 years agoDo not return success and a string "unknown" when vn_fullpath() was unable
Konstantin Belousov [Tue, 16 Aug 2011 20:13:17 +0000 (20:13 +0000)]
Do not return success and a string "unknown" when vn_fullpath() was unable
to resolve the path of the text vnode of the process. The behaviour is
very confusing for any consumer of the procfs, in particular, java.

Reported and tested by: bf
MFC after: 2 weeks
Approved by: re (bz)

13 years agoAdd the fo_chown and fo_chmod methods to struct fileops and use them
Konstantin Belousov [Tue, 16 Aug 2011 20:07:47 +0000 (20:07 +0000)]
Add the fo_chown and fo_chmod methods to struct fileops and use them
to implement fchown(2) and fchmod(2) support for several file types
that previously lacked it. Add MAC entries for chown/chmod done on
posix shared memory and (old) in-kernel posix semaphores.

Based on the submission by: glebius
Reviewed by: rwatson
Approved by: re (bz)

13 years agoFix a merge conflict.
Jonathan Anderson [Tue, 16 Aug 2011 14:23:16 +0000 (14:23 +0000)]
Fix a merge conflict.

r224086 added "goto out"-style error handling to nfssvc_nfsd(), in order
to reliably call NFSEXITCODE() before returning. Our Capsicum changes,
based on the old "return (error)" model, did not merge nicely.

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

13 years agopoll(2) implementation for capabilities.
Jonathan Anderson [Tue, 16 Aug 2011 14:14:56 +0000 (14:14 +0000)]
poll(2) implementation for capabilities.

When calling poll(2) on a capability, unwrap first and then poll the
underlying object.

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

13 years agoFix BAR frame TX completion - successful transmission is indicated
Adrian Chadd [Tue, 16 Aug 2011 09:07:59 +0000 (09:07 +0000)]
Fix BAR frame TX completion - successful transmission is indicated
by a status of 0.

Approved by: re (kib)

13 years agoUpdate arcmsr(4) to 1.20.00.22 to solve recursive acquisition of buffer
Xin LI [Tue, 16 Aug 2011 08:41:37 +0000 (08:41 +0000)]
Update arcmsr(4) to 1.20.00.22 to solve recursive acquisition of buffer
mutex, which would lead to a deadlock.

Many thanks to Areca for their continued support of FreeBSD.

Submitted by: Ching Huang <ching2048 areca com tw>
Tested by: Willem Jan Withagen <wjw digiware nl>
MFC after: 3 days
Approved by: re (kib)

13 years agoAdd missing function to get device speed to the LibUSB v1.0 API.
Hans Petter Selasky [Tue, 16 Aug 2011 08:34:16 +0000 (08:34 +0000)]
Add missing function to get device speed to the LibUSB v1.0 API.

MFC after: 1 week
Approved by: re (kib)

13 years agoAdd device id for the Moxa CP-112UL dual-port serial adapters.
John Baldwin [Mon, 15 Aug 2011 19:29:25 +0000 (19:29 +0000)]
Add device id for the Moxa CP-112UL dual-port serial adapters.

Submitted by: Jan Mikkelsen  janm of transactionware com
Approved by: re (kib)
MFC after: 1 week

13 years agoFix a couple of issues in last commit.
Gleb Smirnoff [Mon, 15 Aug 2011 13:33:28 +0000 (13:33 +0000)]
Fix a couple of issues in last commit.

Submitted by: maxim
Approved by: re (kib)

13 years agoUse a maximum of -O on PowerPC kernels instead of -O2 to prevent a rare
Nathan Whitehorn [Mon, 15 Aug 2011 13:33:14 +0000 (13:33 +0000)]
Use a maximum of -O on PowerPC kernels instead of -O2 to prevent a rare
bug that could cause intermittent memory corruption on PowerPC SMP
systems using non-debug kernels. This is a temporary change until the
real problem is fixed.

Approved by: re (kib)

13 years agoDescribe how carp(4) status changes can be processed with
Gleb Smirnoff [Mon, 15 Aug 2011 12:08:41 +0000 (12:08 +0000)]
Describe how carp(4) status changes can be processed with
help of devd(8).

Submitted by: "Alexander V. Chernikov" <melifaro ipfw.ru>
Approved by: re (kib)

13 years agoFix two cases involving opt_capsicum.h and module builds:
Robert Watson [Mon, 15 Aug 2011 07:32:44 +0000 (07:32 +0000)]
Fix two cases involving opt_capsicum.h and module builds:

(1) opt_capsicum.h is no longer required in ffs_alloc.c, so remove the
   #include.

(2) portalfs depends on opt_capsicum.h, so have the Makefile generate one
   if required.

These affect only modules built without a kernel (i.e, not buildkernel,
but yes buildworld if the dubious MODULES_WITH_WORLD is used).

Approved by: re (bz)
Sponsored by: Google Inc

13 years agoBump __FreeBSD_version to reflect the availability of capabilities, but
Robert Watson [Mon, 15 Aug 2011 07:30:48 +0000 (07:30 +0000)]
Bump __FreeBSD_version to reflect the availability of capabilities, but
also capability-related changes to fget(9).  This is likely not part of
a formal KPI, but the nvidia driver (at least) uses it.

Mention /dev/{stdin,stdout,stderr} breakage that appears in certain
kernel revisions as best avoided!

Approved by:  re (xxx)

13 years agoAdd support for the spp_dscp field in the SCTP_PEER_ADDR_PARAMS
Michael Tuexen [Sun, 14 Aug 2011 20:55:32 +0000 (20:55 +0000)]
Add support for the spp_dscp field in the SCTP_PEER_ADDR_PARAMS
socket option. Backwards compatibility is provided by still
supporting the spp_ipv4_tos field.

Approved by: re@
MFC after: 2 months.

13 years agoFix integer overflow on 32bit systems when calculating media size,
Alexander Motin [Sun, 14 Aug 2011 16:17:00 +0000 (16:17 +0000)]
Fix integer overflow on 32bit systems when calculating media size,
reintroduced by r222475.

Approved by: re (kib)

13 years agoProvide a kboot.conf to allow powerpc64 install media to be booted on
Nathan Whitehorn [Sun, 14 Aug 2011 14:36:32 +0000 (14:36 +0000)]
Provide a kboot.conf to allow powerpc64 install media to be booted on
Playstation 3 consoles running kboot or petitboot.

Approved by: re (bz)

13 years agotail: Fix crash if -F'ed file's filesystem disappears.
Jilles Tjoelker [Sun, 14 Aug 2011 13:37:38 +0000 (13:37 +0000)]
tail: Fix crash if -F'ed file's filesystem disappears.

If tail notices that a file it is following no longer exists (because stat()
fails), it will output any final lines and then close the file. If the read
operation also causes an error, such as when the filesystem is forcefully
unmounted, it closes the file as well, leading to fclose(NULL) and a
segmentation fault.

PR: bin/159750
Submitted by: swills
Approved by: re (kib)
MFC after: 1 week

13 years agoCross-reference cap_new(2) from dup(2), as they have similar functionality.
Robert Watson [Sun, 14 Aug 2011 12:41:44 +0000 (12:41 +0000)]
Cross-reference cap_new(2) from dup(2), as they have similar functionality.

Approved by: re (kib)

13 years agoUpdates to libprocstat(3) and procstat(1) to allow monitoring Capsicum
Robert Watson [Sun, 14 Aug 2011 00:42:09 +0000 (00:42 +0000)]
Updates to libprocstat(3) and procstat(1) to allow monitoring Capsicum
capability mode and capabilities.

Right now no attempt is made to unwrap capabilities when operating on
a crashdump, so further refinement is required.

Approved by: re (bz)
Sponsored by: Google Inc

13 years agoAdd support for the Blu-Ray drive found in the Sony Playstation 3 and fix
Nathan Whitehorn [Sun, 14 Aug 2011 00:20:37 +0000 (00:20 +0000)]
Add support for the Blu-Ray drive found in the Sony Playstation 3 and fix
some realted minor bugs in PS3 internal storage support.

Submitted by: glevand <geoffrey.levand@mail.ru>
Approved by: re (bz)

13 years agoMost of these changes to isp are to allow for isp.ko unloading.
Matt Jacob [Sat, 13 Aug 2011 23:34:17 +0000 (23:34 +0000)]
Most of these changes to isp are to allow for isp.ko unloading.
We also revive loop down freezes. We also externaliz within isp
isp_prt_endcmd so something outside the core module can print
something about a command completing. Also some work in progress to
assist in handling timed out commands better.

Partially Sponsored by: Panasas
Approved by: re (kib)
MFC after: 1 month

13 years agozfs_ioctl.c: improve code readability in zfs_ioc_dataset_list_next()
Martin Matuska [Sat, 13 Aug 2011 21:35:22 +0000 (21:35 +0000)]
zfs_ioctl.c: improve code readability in zfs_ioc_dataset_list_next()

zvol.c: fix calling of dmu_objset_prefetch() in zvol_create_minors()
by passing full instead of relative dataset name and prefetching all
visible datasets to be processed later instead of just the pool name

Reviewed by: pjd
Approved by: re (kib)
MFC after: 1 week
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    opensolaris/uts/common/fs/zfs/zfs_ioctl.c
M    opensolaris/uts/common/fs/zfs/zvol.c

13 years agoTrim some warnings and notes from capabilities.conf -- these are left over
Robert Watson [Sat, 13 Aug 2011 17:22:16 +0000 (17:22 +0000)]
Trim some warnings and notes from capabilities.conf -- these are left over
from Capsicum development, and no longer apply.

Approved by: re (kib)
Sponsored by: Google Inc

13 years agoFix a typo in cb_dumpdata() about wrongly calling wdog_kern_pat().
Attilio Rao [Sat, 13 Aug 2011 17:17:04 +0000 (17:17 +0000)]
Fix a typo in cb_dumpdata() about wrongly calling wdog_kern_pat().

Submitted by: Andrew Boyer <aboyer at averesystems dot com>
Approved by: re (kib)

13 years agoWhen falloc() was broken into separate falloc_noinstall() and finstall(),
Robert Watson [Sat, 13 Aug 2011 16:03:40 +0000 (16:03 +0000)]
When falloc() was broken into separate falloc_noinstall() and finstall(),
a bug was introduced in kern_openat() such that the error from the vnode
open operation was overwritten before it was passed as an argument to
dupfdopen().  This broke operations on /dev/{stdin,stdout,stderr}.  Fix
by preserving the original error number across finstall() so that it is
still available.

Approved by: re (kib)
Reported by: cognet

13 years agoFix jls backward compat mode broken in r222465, correctly
Bjoern A. Zeeb [Sat, 13 Aug 2011 13:49:11 +0000 (13:49 +0000)]
Fix jls backward compat mode broken in r222465, correctly
displaying addresses in verbose mode (jls -v) again.

Submitted by: jamie
MFC after: 3 days
Approved by: re (kib)

13 years agoUpdate use of the FEATURE() macro in sys_capability.c to reflect the move
Robert Watson [Sat, 13 Aug 2011 13:34:01 +0000 (13:34 +0000)]
Update use of the FEATURE() macro in sys_capability.c to reflect the move
to two different kernel options for capability mode vs. capabilities.

Approved by: re (bz)

13 years agoNow that capability support has been committed, update and expand the
Robert Watson [Sat, 13 Aug 2011 13:26:40 +0000 (13:26 +0000)]
Now that capability support has been committed, update and expand the
comment at the type of sys_capability.c to describe its new contents.

Approved by:  re (xxx)

13 years agoBump __FreeBSD_version to reflect the availability of capabilities, but
Robert Watson [Sat, 13 Aug 2011 13:11:28 +0000 (13:11 +0000)]
Bump __FreeBSD_version to reflect the availability of capabilities, but
also capability-related changes to fget(9).  This is likely not part of
a formal KPI, but the nvidia driver (at least) uses it.

Approved by:    re (bz, kib)

13 years agoRegenerate system call files following r224812 changes to capabilities.conf.
Robert Watson [Sat, 13 Aug 2011 12:14:40 +0000 (12:14 +0000)]
Regenerate system call files following r224812 changes to capabilities.conf.
A no-op for non-Capsicum kernels; for Capsicum kernels, completes the
enabling of fooat(2) system calls using capabilities.  With this change,
and subject to bug fixes, Capsicum capability support is now complete for
9.0.

Approved by:    re (kib)
Submitted by:   jonathan
Sponsored by:   Google Inc

13 years agoFix race between dmu_objset_prefetch() invoked from
Martin Matuska [Sat, 13 Aug 2011 10:58:53 +0000 (10:58 +0000)]
Fix race between dmu_objset_prefetch() invoked from
zfs_ioc_dataset_list_next() and dsl_dir_destroy_check() indirectly
invoked from dmu_recv_existing_end() via dsl_dataset_destroy() by not
prefetching temporary clones, as these count as always inconsistent.
In addition, do not prefetch hidden datasets at all as we are not
going to process these later.

Filed as Illumos Bug #1346

PR: kern/157728
Tested by: Borja Marcos <borjam@sarenet.es>, mm
Reviewed by: pjd
Approved by: re (kib)
MFC after: 1 week

13 years agoAllow openat(2), fstatat(2), etc. in capability mode.
Jonathan Anderson [Sat, 13 Aug 2011 10:43:21 +0000 (10:43 +0000)]
Allow openat(2), fstatat(2), etc. in capability mode.

namei() and lookup() can now perform "strictly relative" lookups.
Such lookups, performed when in capability mode or when looking up
relative to a directory capability, enforce two policies:
 - absolute paths are disallowed (including symlinks to absolute paths)
 - paths containing '..' components are disallowed

These constraints make it safe to enable openat() and friends.
These system calls are instrumental in supporting Capsicum
components such as the capability-mode-aware runtime linker.

Finally, adjust comments in capabilities.conf to reflect the actual state
of the world (e.g. shm_open(2) already has the appropriate constraints,
getdents(2) already requires CAP_SEEK).

Approved by: re (bz), mentor (rwatson)
Sponsored by: Google Inc.

13 years agoAllow Capsicum capabilities to delegate constrained
Jonathan Anderson [Sat, 13 Aug 2011 09:21:16 +0000 (09:21 +0000)]
Allow Capsicum capabilities to delegate constrained
access to file system subtrees to sandboxed processes.

- Use of absolute paths and '..' are limited in capability mode.
- Use of absolute paths and '..' are limited when looking up relative
  to a capability.
- When a name lookup is performed, identify what operation is to be
  performed (such as CAP_MKDIR) as well as check for CAP_LOOKUP.

With these constraints, openat() and friends are now safe in capability
mode, and can then be used by code such as the capability-mode runtime
linker.

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

13 years agoFixes for sure bus reference miscounting and potential device and
Matt Jacob [Fri, 12 Aug 2011 20:09:38 +0000 (20:09 +0000)]
Fixes for sure bus reference miscounting and potential device and
target reference miscounts.  It also adds a helper function to get
the current reference counts for components of cam_path for debug
aid.  One minor style(9) change.

Partially Obtained from: Chuck Tuffli (Emulex)
Reviewed by: scsi@ (ken)
Approved by: re (kib)
MFC after: 1 month

13 years agoFixes zombie device and loop down timers so that they work more than
Matt Jacob [Fri, 12 Aug 2011 19:51:28 +0000 (19:51 +0000)]
Fixes zombie device and loop down timers so that they work more than
once. Use taskqueues to do the actual work.

Fix an offset line.

Fix isp_prt so that prints from just one buffer, which makes it
appear cleanly cleanly in logs on SMP systems.

Approved by: re (kib)
MFC after: 1 month

13 years agoRename CAP_*_KEVENT to CAP_*_EVENT.
Jonathan Anderson [Fri, 12 Aug 2011 14:26:47 +0000 (14:26 +0000)]
Rename CAP_*_KEVENT to CAP_*_EVENT.

Change the names of a couple of capability rights to be less
FreeBSD-specific.

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

13 years agoReorder and renumber capability rights.
Jonathan Anderson [Fri, 12 Aug 2011 11:43:56 +0000 (11:43 +0000)]
Reorder and renumber capability rights.

This patch does three things:
 - puts capability rights in a more pleasing declaration order
 - changes mask values to match the new declaration order
 - declare new rights which will be used soon (e.g. CAP_LOOKUP, CAP_MKDIR)

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

13 years agoTest *at(2) calls with capability-mode lookup.
Jonathan Anderson [Fri, 12 Aug 2011 10:52:46 +0000 (10:52 +0000)]
Test *at(2) calls with capability-mode lookup.

This commit adds regression testing for openat(), fstatat(), etc. with
capability scoping ("strict relative" lookup), which applies:
 - in capability mode
 - when performing any *at() lookup relative to a capability

These tests will fail until the *at() code is committed; on my local
instance, with the *at() changes, they all pass.

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

13 years agoEliminate the zfsdev_state_lock entirely and replace it with the
Pawel Jakub Dawidek [Fri, 12 Aug 2011 07:04:16 +0000 (07:04 +0000)]
Eliminate the zfsdev_state_lock entirely and replace it with the
spa_namespace_lock. This fixes LOR between the spa_namespace_lock and
spa_config lock. LOR can cause deadlock on vdevs removal/insertion.

Reported by: gibbs, delphij
Tested by: delphij
Approved by: re (kib)
MFC after: 1 week

13 years agoUse the right printf() format string without a cast to maxint_t.
Jonathan Anderson [Thu, 11 Aug 2011 15:52:06 +0000 (15:52 +0000)]
Use the right printf() format string without a cast to maxint_t.

As per kib's suggestion, we also change test_count from a size_t to an int;
its value at the moment is 4, and we only expect it to go up to 7.

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

13 years agoOnly call fdclose() on successfully-opened FDs.
Jonathan Anderson [Thu, 11 Aug 2011 13:29:59 +0000 (13:29 +0000)]
Only call fdclose() on successfully-opened FDs.

Since kern_openat() now uses falloc_noinstall() and finstall() separately,
there are cases where we could get to cleanup code without ever creating
a file descriptor. In those cases, we should not call fdclose() on FD -1.

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

13 years agoAllow to build a release for stable/[78] on a current box and vise versa.
Yoshihiro Takahashi [Thu, 11 Aug 2011 13:15:11 +0000 (13:15 +0000)]
Allow to build a release for stable/[78] on a current box and vise versa.

Approved by: re (hrs)
MFC after: 1 week

13 years agoFix building a release with old release scheme. This catches up with
Yoshihiro Takahashi [Thu, 11 Aug 2011 13:13:08 +0000 (13:13 +0000)]
Fix building a release with old release scheme.  This catches up with
renaming from Makefile to Makefile.sysinstall.

Approved by: re (hrs)

13 years agoSecond-to-last commit implementing Capsicum capabilities in the FreeBSD
Robert Watson [Thu, 11 Aug 2011 12:30:23 +0000 (12:30 +0000)]
Second-to-last commit implementing Capsicum capabilities in the FreeBSD
kernel for FreeBSD 9.0:

Add a new capability mask argument to fget(9) and friends, allowing system
call code to declare what capabilities are required when an integer file
descriptor is converted into an in-kernel struct file *.  With options
CAPABILITIES compiled into the kernel, this enforces capability
protection; without, this change is effectively a no-op.

Some cases require special handling, such as mmap(2), which must preserve
information about the maximum rights at the time of mapping in the memory
map so that they can later be enforced in mprotect(2) -- this is done by
narrowing the rights in the existing max_protection field used for similar
purposes with file permissions.

In namei(9), we assert that the code is not reached from within capability
mode, as we're not yet ready to enforce namespace capabilities there.
This will follow in a later commit.

Update two capability names: CAP_EVENT and CAP_KEVENT become
CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they
represent.

Approved by: re (bz)
Submitted by: jonathan
Sponsored by: Google Inc

13 years agoUse synchronous device destruction instead of asynchronous, so that a new
Hans Petter Selasky [Thu, 11 Aug 2011 11:30:21 +0000 (11:30 +0000)]
Use synchronous device destruction instead of asynchronous, so that a new
device having the same name like a previous one is not created before the old
one is gone. This fixes some panics due to asserts in the devfs code which
were added recently.

Approved by:    re (kib)
MFC after:      1 week

13 years ago- Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk.
Ruslan Ermilov [Thu, 11 Aug 2011 10:29:10 +0000 (10:29 +0000)]
- Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk.
- Provide a build aid for those who already have a buggy awk(1) installed.

Approved by: re (kib)

13 years agoCorrected description of the bugfix; distfile was updated.
Ruslan Ermilov [Thu, 11 Aug 2011 10:24:09 +0000 (10:24 +0000)]
Corrected description of the bugfix; distfile was updated.

13 years agoVendor import of bwk's 10-Aug-2011 release.
Ruslan Ermilov [Thu, 11 Aug 2011 04:58:20 +0000 (04:58 +0000)]
Vendor import of bwk's 10-Aug-2011 release.

13 years agoMove cxgbtool from usr.sbin to tools/tools.
Navdeep Parhar [Wed, 10 Aug 2011 22:03:34 +0000 (22:03 +0000)]
Move cxgbtool from usr.sbin to tools/tools.

Approved by: re (kib)
MFC after: 1 month

13 years agoRevert r224760, and enhance the sed patterns from r224659 to comment out
Doug Barton [Wed, 10 Aug 2011 20:52:02 +0000 (20:52 +0000)]
Revert r224760, and enhance the sed patterns from r224659 to comment out
the _compat entries in the WITHOUT_NIS case rather then delete them.

Approved by: re (kib)

13 years agoSync makefs(8) ISO 9660 support with NetBSD:
Marius Strobl [Wed, 10 Aug 2011 19:12:21 +0000 (19:12 +0000)]
Sync makefs(8) ISO 9660 support with NetBSD:
o cd9960 -> cd9660
o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h
  since actual user is not cd9660_eltorito.c but iso.h and
  cd9660_eltorito.h.

  Actually, include order/place of sys/endian.h doesn't matter on
  netbsd since it is always included by sys/types.h but it's not
  true on other system.  This should fix cross build breakage on
  freebsd introduced by rev. 1.16 of cd9660_eltorito.c.
  Problem reported and fix suggested on twitter.
o Fix fd leaks in error cases. Found by cppcheck.
o RRIP RE length should be 4, not 0
o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates
  corrupted cd9660fs), iso9660_rrip.c part:
  - cd9660_rrip_finalize_node() should check rr_real_parent in node->parent,
    not in node itself in RRIP_PL case
  - cd9660_rrip_initialize_node() should update only node passed as arg
    so handle RRIP_PL in DOTDOT case

  Fixes malformed dotdot entries in deep (more than 8 level) directories
  moved into .rr_moved dir.

  Should be pulled up to netbsd-5.
  (no official ISO has such deep dirs, but cobalt restorecd is affected)

Reviewed by: mm
Approved by: re (kib)
Obtained from: NetBSD
MFC after: 3 days

13 years agoo Improve 224494:
Marius Strobl [Wed, 10 Aug 2011 19:05:22 +0000 (19:05 +0000)]
o Improve 224494:
  - Ignore some more internal SAS device status change events.
  - Correct inverted Bus and TargetID arguments in a warning.
o Add a warning for MPI_EVENT_SAS_DISCOVERY_ERROR events, which can help
  identifying broken disks.

Submitted by: Andrew Boyer
Approved by: re (kib)
Committed from: Chaos Communication Camp 2011

13 years ago- Remove myself from ncurses maintainer due to ENOTIME
Rong-En Fan [Wed, 10 Aug 2011 15:49:24 +0000 (15:49 +0000)]
- Remove myself from ncurses maintainer due to ENOTIME

Approved by: re (kib@)

13 years agoIf RTF_HOST flag is specified, then we are interested in destination
Kevin Lo [Wed, 10 Aug 2011 06:17:06 +0000 (06:17 +0000)]
If RTF_HOST flag is specified, then we are interested in destination
address.

PR: kern/159600
Submitted by: Svatopluk Kraus <onwahe at gmail dot com>
Approved by: re (hrs)

13 years ago- Move the PG_UNMANAGED flag from m->flags to m->oflags, renaming the flag
Konstantin Belousov [Tue, 9 Aug 2011 21:01:36 +0000 (21:01 +0000)]
- Move the PG_UNMANAGED flag from m->flags to m->oflags, renaming the flag
  to VPO_UNMANAGED (and also making the flag protected by the vm object
  lock, instead of vm page queue lock).
- Mark the fake pages with both PG_FICTITIOUS (as it is now) and
  VPO_UNMANAGED. As a consequence, pmap code now can use use just
  VPO_UNMANAGED to decide whether the page is unmanaged.

Reviewed by: alc
Tested by: pho (x86, previous version), marius (sparc64),
    marcel (arm, ia64, powerpc), ray (mips)
Sponsored by: The FreeBSD Foundation
Approved by: re (bz)

13 years agoRevert r224736 as the introduced value was already present.
Attilio Rao [Tue, 9 Aug 2011 20:55:54 +0000 (20:55 +0000)]
Revert r224736 as the introduced value was already present.

Reported by: tinderbox, pluknet
Approved by: re (kib)

13 years agoDo not update mountpoint generation counter to the value which was not
Konstantin Belousov [Tue, 9 Aug 2011 20:53:33 +0000 (20:53 +0000)]
Do not update mountpoint generation counter to the value which was not
yet acted upon by devfs_populate().

Submitted by: Kohji Okuno <okuno.kohji jp panasonic com>
Approved by: re (bz)
MFC after: 1 week

13 years agoAdd the PCI ID for the PCH DH89xxCC on ichsmb as got from Linux counterpart.
Attilio Rao [Tue, 9 Aug 2011 16:42:31 +0000 (16:42 +0000)]
Add the PCI ID for the PCH DH89xxCC on ichsmb as got from Linux counterpart.

Sponsored by: Sandvine Incorporated
Reviewed by: emaste, rstone
Approved by: re (bz)
MFC after: 3 days

13 years agoRemove the now unneeded references to these DFS methods.
Adrian Chadd [Tue, 9 Aug 2011 15:46:52 +0000 (15:46 +0000)]
Remove the now unneeded references to these DFS methods.

Sorry for the noise everyone.

Approved by: re (kib, blanket)

13 years agoMerge 220876, 220877, and 221537 from the new NFS client to the old:
John Baldwin [Tue, 9 Aug 2011 15:29:58 +0000 (15:29 +0000)]
Merge 220876, 220877, and 221537 from the new NFS client to the old:
Allow the NFS client to use a max file size larger than 1TB for v3 mounts.
It now allows files up to OFF_MAX subject to whatever limit the server
advertises.

Reviewed by: rmacklem
Approved by: re (kib)
MFC after: 1 week

13 years agoRemove timeval2timespec and its converse, since we already have
Jonathan Anderson [Tue, 9 Aug 2011 14:06:50 +0000 (14:06 +0000)]
Remove timeval2timespec and its converse, since we already have
TIMEVAL_TO_TIMESPEC() in <sys/timespec.h>.

Spotted by: bde
Approved by: re (kib), mentor (rwatson)

13 years agoUpdate to a 7-Aug-2011 release.
Ruslan Ermilov [Tue, 9 Aug 2011 12:54:43 +0000 (12:54 +0000)]
Update to a 7-Aug-2011 release.

Approved by: re (kib)

13 years agoVendor import of bwk's 7-Aug-2011 release.
Ruslan Ermilov [Tue, 9 Aug 2011 12:23:27 +0000 (12:23 +0000)]
Vendor import of bwk's 7-Aug-2011 release.

13 years agoDo not block zero report ID. It is correct value for devices with single
Alexander Motin [Tue, 9 Aug 2011 08:11:26 +0000 (08:11 +0000)]
Do not block zero report ID. It is correct value for devices with single
ID. This fixes USB_SET_IMMED call (synchronous operation) of the uhid(4)
driver on devices with single report ID.

Reviewed by: hselasky
Approved by: re (kib)
MFC after: 1 week

13 years agoMake clear that the -U option can be dangerous. [1]
Doug Barton [Tue, 9 Aug 2011 07:42:19 +0000 (07:42 +0000)]
Make clear that the -U option can be dangerous. [1]

In -p mode install the group file with the same permissions as normally
done in etc/Makefile.

Update the copyright.

Requested by: peter [1]

Approved by: re (kib)

13 years agoRemove this call, now that I've solved the radar module problem without
Adrian Chadd [Tue, 9 Aug 2011 04:24:56 +0000 (04:24 +0000)]
Remove this call, now that I've solved the radar module problem without
needing this particular modification.

It can be called during ath_dfs_radar_enable() and still achieve the
same functionality, so I am.

Approved by: re (kib, blanket)

13 years agoFix buffer overflow in sys/boot/common/util.c's printf(), when printing
Dimitry Andric [Mon, 8 Aug 2011 20:53:04 +0000 (20:53 +0000)]
Fix buffer overflow in sys/boot/common/util.c's printf(), when printing
large (>= 10^10) numbers.  In theory, 20 characaters should be enough,
but bump the buffer to 32 characters, so we have some room for the
future.

Reviewed by: pjd
Approved by: re (kib)

13 years agoCreate timeval2timespec() and timespec2timeval().
Jonathan Anderson [Mon, 8 Aug 2011 20:36:52 +0000 (20:36 +0000)]
Create timeval2timespec() and timespec2timeval().

These functions will be used by process descriptors to convert process
creation time into process descriptor [acm]time.

Approved by: re (kib), mentor (rwatson)
Suggested by: jhb
Sponsored by: Google Inc

13 years agoAnd add another missing brace. Another pointy hat moment.
Adrian Chadd [Mon, 8 Aug 2011 19:03:26 +0000 (19:03 +0000)]
And add another missing brace. Another pointy hat moment.
This one however isn't used by any public code yet, so it
didn't break the build.

Approved by: re (kib, blanket)

13 years agoBitten again by the optional HALDEBUG compilation.
Adrian Chadd [Mon, 8 Aug 2011 18:05:22 +0000 (18:05 +0000)]
Bitten again by the optional HALDEBUG compilation.

Remove this debugging, it's not needed anymore and when not enabled,
those variables trigger a compiler warning.

Approved by: re (kib, blanket)
Pointy-hat-to: adrian, for not testing a non-debug compile of this code enough

13 years agoThe older HAL code sets up the regulatory domain once; FreeBSD/net80211
Adrian Chadd [Mon, 8 Aug 2011 17:33:35 +0000 (17:33 +0000)]
The older HAL code sets up the regulatory domain once; FreeBSD/net80211
allows it to be overridden at runtime.

Thus, add a function which updates ah_dfsDomain after a channel set
call to ath_hal_set_channels().

Approved by: re (kib, blanket)

13 years agoWhen setting a fixed channel on adapters with 11n support the scan
Bernhard Schmidt [Mon, 8 Aug 2011 16:29:07 +0000 (16:29 +0000)]
When setting a fixed channel on adapters with 11n support the scan
channel list ends up with 2 entries, the HT and the legacy channel.
The scan itself is currently always done at legacy rates so we end
up receiving scan results for legacy networks on the HT channel and
erroneously assigning the BSS to the 11n channel. As the channel's
capabilities are used to setup the adapter we might end up with
non-working settings and/or firmware crashes.

Fix this by ensuring that scan results received on a HT channel
are only assigned to that channel if the htcap IE is available,
else use the legacy channel equivalent.

Tested by: Pawel Worach, Raoul Megelas, Maciej Milewski,
Andrei <az at azsupport dot com>
Approved by: re (kib)

13 years agoIntroduce some more DFS related hooks, inspired both by local work
Adrian Chadd [Mon, 8 Aug 2011 16:22:42 +0000 (16:22 +0000)]
Introduce some more DFS related hooks, inspired both by local work
and the Atheros reference code.

The radar detection code needs to know what the current DFS domain is.
Since net80211 doesn't currently know this information, it's extracted
from the HAL regulatory domain information.

The specifics:

* add a new ath_dfs API hook, ath_dfs_init_radar_filters(), which
  updates the radar filters whenever the regulatory domain changes.
* add HAL_DFS_DOMAIN which describes the currently configured DFS domain .
* add a new HAL internal variable which tracks the currently configured
  HAL DFS domain.
* add a new HAL capability, HAL_CAP_DFS_DMN, which returns the currently
  configured HAL DFS domain setting.
* update the HAL DFS domain setting whenever the channel setting is
  updated.

Since this isn't currently used by any radar code, these should all
be no-ops for existing users.

Obtained from: Atheros
Submitted by: KBC Networks, sibridge
Approved by: re (kib, blanket)

13 years ago.. and add a missing bracket.
Adrian Chadd [Mon, 8 Aug 2011 15:42:37 +0000 (15:42 +0000)]
.. and add a missing bracket.

Approved by: re (kib, blanket)

13 years agoFix method naming to match the reference HAL definition.
Adrian Chadd [Mon, 8 Aug 2011 15:41:03 +0000 (15:41 +0000)]
Fix method naming to match the reference HAL definition.

Obtained from: Atheros
Approved by: re (kib, blanket)

13 years agoRevert r224655 and r224614 because vn_fullpath* does not always work
Martin Matuska [Mon, 8 Aug 2011 14:02:08 +0000 (14:02 +0000)]
Revert r224655 and r224614 because vn_fullpath* does not always work
on nullfs mounts.

Change shall be reconsidered after 9.0 is released.

Requested by: re (kib)
Approved by: re (kib)

13 years agoAdd another HAL method - ah_isFastClockEnabled - which returns AH_TRUE
Adrian Chadd [Mon, 8 Aug 2011 13:15:39 +0000 (13:15 +0000)]
Add another HAL method - ah_isFastClockEnabled - which returns AH_TRUE
if 5ghz fast clock is enabled in the current operating mode.

It's slightly dirty, but it's part of the reference HAL and used by
the (currently closed-source) radar event code to map radar pulses
back to microsecond durations.

Obtained from: Atheros
Approved by: re (kib, blanket)

13 years agoChange "options NFSCLIENT" to "options NFSCL" in diskless.8,
Rick Macklem [Mon, 8 Aug 2011 13:13:22 +0000 (13:13 +0000)]
Change "options NFSCLIENT" to "options NFSCL" in diskless.8,
since that is now the default NFS client.
This is a content change.

Reported by: shuvaev at physik.uni-wuerzburg.de
Approved by: re (hrs)

13 years agoIn rtinit1(), before rtrequest1_fib() is called, info.rti_flags is
Kevin Lo [Mon, 8 Aug 2011 05:25:51 +0000 (05:25 +0000)]
In rtinit1(), before rtrequest1_fib() is called, info.rti_flags is
initialized by flags (function argument) or-ed with ifa->ifa_flags.
If both NIC has a loopback route to itself, so IFA_RTSELF is set on ifa(s).
As IFA_RTSELF is defined by RTF_HOST, rtrequest1_fib() is called with
RTF_HOST flag even if netmask is not NULL. Consequently, netmask is set
to zero in rtrequest1_fib(), and request to add network route is changed
under hands to request to add host route.

Tested by: Andrew Boyer <aboyer at averesystems.com>
Submitted by: Svatopluk Kraus <onwahe at gmail dot com>
Approved by: re (hrs)

13 years agocatstrg() does not set the resulting string length.
Kevin Lo [Mon, 8 Aug 2011 05:22:09 +0000 (05:22 +0000)]
catstrg() does not set the resulting string length.

PR: bin/152549
Submitted by: Henning Petersen <henning dot petersen at t-online dot de>
Approved by: re (hrs)

13 years agoFix a pathname (s,netinet/if_ether.h,net/ethernet.h,).
Hiroki Sato [Mon, 8 Aug 2011 03:09:03 +0000 (03:09 +0000)]
Fix a pathname (s,netinet/if_ether.h,net/ethernet.h,).

PR: docs/159341
Submitted by: Garrett Cooper
Approved by: re (kib)

13 years agoMerge revision 3554 from libarchive's release/2.8 branch:
Martin Matuska [Sun, 7 Aug 2011 20:24:32 +0000 (20:24 +0000)]
Merge revision 3554 from libarchive's release/2.8 branch:

Partial merge of 2431 from trunk:  Retry writes on EINTR.
This should fix the SIGINT handler in bsdtar.
Note:  The rest of r2431 can't be merged, since it interacts
with a big write-side rearchitecture.

PR: bin/149409
Reviewed by: kientzle
Approved by: re (kib)
MFC after: 3 days

13 years agoChange all the sample kernel configurations to use
Rick Macklem [Sun, 7 Aug 2011 20:16:46 +0000 (20:16 +0000)]
Change all the sample kernel configurations to use
NFSCL, NFSD instead of NFSCLIENT, NFSSERVER since
NFSCL and NFSD are now the defaults. The client change is
needed for diskless configurations, so that the root
mount works for fstype nfs.
Reported by seanbru at yahoo-inc.com for i386/XEN.

Approved by: re (hrs)

13 years agoConvert pmcstat about using cpuset_t rather than relying on plain 32 bit
Attilio Rao [Sun, 7 Aug 2011 18:37:05 +0000 (18:37 +0000)]
Convert pmcstat about using cpuset_t rather than relying on plain 32 bit
ints.  That fixes a first bug where pmcstat wasn't using the old
cpumask_t interface and now also brings the full support for more
than 32 cpus.

While here, make the functions pmcstat_clone_event_descriptor() and
pmcstat_get_cpumask() private to pmcstat.

The problem of assuming cpu dense masks still persists and should be
eventually fixed, as reported by avg.

Tested by: pluknet
Reviewed by: gnn
Approved by: re (kib)

13 years agoChange lwp to int64_t as thr_pread_long() always uses a 64-bit value
Marius Strobl [Sun, 7 Aug 2011 15:52:13 +0000 (15:52 +0000)]
Change lwp to int64_t as thr_pread_long() always uses a 64-bit value
in order to account for LP64 targets when cross-debugging on ILP32,
allowing r224683 to compile on ILP32.
Note that thr_p{read,write}_{long,ptr}() still incorrectly use the size
of the respective types on the host rather than that on the target when
accessing the target address space which still needs to be fixed. This
means that r224683 alone may not be sufficient to solve the problem it's
intended to fix when cross-debugging.

Approved by: re (hrs)

13 years agoAdd compatibility for ISO images created with unfixed makefs that
Martin Matuska [Sun, 7 Aug 2011 08:42:36 +0000 (08:42 +0000)]
Add compatibility for ISO images created with unfixed makefs that
violated ECMA-119 (ISO9660): allow reserved4 to be 0x20 in PVD.
This allows tar to read FreeBSD distribution ISO images created
with makefs prior to NetBSD bin/45217 bugfix (up to 9.0-BETA1).

In addition, merge following important bugfixes from
libarchive's release/2.8 branch:

Revision 2812:
Merge 2811 from trunk:  Don't try to verify that compression-level=0
produces larger results than the default compression, since this isn't
true for all versions of liblzma.

Revision 2817:
Merge 2814 from trunk: Fix Issue 121 (mtree parser error)
http://code.google.com/p/libarchive/issues/detail?id=121

Revision 2820:
Fix issue 119.
Change the file location check that a file location does not exceed
volume block. New one is that a file content does not exceed volume
block(end of an ISO image). It is better than previous check even
if the issue did not happen.

While reading an ISO image generated by an older version of mkisofs
utility, a file location indicates the end the ISO image if its file
size is zero and it is the last file of all files of the ISO image,
so it is possible that the location value is the same as the number
of the total block of the ISO image.

http://code.google.com/p/libarchive/issues/detail?id=119

Revision 2955:
Issue 134:  Fix libarchive 2.8 crashing in archive_write_finish() when
the open has failed and we're trying to write Zip format.

http://code.google.com/p/libarchive/issues/detail?id=134

Revision 2958:
Followup on Issue 134:
 1) Port test_open_failure to libarchive 2.8 branch to test
    the problem reported in Issue 134.
    This test also shows that archive_read_open() sometimes
    fails to report open errors correctly.
 2) Fix the bug in archive_read.c
 3) Comment out the tests that close functions are invoked
    promptly when open fails; that's fully fixed in libarchive 3.0,
    but I don't think it's worth fixing here.

Revision 3484:
Use uintmax_t with %ju

Revision 3487:
Fix issue 163.
Correctly allocate enough memory for a input buffer saved.

http://code.google.com/p/libarchive/issues/detail?id=163

Revision 3542:
Merge 2516, 2536 from trunk:  Allow path table offset values of
0 and 18, which are used by some ISO writers.

Reviewed by: kientzle
Approved by: re (kib)
MFC after: 3 days

13 years agoFix NetBSD PR bin/44114:
Martin Matuska [Sun, 7 Aug 2011 08:35:15 +0000 (08:35 +0000)]
Fix NetBSD PR bin/44114:
makefs with -t cd9660 -o rockridge against directories with
deep structure creates a corrupted cd9660 image.

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114

Fix NetBSD PR bin/45217:
makefs creates ISO9660 images that violate the ECMA-119 (ISO9660)
specification. This is caused by erroneously writing 32 bytes
with value 0x20 to the volume_set_id field and 128 bytes with value 0x20
to the the following 37-byte fields in the PVD:
copyright_file_id, abstract_file_id, bibliographic_file_id

This causes, among other unwanted results the reserved4 field to be
overwritten with the value 0x20. To comply with the specification,
this field muse be zero. As a result, all FreeBSD distribution
images created with makefs have not been 100% valid ISO9660 files.

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217

Reviewed by: kientzle
Approved by: re (kib)
Obtained from: NetBSD
MFC after: 3 days

13 years agoFix an error in kmem_alloc_attr(). Unless "tries" is updated,
Alan Cox [Sun, 7 Aug 2011 00:11:39 +0000 (00:11 +0000)]
Fix an error in kmem_alloc_attr().  Unless "tries" is updated,
kmem_alloc_attr() could get stuck in a loop.

Approved by: re (kib)
MFC after: 3 days

13 years agoProperly initialise the "len" argument to getsockname(2) in the tcpdrop
Robert Watson [Sat, 6 Aug 2011 19:20:17 +0000 (19:20 +0000)]
Properly initialise the "len" argument to getsockname(2) in the tcpdrop
regression test so that it works (more) consistently.

Approved by: re (bz)
Sponsored by: Juniper Networks

13 years agoCompile fbsd-threads.c. Amongst others this is necessary for a working
Marius Strobl [Sat, 6 Aug 2011 17:53:45 +0000 (17:53 +0000)]
Compile fbsd-threads.c. Amongst others this is necessary for a working
kgdb(1).

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

13 years agoImplement functions necessary for compiling fbsd-threads.c.
Marius Strobl [Sat, 6 Aug 2011 17:52:25 +0000 (17:52 +0000)]
Implement functions necessary for compiling fbsd-threads.c.

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

13 years agoImplement
Marius Strobl [Sat, 6 Aug 2011 17:50:37 +0000 (17:50 +0000)]
Implement

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

13 years agoUse the size of struct fpreg rather than of the pointer to it when copying
Marius Strobl [Sat, 6 Aug 2011 17:49:21 +0000 (17:49 +0000)]
Use the size of struct fpreg rather than of the pointer to it when copying
the FPU state.

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

13 years agoThe tid member of struct pthread actually is long so read it as such.
Marius Strobl [Sat, 6 Aug 2011 17:48:30 +0000 (17:48 +0000)]
The tid member of struct pthread actually is long so read it as such.
Accessing it as an int causes failure on big-endian LP64, i.e. mips64be,
powerpc64 and sparc64.

Reviewed by: marcel
Approved by: re (kib)
MFC after: 1 week

13 years ago- Merge from r147740:
Marius Strobl [Sat, 6 Aug 2011 17:45:52 +0000 (17:45 +0000)]
- Merge from r147740:
  When the last, possibly partially filled buffer is flushed, we didn't
  reset fragsz to 0 and as such would stop reflecting reality.
- Use __FBSDID.
- Wrap a too long line.

Approved by: re (kib)
MFC after: 1 week

13 years agoRemove a shortcut which is invalid with MAXCPU > IDR_CHEETAH_MAX_BN_PAIRS.
Marius Strobl [Sat, 6 Aug 2011 17:45:11 +0000 (17:45 +0000)]
Remove a shortcut which is invalid with MAXCPU > IDR_CHEETAH_MAX_BN_PAIRS.

Approved by: re (kib)