]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoWalk the zombproc list as well as the allproc list when enumerating threads
John Baldwin [Fri, 19 Aug 2011 21:28:40 +0000 (21:28 +0000)]
Walk the zombproc list as well as the allproc list when enumerating threads
and processes in a kernel image.  This allows examination of threads that
have exited or are in the late stages of exiting.

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

12 years agoRevert r224157, re-enabling r222135. The underlying problem keeping the
Marius Strobl [Fri, 19 Aug 2011 19:13:31 +0000 (19:13 +0000)]
Revert r224157, re-enabling r222135. The underlying problem keeping the
latter from working as expected was fixed in r225014.

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

12 years agor221812 reveals that at least some Broadcom PHYs default to being not only
Marius Strobl [Fri, 19 Aug 2011 19:12:58 +0000 (19:12 +0000)]
r221812 reveals that at least some Broadcom PHYs default to being not only
isolated but also powered down after a reset and while they just work fine
[sic] when both is the case they don't if they are only deisolate but still
powered down. So in order to put PHYs in an overall normal operation mode
for the common case, ensure in mii_phy_reset() that they are not powered
down after a reset. Unfortunately, this only helps in case of BCM5421,
while BCM5709S apparently only work when they remain isolated and powered
down after a reset. So don't call mii_phy_reset() in brgphy_reset() and
implement the reset locally leaving the problematic bits alone. Effectively
this bypasses r221812 for brgphy(4).
Thanks to Justin Hibbits for doing a binary search in order to identify
the problematic commit.

PR: 157405, 158156
Reviewed by: yongari (mii_phy_reset() part)
Approved by: re (kib)
MFC after: 3 days

12 years agoCorrectly handle BAR TX failures.
Adrian Chadd [Fri, 19 Aug 2011 15:21:13 +0000 (15:21 +0000)]
Correctly handle BAR TX failures.

On a TX failure, ic_raw_xmit will still call ieee80211_node_free().
There's no need to call it here.

Submitted by: moonlightakkiy@yahoo.ca
Approved by: re (kib)

12 years agoBump the maximum coretemp limit (for CPU temperature) to 110. Several
Attilio Rao [Fri, 19 Aug 2011 13:31:48 +0000 (13:31 +0000)]
Bump the maximum coretemp limit (for CPU temperature) to 110. Several
cores with temp in the range 101-105 have been found in the past.

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

12 years agoThe decimal() function was changed in r217808 to take the
Andrey V. Elsukov [Fri, 19 Aug 2011 12:48:06 +0000 (12:48 +0000)]
The decimal() function was changed in r217808 to take the
maximum value instead of number of bits. But for case when
limitation is not needed it erroneously skips conversion to
number and always returns zero. So, don't skip conversion
for case when limitation is not needed.

PR: bin/159765
Approved by: re (kib)

12 years agoAdd new section "BOOTSTRAPPING" to the gpart(8), that describes
Andrey V. Elsukov [Fri, 19 Aug 2011 10:12:02 +0000 (10:12 +0000)]
Add new section "BOOTSTRAPPING" to the gpart(8), that describes
bootstrap code images used to boot from MBR, GPT, BSD and VTOC8
schemes.

Reviewed by: marius (previous version)
Approved by: re (kib)
MFC after: 1 week

12 years agoAdd sysctl to not reset the device on clear stall failures, to
Hans Petter Selasky [Fri, 19 Aug 2011 09:01:34 +0000 (09:01 +0000)]
Add sysctl to not reset the device on clear stall failures, to
temporarily mitigate problems with VMs.

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

12 years agor222015 introduced a new assertion that the size of a fixed-length sbuf
Robert Watson [Fri, 19 Aug 2011 08:29:10 +0000 (08:29 +0000)]
r222015 introduced a new assertion that the size of a fixed-length sbuf
buffer is greater than 1.  This triggered panics in at least one spot in
the kernel (the MAC Framework) which passes non-negative, rather than >1
buffer sizes based on the size of a user buffer passed into a system
call.  While 0-size buffers aren't particularly useful, they also aren't
strictly incorrect, so loosen the assertion.

Discussed with: phk (fears I might be EDOOFUS but willing to go along)
Spotted by: pho + stress2
Approved by: re (kib)

12 years agoTest process descriptors.
Jonathan Anderson [Thu, 18 Aug 2011 23:15:04 +0000 (23:15 +0000)]
Test process descriptors.

Ensure that process descriptors work as expected. We should be able to:
 - pdfork(), like regular fork(), but producing a process descriptor
 - pdgetpid() to convert a PD into a PID
 - pdkill() to send signals to a process identified by a PD

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

12 years agoAuto-generated system call code based on r224987.
Jonathan Anderson [Thu, 18 Aug 2011 23:08:52 +0000 (23:08 +0000)]
Auto-generated system call code based on r224987.

Approved by: re (implicit)

12 years agoAdd experimental support for process descriptors
Jonathan Anderson [Thu, 18 Aug 2011 22:51:30 +0000 (22:51 +0000)]
Add experimental support for process descriptors

A "process descriptor" file descriptor is used to manage processes
without using the PID namespace. This is required for Capsicum's
Capability Mode, where the PID namespace is unavailable.

New system calls pdfork(2) and pdkill(2) offer the functional equivalents
of fork(2) and kill(2). pdgetpid(2) allows querying the PID of the remote
process for debugging purposes. The currently-unimplemented pdwait(2) will,
in the future, allow querying rusage/exit status. In the interim, poll(2)
may be used to check (and wait for) process termination.

When a process is referenced by a process descriptor, it does not issue
SIGCHLD to the parent, making it suitable for use in libraries---a common
scenario when using library compartmentalisation from within large
applications (such as web browsers). Some observers may note a similarity
to Mach task ports; process descriptors provide a subset of this behaviour,
but in a UNIX style.

This feature is enabled by "options PROCDESC", but as with several other
Capsicum kernel features, is not enabled by default in GENERIC 9.0.

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

12 years agoOne of the general principles of the sysctl(3) API is that a user can
John Baldwin [Thu, 18 Aug 2011 22:20:45 +0000 (22:20 +0000)]
One of the general principles of the sysctl(3) API is that a user can
query the needed size for a sysctl result by passing in a NULL old
pointer and a valid oldsize.  The kern.proc.args sysctl handler broke
this assumption by not calling SYSCTL_OUT() if the old pointer was
NULL.

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

12 years agoAllow release generation from a WORLDDIR that is not /usr/src
Sean Bruno [Thu, 18 Aug 2011 16:54:04 +0000 (16:54 +0000)]
Allow release generation from a WORLDDIR that is not /usr/src

PR: misc/159666
Submitted by: Test Rat <ttsestt@gmail.com>
Reviewed by: Nathan Whitehorn <nwhitehorn@freebsd.org>
Approved by: re (kib)

12 years agoSet the max_lun field in the path inquiry CCB for the mps(4) driver to 8.
Kenneth D. Merry [Thu, 18 Aug 2011 16:07:41 +0000 (16:07 +0000)]
Set the max_lun field in the path inquiry CCB for the mps(4) driver to 8.

This allows LUNs greater than 0 to be probed.  The value can be increased
later if need be.

Approved by: re (kib)

12 years agoFix a bug that prevented docsinstall from being able to use DNS in most
Nathan Whitehorn [Thu, 18 Aug 2011 16:00:32 +0000 (16:00 +0000)]
Fix a bug that prevented docsinstall from being able to use DNS in most
cases and provide a better error handling mechanism during package
installation.

Approved by: re (kib)

12 years agoFix headphones pin configuration on Lenovo B450 laptop.
Alexander Motin [Thu, 18 Aug 2011 13:33:34 +0000 (13:33 +0000)]
Fix headphones pin configuration on Lenovo B450 laptop.

Submitted by: "Sergey V. Dyatko" <sergey.dyatko@gmail.com>
Approved by: re (kib)

12 years agoUpdate ata(4) manual page, reflecting migration to CAM-based ATA stack
Alexander Motin [Wed, 17 Aug 2011 19:43:41 +0000 (19:43 +0000)]
Update ata(4) manual page, reflecting migration to CAM-based ATA stack
(`options ATA_CAM` enabled by default).

Approved by: re (kib)

12 years agoFix a regression where a rule containing a source port option after a
John Baldwin [Wed, 17 Aug 2011 14:39:45 +0000 (14:39 +0000)]
Fix a regression where a rule containing a source port option after a
destination IP would incorrectly display the source port as a destination
port.

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

12 years ago- Fix exclusion of directories from a recursive search
Gabor Kovesdan [Wed, 17 Aug 2011 13:58:39 +0000 (13:58 +0000)]
- Fix exclusion of directories from a recursive search
- Use FTS_SKIP for exclusion instead of custom code

Submitted by: ttsestt@gmail.com
Approved by: re (kib), delphij (mentor)

12 years ago- Fix handling of environmental variables when they are set to empty string
Gabor Kovesdan [Wed, 17 Aug 2011 13:56:33 +0000 (13:56 +0000)]
- Fix handling of environmental variables when they are set to  empty string

Submitted by: ttsestt@gmail.com
Approved by: re (kib), delphij (mentor)

12 years agoFix build failure without BPF.
Sergey Kandaurov [Wed, 17 Aug 2011 13:02:50 +0000 (13:02 +0000)]
Fix build failure without BPF.

Reported by: deeptech71 at gmail dot com
Approved by: re (kib)

12 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)

12 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)

12 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.

12 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)

12 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)

12 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)

12 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

12 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

12 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)

12 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)

12 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)

12 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

12 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)

12 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)

12 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)

12 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

12 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)

12 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.

12 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)

12 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)

12 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

12 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)

12 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

12 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)

12 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

12 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

12 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

12 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)

12 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

12 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)

12 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)

12 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)

12 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)

12 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

12 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

12 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.

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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)

12 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

12 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

12 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)

12 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.

12 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.

12 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

12 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)

12 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

12 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

12 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@)

12 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)

12 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)

12 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)

12 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

12 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

12 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)

12 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

12 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)

12 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)

12 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.

12 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

12 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)

12 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)

12 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)

12 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

12 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)

12 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

12 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)

12 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)

12 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)

12 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)