]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix LINT build for powerpc.
Andrey V. Elsukov [Thu, 16 Feb 2017 11:38:50 +0000 (11:38 +0000)]
Fix LINT build for powerpc.

Build kernel modules support only when both IPSEC and TCP_SIGNATURE
are not defined.

Reported by: emaste

7 years agoImprove debugging output.
Edward Tomasz Napierala [Thu, 16 Feb 2017 10:36:00 +0000 (10:36 +0000)]
Improve debugging output.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoRemove unnecessary #includes from the kqueue(2) man page.
Ed Schouten [Thu, 16 Feb 2017 06:52:53 +0000 (06:52 +0000)]
Remove unnecessary #includes from the kqueue(2) man page.

Now that <sys/event.h> can be included on its own, adjust the manual
page accordingly. Remove both unnecessary #include statements from the
synopsis and the example code.

While there, also add a note to the BUGS section to mention that
previous versions of this header file still depend on <sys/types.h>.

Reviewed by: ngie, vangyzen
Differential Revision: https://reviews.freebsd.org/D9605

7 years agoDo not access memory past the buffer end.
Konstantin Belousov [Thu, 16 Feb 2017 06:36:16 +0000 (06:36 +0000)]
Do not access memory past the buffer end.
Do not accept and silently truncate too long hostname.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDo not allocate char[MNAMELEN] on stack in nfsclient.
Konstantin Belousov [Thu, 16 Feb 2017 06:34:20 +0000 (06:34 +0000)]
Do not allocate char[MNAMELEN] on stack in nfsclient.

Right now this is not critical, but will be after planned increase of
MNAMELEN from 88 to 1k.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse uintmax_t to print st_nlink.
Konstantin Belousov [Thu, 16 Feb 2017 06:32:39 +0000 (06:32 +0000)]
Use uintmax_t to print st_nlink.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoMinor style fixes.
Konstantin Belousov [Thu, 16 Feb 2017 06:31:36 +0000 (06:31 +0000)]
Minor style fixes.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agomakefs: use a macro to simplify per-fs function declarations
Ed Maste [Thu, 16 Feb 2017 03:12:47 +0000 (03:12 +0000)]
makefs: use a macro to simplify per-fs function declarations

makefs.h 1.28

Obtained from: NetBSD

7 years agoUse symbolic constants for OSC support / control negotiations.
Warner Losh [Wed, 15 Feb 2017 23:49:28 +0000 (23:49 +0000)]
Use symbolic constants for OSC support / control negotiations.

Differential Revision: https://reviews.freebsd.org/D9604

7 years agorwlock: tidy up r313392
Mateusz Guzik [Wed, 15 Feb 2017 23:33:14 +0000 (23:33 +0000)]
rwlock: tidy up r313392

While a new bit was added and thread alignment got shifted to accomodate it,
RW_READERS_SHIFT was not modified accordingly and clashed with the new flag.

This was surprisingly harmless. If the lock was taken for writing, other flags
were tested. If the lock was taken for reading, it would correctly work for
readers > 1 and this was the only relevant test performed.

7 years agoRemove Micro Channel Architecture support. Of the commonly available
Warner Losh [Wed, 15 Feb 2017 23:04:25 +0000 (23:04 +0000)]
Remove Micro Channel Architecture support. Of the commonly available
machines, only a few 486 machines that used it, and those haven't had
enough memory to run FreeBSD for quite some time (often limited to
16MB).

Not to be confused with the Machine Check Architecture, which is still
very much alive and used (and untouched by this commit).

No Objection From: arch@

7 years agoMFV r313781:
Martin Matuska [Wed, 15 Feb 2017 20:17:55 +0000 (20:17 +0000)]
MFV r313781:
Sync libarchive with vendor

Vendor changes:
Make SCHILY.acl.ace header more compact (NFSv4 ACLs)

Vendor bugfixes:
zip reader integer parsing fix (OSS-Fuzz 556)
spelling fixes (issue #863)

7 years agoUpdate vendor/libarchive to git 0edabbad1f44641c64fe9d0cbaed27ed93ab38c2
Martin Matuska [Wed, 15 Feb 2017 20:00:36 +0000 (20:00 +0000)]
Update vendor/libarchive to git 0edabbad1f44641c64fe9d0cbaed27ed93ab38c2

Vendor changes:
Make SCHILY.acl.ace header more compact (NFSv4 ACLs)

Vendor bugfixes:
zip reader integer parsing fix (OSS-Fuzz 556)
spelling fixes (issue #863)

7 years agoprefix UFS symbols with UFS_ to reduce namespace pollution
Ed Maste [Wed, 15 Feb 2017 19:50:26 +0000 (19:50 +0000)]
prefix UFS symbols with UFS_ to reduce namespace pollution

Specifically:
  ROOTINO -> UFS_ROOTINO
  WINO -> UFS_WINO
  NXADDR -> UFS_NXADDR
  NDADDR -> UFS_NDADDR
  NIADDR -> UFS_NIADDR
  MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_

Reviewed by: kib, mckusick
Obtained from: NetBSD
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9536

7 years agoFix handling of negative sbspace() return values.
Alexander Motin [Wed, 15 Feb 2017 19:46:00 +0000 (19:46 +0000)]
Fix handling of negative sbspace() return values.

I found that at least with Chelsio NICs TOE sockets quite often report
negative sbspace() values.  Using unsigned variable to store it resulted
in attempts to aggregate too much data in one sosend() call, that caused
errors and following connection termination.

MFC after: 2 weeks

7 years agoImprove code readability and fix compilation error when using clang 4.x.
Hans Petter Selasky [Wed, 15 Feb 2017 18:31:09 +0000 (18:31 +0000)]
Improve code readability and fix compilation error when using clang 4.x.

Found by: emaste @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUn-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds
Ravi Pokala [Wed, 15 Feb 2017 17:33:03 +0000 (17:33 +0000)]
Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds

The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error:

    sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used

Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and
put it in the proper order.

This fixes the immedate issue w/ vt(4), but all three then fail on different
issues.

Reviewed by: emaste

7 years agoChange the "devfs_fsync: vop_stdfsync failed" from panic to a printf.
Edward Tomasz Napierala [Wed, 15 Feb 2017 16:52:21 +0000 (16:52 +0000)]
Change the "devfs_fsync: vop_stdfsync failed" from panic to a printf.
It's not a proper fix, but should be better than what we have now.
Since it got broken some six months ago it results in an incredibly
annoying and trivially reproducible panic every time eg an USB disk
gets disconnected.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agolocaltime: return NULL if time_t out of range of struct tm
Ed Maste [Wed, 15 Feb 2017 15:32:29 +0000 (15:32 +0000)]
localtime: return NULL if time_t out of range of struct tm

Previously we would truncate tm.tm_year for any time_t corresponding to
a year that does not fit in int.  This issue was discovered because it
caused the bash-static build to fail when linking with LLD.

As reported by Rafael Espíndola:

    Configure has

    AC_FUNC_MKTIME

    which expands to a test of mktime that fails with the freebsd
    implementation. Given that, bash compiles a mktime.o file that
    defines just mktime and uses localtime. That goes in a .a file
    that is before libc.

    The freebsd libc defines mktime in localtime.o, which also defines
    localtime among other functions.

    When lld sees an undefined reference to mktime from libc, it uses
    the bash provided one and then tries to find a definition of
    localtime. It is found on libc's localtime.o, but now we have a
    duplicated error.

    The reason it works with bfd is that bash doesn't use mktime
    directly and the undefined reference from libc is resolved to the
    libc implementation. It would also fail to link if bash itself
    directly used mktime.

The bash-static configure test verifies that, for many values of t, either
localtime(t) returns NULL or mktime(localtime(t)) == t.  This test failed
when localtime returned a truncated tm_year.

This was fixed in tzcode in 2004 but has persisted in our tree since
rS2708.

Reported by: Rafael Espíndola
Reviewed by: bapt
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9534

7 years agoLoad the new sp_el0 with interrupts disabled in fork_trampoline. If an
Andrew Turner [Wed, 15 Feb 2017 14:56:47 +0000 (14:56 +0000)]
Load the new sp_el0 with interrupts disabled in fork_trampoline. If an
interrupt arrives in fork_trampoline after sp_el0 was written we may then
switch to a new thread, enter userland so change this stack pointer, then
return to this code with the wrong value. This fixes this case by moving
the load of sp_el0 until after interrupts have been disabled.

Reported by: Mark Millard (markmi@dsl-only.net)
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D9593

7 years agobxe: enable usage with NetXtreme II BCM57840 2x20GbE chip
Roger Pau Monné [Wed, 15 Feb 2017 14:34:40 +0000 (14:34 +0000)]
bxe: enable usage with NetXtreme II BCM57840 2x20GbE chip

Current bxe probe function won't attach to devices with the NetXtreme II
BCM57840 2x20GbE chip, enable it by adding it's chip ID to the list of
supported chips.

Tested on: HP ProLiant WS460c Gen9
Reviewed by: gnn
MFC after: 1 week
Sponsored by: Citrix Systems R&D
Differential Revision: https://reviews.freebsd.org/D9609

7 years agoRegen after r313769.
Edward Tomasz Napierala [Wed, 15 Feb 2017 14:25:50 +0000 (14:25 +0000)]
Regen after r313769.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoFix definition of linux64 ptrace syscall.
Edward Tomasz Napierala [Wed, 15 Feb 2017 14:12:39 +0000 (14:12 +0000)]
Fix definition of linux64 ptrace syscall.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoPort the Linux AMX 10G network driver to FreeBSD as axgbe. It is unlikely
Andrew Turner [Wed, 15 Feb 2017 13:56:04 +0000 (13:56 +0000)]
Port the Linux AMX 10G network driver to FreeBSD as axgbe. It is unlikely
we will import a newer version of the Linux code so the linuxkpi was not
used.

This is still missing 10G support, and multicast has not been tested.

Reviewed by: gnn
Obtained from: ABT Systems Ltd
Sponsored by: SoftIron Inc
Differential Revision: https://reviews.freebsd.org/D8549

7 years agoImport the AMD 10G ethernet driver for the AMD Opteron A1100.
Andrew Turner [Wed, 15 Feb 2017 13:37:32 +0000 (13:37 +0000)]
Import the AMD 10G ethernet driver for the AMD Opteron A1100.

This is from Linux git as of 5eb4dce3b3471ec9d1ea2945fa3d2bab4ac7e100

Obtained from: Linux
Sponsored by: SoftIron Inc

7 years agoAdd casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun
Mahdi Mokhtari [Wed, 15 Feb 2017 07:59:54 +0000 (07:59 +0000)]
Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun
to improve C11 conformance.

PR: 216850 216851 216852 216856 216857 216858
Submitted by: mmokhi
Reported by: sgk@troutmask.apl.washington.edu
Reviewed by: bde, mat, theraven
Approved by: bde (src committer), mat (mentor)
Differential Revision: https://reviews.freebsd.org/D9491

7 years agoMFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD).
Xin LI [Wed, 15 Feb 2017 07:22:47 +0000 (07:22 +0000)]
MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD).

MFC after: 28 days
X-MFC-with: r313695

7 years agoImport license changes from upstream 5c5039637f2be0e3167ff6806b4c2741ebab2181.
Xin LI [Wed, 15 Feb 2017 07:19:23 +0000 (07:19 +0000)]
Import license changes from upstream 5c5039637f2be0e3167ff6806b4c2741ebab2181.

7 years agoUse pget() instead of pfind() in fasttrap_pid_{enable,disable}().
Mark Johnston [Wed, 15 Feb 2017 06:07:01 +0000 (06:07 +0000)]
Use pget() instead of pfind() in fasttrap_pid_{enable,disable}().

Suggested by: mjg
MFC after: 1 week

7 years ago[psm] Fix calculation for clickpad softbuttons at the top
Oleksandr Tymoshenko [Wed, 15 Feb 2017 02:52:43 +0000 (02:52 +0000)]
[psm] Fix calculation for clickpad softbuttons at the top

On laptops like the ThinkPad X240, ClickPad buttons are located at the
top. The hw.psm.synaptics.softbuttons_y sysctl was supposed to allow this
by setting the value to a negative one (e.g. -1700). However, the
condition was wrong (double negative), and doing that placed the buttons
in an unreachable area.

PR: 216342
Submitted by: Greg V <greg@unrelenting.technology>
MFC after: 1 week

7 years agoApply MADV_FREE to exec_map entries only after a lowmem event.
Mark Johnston [Wed, 15 Feb 2017 01:50:58 +0000 (01:50 +0000)]
Apply MADV_FREE to exec_map entries only after a lowmem event.

This effectively provides the same benefit as applying MADV_FREE inline
upon every execve, since the page daemon invokes lowmem handlers prior to
scanning the inactive queue. It also has less overhead; the cost of
applying MADV_FREE is very noticeable on many-CPU systems since it includes
that of a TLB shootdown of global PTEs. For instance, this change nearly
halves the system CPU usage during a buildkernel on a 128-vCPU EC2
instance (with some other patches applied).

Benchmarked by: cperciva (earlier version)
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9586

7 years agoCheck for an exiting process when enabling PID provider probes.
Mark Johnston [Wed, 15 Feb 2017 01:35:26 +0000 (01:35 +0000)]
Check for an exiting process when enabling PID provider probes.

MFC after: 1 week

7 years agomca: use time_uptime instead of ticks for CMCI throttling
Andriy Gapon [Tue, 14 Feb 2017 22:46:39 +0000 (22:46 +0000)]
mca: use time_uptime instead of ticks for CMCI throttling

This solves several problems.
First of all, cmc_throttle is specified in seconds and there was no
conversion between ticks and seconds when they were mixed together.
Second, we avoid potential problems with ticks wrapping around.

Resolution of time_uptime should be sufficient for the throttling
purposes.

Discussed with: jhb
MFC after: 12 days

7 years agomca: fix writes to MSR_MC_CTL2 in cmci_update
Andriy Gapon [Tue, 14 Feb 2017 22:30:22 +0000 (22:30 +0000)]
mca: fix writes to MSR_MC_CTL2 in cmci_update

Previously, if the threshold was changed, then MC_CTL2_CMCI_EN would get
cleared and the logic would switch to the polling only mode.

Discussed with: jhb
MFC after: 2 weeks

7 years agoAdd a regression test for putting a socket on kqueue, and then doing
Gleb Smirnoff [Tue, 14 Feb 2017 21:56:01 +0000 (21:56 +0000)]
Add a regression test for putting a socket on kqueue, and then doing
listen(2) on it (see r313043).  Based on Hartmut's code.

7 years agoFix indentation in nss_configure().
Mark Johnston [Tue, 14 Feb 2017 21:55:50 +0000 (21:55 +0000)]
Fix indentation in nss_configure().

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRegister nss_atexit() before parsing nsswitch.conf for the first time.
Mark Johnston [Tue, 14 Feb 2017 21:51:19 +0000 (21:51 +0000)]
Register nss_atexit() before parsing nsswitch.conf for the first time.

NSS modules are loaded when nsswitch.conf is parsed and may register their
own atexit handlers with libc. nss_atexit() unloads any dynamically loaded
NSS modules, so it should run only after the modules' atexit handlers have
been invoked.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoUnbreak the gcc build of netmap.
Mark Johnston [Tue, 14 Feb 2017 21:36:18 +0000 (21:36 +0000)]
Unbreak the gcc build of netmap.

This fixes several LINT targets.

Reviewed by: Vincenzo Maffione

7 years agoAdd missing check to fix the build with IPSEC_SUPPORT and without MAC.
Andrey V. Elsukov [Tue, 14 Feb 2017 21:33:10 +0000 (21:33 +0000)]
Add missing check to fix the build with IPSEC_SUPPORT and without MAC.

Submitted by: netchild

7 years ago* Add missing parameters to usage()
Renato Botelho [Tue, 14 Feb 2017 21:14:24 +0000 (21:14 +0000)]
* Add missing parameters to usage()
* Add missing parameters to manpage synopsis
* Add missing description of -d flag
* Sort flags descriptions

Reviewed by: allanjude, kib
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9152

7 years agoNo need to erase sense_data when sense_len is set to zero.
Alexander Motin [Tue, 14 Feb 2017 21:05:36 +0000 (21:05 +0000)]
No need to erase sense_data when sense_len is set to zero.

MFC after: 2 weeks

7 years agoAdd myself as a new ports committer
Tobias Kortkamp [Tue, 14 Feb 2017 19:54:32 +0000 (19:54 +0000)]
Add myself as a new ports committer

Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D9590

7 years agoReplace Linuxulator implementation of readdir(), getdents() and
Dmitry Chagin [Tue, 14 Feb 2017 19:13:27 +0000 (19:13 +0000)]
Replace Linuxulator implementation of readdir(), getdents() and
getdents64() with wrapper over kern_getdirentries().

The patch was originally written by emaste@ and then adapted by trasz@
and me.

Note:
1. I divided linux_getdents() and linux_readdir() as in case when the
getdents() called with count = 1 (readdir() case) it can overwrite
user stack (by writing to user buffer pointer more than 1 byte).

2. Linux returns EINVAL in case when user supplied buffer is not enough
to contain fetched dirent.

3. Linux returns ENOTDIR in case when fd points to not a directory.

Reviewed by: trasz@
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D2210

7 years agoDirectly call m_gethdr() instead of m_getm2() for BHS.
Alexander Motin [Tue, 14 Feb 2017 18:34:25 +0000 (18:34 +0000)]
Directly call m_gethdr() instead of m_getm2() for BHS.

All this code is based on assumption that data will be stored in one piece,
and since buffer size if known and fixed, it is easier to hardcode it.

MFC after: 2 weeks

7 years agoTemporary attach AHS to BHS to calculate header digest.
Alexander Motin [Tue, 14 Feb 2017 18:29:07 +0000 (18:29 +0000)]
Temporary attach AHS to BHS to calculate header digest.

MFC after: 2 weeks

7 years agoFix style(9)
Renato Botelho [Tue, 14 Feb 2017 18:11:16 +0000 (18:11 +0000)]
Fix style(9)

Reviewed by: allanjude, vangyzen
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9510

7 years agoFix panic on shutdown of ramdisk LU with zero capacity.
Alexander Motin [Tue, 14 Feb 2017 18:03:17 +0000 (18:03 +0000)]
Fix panic on shutdown of ramdisk LU with zero capacity.

MFC after: 1 week

7 years agoadd svcpool_close to handle killed nfsd threads
Andriy Gapon [Tue, 14 Feb 2017 17:49:08 +0000 (17:49 +0000)]
add svcpool_close to handle killed nfsd threads

This patch adds a new function to the server krpc called
svcpool_close().  It is similar to svcpool_destroy(), but does not free
the data structures, so that the pool can be used again.

This function is then used instead of svcpool_destroy(),
svcpool_create() when the nfsd threads are killed.

PR: 204340
Reported by: Panzura
Approved by: rmacklem
Obtained from: rmacklem
MFC after: 1 week

7 years agoAdd RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols.
Konstantin Belousov [Tue, 14 Feb 2017 17:44:30 +0000 (17:44 +0000)]
Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols.

Define them as RLIM_INFINITY.  This is allowed by POSIX in case all
resource limits are representable in an object of type rlim_t.  Since
we do not allow negative rlim_t, with some strength this definition is
conforming.

We are not conforming fully still because POSIX requires rlim_t to be
unsigned type.  Fixing this without breaking ABI to redefine
RLIM_INFINITY is impossible.

PR: 209729
Submitted by: bltsrc@mail.ru
Exp-run done by: antoine
MFC after: 2 weeks

7 years agosleepq_catch_signals: do thread suspension before signal check
Eric Badger [Tue, 14 Feb 2017 17:13:23 +0000 (17:13 +0000)]
sleepq_catch_signals: do thread suspension before signal check

Since locks are dropped when a thread suspends, it's possible for another
thread to deliver a signal to the suspended thread. If the thread awakens from
suspension without checking for signals, it may go to sleep despite having
a pending signal that should wake it up. Therefore the suspension check is
done first, so any signals sent while suspended will be caught in the
subsequent signal check.

Reviewed by: kib
Approved by: kib (mentor)
MFC after: 2 weeks
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D9530

7 years agobhyve: whitespace fix for r313727
Ed Maste [Tue, 14 Feb 2017 16:49:32 +0000 (16:49 +0000)]
bhyve: whitespace fix for r313727

Reported by: jhb

7 years agoDo not rely on data alignment after m_pullup().
Alexander Motin [Tue, 14 Feb 2017 16:33:42 +0000 (16:33 +0000)]
Do not rely on data alignment after m_pullup().

In general case m_pullup() does not really guarantee any data alignment.
Instead of depenting on side effects caused by data being always copied
out of mbuf cluster (which is probably a bug by itself), always allocate
aligned BHS buffer and read data there directly from socket.

While there, reuse new icl_conn_receive_buf() function to read digests.
The code could probably be even more optimized to aggregate those reads,
but until that done, this is still easier then the way it was before.

MFC after: 2 weeks

7 years agotry to fix RACCT_RSS accounting
Andriy Gapon [Tue, 14 Feb 2017 13:54:05 +0000 (13:54 +0000)]
try to fix RACCT_RSS accounting

There could be a race between the vm daemon setting RACCT_RSS based on
the vm space and vmspace_exit (called from exit1) resetting RACCT_RSS to
zero.  In that case we can get a zombie process with non-zero RACCT_RSS.
If the process is jailed, that may break accounting for the jail.
There could be other consequences.

Fix this race in the vm daemon by updating RACCT_RSS only when a process
is in the normal state.  Also, make accounting a little bit more
accurate by refreshing the page resident count after calling
vm_pageout_map_deactivate_pages().
Finally, add an assert that the RSS is zero when a process is reaped.

PR: 210315
Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D9464

7 years agoCapsicum support for bhyve(8).
Bartek Rutkowski [Tue, 14 Feb 2017 13:35:59 +0000 (13:35 +0000)]
Capsicum support for bhyve(8).

Adds Capsicum sandboxing to bhyve.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: grehan, oshogbo
Approved by: emaste, grehan
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D8290

7 years agoOrder alphabetically.
Konstantin Belousov [Tue, 14 Feb 2017 03:32:37 +0000 (03:32 +0000)]
Order alphabetically.

Noted by: alc
MFC after: 3 days

7 years agoUse %s __func__ to print the actual function name (been looking at
Bjoern A. Zeeb [Tue, 14 Feb 2017 01:20:03 +0000 (01:20 +0000)]
Use %s __func__ to print the actual function name (been looking at
the wrong one for too often lately at first), and also use %#lx to
get the 0x prefix for the address.

MFC after: 1 week

7 years agoHandle clang 4.x+ with the compile-time exception added in r312213
Enji Cooper [Tue, 14 Feb 2017 00:54:48 +0000 (00:54 +0000)]
Handle clang 4.x+ with the compile-time exception added in r312213

It also fails the assertions noted in bug 208703

PR: 208703
PR: 217084
Submitted by: jbeich
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years ago[sdhci_acpi] Add support for Bay Trail SDHC SD card slot
Oleksandr Tymoshenko [Tue, 14 Feb 2017 00:04:36 +0000 (00:04 +0000)]
[sdhci_acpi] Add support for Bay Trail SDHC SD card slot

Add ACPI device 80860F14 with _UID 3 to the list of known devices. It
make SD card available on NUCs and Minnowboard. Previously added _UID 1
covered only eMMC devices.

Reported by: kib@
MFC after: 1 week

7 years agovtnet: don't update VLAN filter when parent is not running
Philip Paeps [Mon, 13 Feb 2017 21:44:29 +0000 (21:44 +0000)]
vtnet: don't update VLAN filter when parent is not running

Submitted by: Gerrie Roos <groos -at- xiplink -dot- com>
Reviewed by: gnn
Sponsored by: XipLink, Inc.
Differential Revision: https://reviews.freebsd.org/D9573

7 years agoloader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t
Toomas Soome [Mon, 13 Feb 2017 21:33:50 +0000 (21:33 +0000)]
loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t

Cleaned up some spaces where tabs should be.
efipart_ioctl() DIOCGMEDIASIZE needs to use uint64_t, not off_t

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9562

7 years agoFix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no):
Dimitry Andric [Mon, 13 Feb 2017 20:56:53 +0000 (20:56 +0000)]
Fix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no):
* Initialize correct parent in binary_operator's constructor.
* Include <errno.h> explicitly, otherwise errno is undefined (without
  NDEBUG, this is accidentally 'fixed' by including <iostream>).

Reported by: matteo
MFC after: 3 days

7 years agoRemove debugging code that was probably unused since before the arm code
Olivier Houchard [Mon, 13 Feb 2017 20:51:08 +0000 (20:51 +0000)]
Remove debugging code that was probably unused since before the arm code
was initially committed.

Reported by: Alexandre Martins <alexandre.martins@stormshield.eu>

7 years agoRemove M_PKTHDR from m_getm2() in icl_pdu_append_data().
Alexander Motin [Mon, 13 Feb 2017 20:36:28 +0000 (20:36 +0000)]
Remove M_PKTHDR from m_getm2() in icl_pdu_append_data().

ip_data_mbuf is always appended to ip_bhs_mbuf, so it does not need own
packet header.  This change first avoids allocation/initialization of the
header, and then avoids dropping one when it later gets to socket buffer.

MFC after: 2 weeks

7 years ago[mips/broadcom] Move MIPS-specific bhnd(4) nexus drivers to
Landon J. Fuller [Mon, 13 Feb 2017 19:58:55 +0000 (19:58 +0000)]
[mips/broadcom] Move MIPS-specific bhnd(4) nexus drivers to
sys/mips/broadcom, and add MIPS/BCM4706-specific workaround to
bhnd_nexus_is_hw_disabled() -- the BCM4706 low-cost package leaves
secondary GMAC cores floating.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D9499

7 years agoMake <sys/event.h> work on its own.
Ed Schouten [Mon, 13 Feb 2017 19:00:09 +0000 (19:00 +0000)]
Make <sys/event.h> work on its own.

Right now this header file doesn't want to build when included on its
own, as it depends on some integer types that are only declared
internally. Switch it over to use <sys/_types.h> and the __*
counterparts.

7 years agoFix typo where opening brace was needed.
Stephen J. Kiernan [Mon, 13 Feb 2017 18:52:26 +0000 (18:52 +0000)]
Fix typo where opening brace was needed.

Reported by: Michael Butler
Reviewed by: sjg
Approved by: sjg (mentor)

7 years agoFor MD_PRELOAD type md(4) devices, if there is a file name in the preloaded
Stephen J. Kiernan [Mon, 13 Feb 2017 17:44:07 +0000 (17:44 +0000)]
For MD_PRELOAD type md(4) devices, if there is a file name in the preloaded
meta-data, copy it into the softc structure.

When returning md(4) device details to the caller, include the file name in
any MD_PRELOAD type devices if it is set (first character is not NUL.)

In mdconfig, for "preload" type md(4) devices, if there is file config
available, print it in the file column of the output.

Reviewed by: brooks
Approved by: sjg (mentor)
MFC after: 1 month
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D9529

7 years agoRemove IPsec related PCB code from SCTP.
Andrey V. Elsukov [Mon, 13 Feb 2017 11:37:52 +0000 (11:37 +0000)]
Remove IPsec related PCB code from SCTP.

The inpcb structure has inp_sp pointer that is initialized by
ipsec_init_pcbpolicy() function. This pointer keeps strorage for IPsec
security policies associated with a specific socket.
An application can use IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket
options to configure these security policies. Then ip[6]_output()
uses inpcb pointer to specify that an outgoing packet is associated
with some socket. And IPSEC_OUTPUT() method can use a security policy
stored in the inp_sp. For inbound packet the protocol-specific input
routine uses IPSEC_CHECK_POLICY() method to check that a packet conforms
to inbound security policy configured in the inpcb.

SCTP protocol doesn't specify inpcb for ip[6]_output() when it sends
packets. Thus IPSEC_OUTPUT() method does not consider such packets as
associated with some socket and can not apply security policies
from inpcb, even if they are configured. Since IPSEC_CHECK_POLICY()
method is called from protocol-specific input routine, it can specify
inpcb pointer and associated with socket inbound policy will be
checked. But there are two problems:
1. Such check is asymmetric, becasue we can not apply security policy
from inpcb for outgoing packet.
2. IPSEC_CHECK_POLICY() expects that caller holds INPCB lock and
access to inp_sp is protected. But for SCTP this is not correct,
becasue SCTP uses own locks to protect inpcb.

To fix these problems remove IPsec related PCB code from SCTP.
This imply that IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket options
will be not applicable to SCTP sockets. To be able correctly check
inbound security policies for SCTP, mark its protocol header with
the PR_LASTHDR flag.

Reported by: tuexen
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D9538

7 years agoRework r313352.
Konstantin Belousov [Mon, 13 Feb 2017 09:04:38 +0000 (09:04 +0000)]
Rework r313352.

Rename kern_vm_* functions to kern_*.  Move the prototypes to
syscallsubr.h.  Also change Mach VM types to uintptr_t/size_t as
needed, to avoid headers pollution.

Requested by: alc, jhb
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9535

7 years agoMFV r313676: libpcap 1.8.1
Xin LI [Mon, 13 Feb 2017 08:23:39 +0000 (08:23 +0000)]
MFV r313676: libpcap 1.8.1

MFC after: 1 month

7 years agoiwi: add 12-14 2GHz channels into channel list.
Andriy Voskoboinyk [Mon, 13 Feb 2017 02:15:56 +0000 (02:15 +0000)]
iwi: add 12-14 2GHz channels into channel list.

Return full channel list via iwi_getradiocaps() method
(ieee80211_init_channels() was replaced with iwi_getradiocaps()
to be consistent with other drivers).

PR: 216923
Submitted and tested by: ds@ukrhub.net (original patch)
MFC after: 5 days

7 years agoRemove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers.
Konstantin Belousov [Mon, 13 Feb 2017 00:40:55 +0000 (00:40 +0000)]
Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers.

Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoStyle: wrap long line.
Konstantin Belousov [Mon, 13 Feb 2017 00:39:43 +0000 (00:39 +0000)]
Style: wrap long line.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoOnly trigger em_local_timer on queue index 0. This was causing continuous
Sean Bruno [Sun, 12 Feb 2017 23:06:41 +0000 (23:06 +0000)]
Only trigger em_local_timer on queue index 0.  This was causing continuous
em_local_timer() executions during normal operation and was very likely
to cause a lock up on igb(4) devices.

Submitted by: Matt Macy (mmacy@nextbsd.org)
Reported by: jtl
Reviewed by: gallatin
Sponsored by: Limelight Networks & Netflix

7 years agoConsistently handle negative or wrapping offsets in the mmap(2) syscalls.
Konstantin Belousov [Sun, 12 Feb 2017 21:05:44 +0000 (21:05 +0000)]
Consistently handle negative or wrapping offsets in the mmap(2) syscalls.

For regular files and posix shared memory, POSIX requires that
[offset, offset + size) range is legitimate.  At the maping time,
check that offset is not negative.  Allowing negative offsets might
expose the data that filesystem put into vm_object for internal use,
esp. due to OFF_TO_IDX() signess treatment.  Fault handler verifies
that the mapped range is valid, assuming that mmap(2) checked that
arithmetic gives no undefined results.

For device mappings, leave the semantic of negative offsets to the
driver.  Correct object page index calculation to not erronously
propagate sign.

In either case, disallow overflow of offset + size.

Update mmap(2) man page to explain the requirement of the range
validity, and behaviour when the range becomes invalid after mapping.

Reported and tested by: royger (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoSwitch copyout_map() to use vm_mmap_object() instead of vm_mmap().
Konstantin Belousov [Sun, 12 Feb 2017 20:54:31 +0000 (20:54 +0000)]
Switch copyout_map() to use vm_mmap_object() instead of vm_mmap().

This is both a microoptimization and a move of the consumer to more
commonly used vm function.

Suggested and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoremove l2_padding_needed statistic from zfs arc
Andriy Gapon [Sun, 12 Feb 2017 19:45:30 +0000 (19:45 +0000)]
remove l2_padding_needed statistic from zfs arc

It became obsolete when the Compressed ARC support was committed.

MFC after: 1 week

7 years agocheck remaining space in zfs implementations of vptocnp
Andriy Gapon [Sun, 12 Feb 2017 19:40:59 +0000 (19:40 +0000)]
check remaining space in zfs implementations of vptocnp

PR: 216939
Submitted by: Iouri V. Ivliev <fbsd@any.com.ru>
MFC after: 1 week

7 years agoFix r313284.
Dmitry Chagin [Sun, 12 Feb 2017 15:22:50 +0000 (15:22 +0000)]
Fix r313284.

Members of the syscall argument structures are padded to a word size. So,
for COMPAT_LINUX32 we should convert user supplied system call arguments
which is 32-bit in that case to the array of register_t.

Reported by: Oleg V. Nauman
MFC after: 1 week

7 years agolockmgr: implement fast path
Mateusz Guzik [Sun, 12 Feb 2017 09:49:44 +0000 (09:49 +0000)]
lockmgr: implement fast path

The main lockmgr routine takes 8 arguments which makes it impossible to
tail-call it by the intermediate vop_stdlock/unlock routines.

The routine itself starts with an if-forest and reads from the lock itself
several times.

This slows things down both single- and multi-threaded. With the patch
single-threaded fstats go 4% up and multithreaded up to ~27%.

Note that there is still a lot of room for improvement.

Reviewed by: kib
Tested by: pho

7 years agoUse SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu
Enji Cooper [Sun, 12 Feb 2017 08:36:47 +0000 (08:36 +0000)]
Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu
of ../ elsewhere

This simplifies pathing in make/displayed output

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoVendor import of libpcap 1.8.1.
Xin LI [Sun, 12 Feb 2017 07:04:44 +0000 (07:04 +0000)]
Vendor import of libpcap 1.8.1.

7 years agoCommitted without approval from mentor.
Ermal Luçi [Sun, 12 Feb 2017 06:56:33 +0000 (06:56 +0000)]
Committed without approval from mentor.

Reported by: gnn

7 years agoEnable usb low and full speed devices connected to the imx6 root hubs.
Ian Lepore [Sun, 12 Feb 2017 00:52:22 +0000 (00:52 +0000)]
Enable usb low and full speed devices connected to the imx6 root hubs.

This enables the PHY circuitry for UTMI+ level 2 and 3, and sets the
flag to tell the ehci code that the root hub has a transaction translator
in it.  For imx6 we can use the standard ehci_get_port_speed_portsc()
function to find out what speed device is connected to the port.

7 years agoRemove spaces at end of line
Baptiste Daroussin [Sat, 11 Feb 2017 23:45:50 +0000 (23:45 +0000)]
Remove spaces at end of line

Reported by: make manlint
MFC after: 2 days

7 years agoRemove useless Li macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:45:10 +0000 (23:45 +0000)]
Remove useless Li macro

Reported by: make manlint
MFC after: 2 days

7 years agoUse correct date format
Baptiste Daroussin [Sat, 11 Feb 2017 23:44:37 +0000 (23:44 +0000)]
Use correct date format

Reported by: make manlint
MFC after: 2 days

7 years agoEscape Sm to avoid confusion with Sm macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:43:12 +0000 (23:43 +0000)]
Escape Sm to avoid confusion with Sm macro

Reported by: make manlint
MFC after: 2 days

7 years agoProperly use .An macro before Authors name
Baptiste Daroussin [Sat, 11 Feb 2017 23:42:33 +0000 (23:42 +0000)]
Properly use .An macro before Authors name

Reported by: make manlint
MFC after: 2 days

7 years agoAdd missing section in manpage reference
Baptiste Daroussin [Sat, 11 Feb 2017 23:41:38 +0000 (23:41 +0000)]
Add missing section in manpage reference

Reported by: make manlint
MFC after: 2 days

7 years agoRemove spaces at EOL and sort correctly the SEE ALSO section
Baptiste Daroussin [Sat, 11 Feb 2017 23:40:57 +0000 (23:40 +0000)]
Remove spaces at EOL and sort correctly the SEE ALSO section

Reported by: make manlint
MFC after: 2 days

7 years agoRemove empty space at EOL and escept Ed
Baptiste Daroussin [Sat, 11 Feb 2017 23:39:56 +0000 (23:39 +0000)]
Remove empty space at EOL and escept Ed

Reported by: make manlint
MFC after: 2 days

7 years agoRemove useless .Pp after the .Sh macro and remove empty line
Baptiste Daroussin [Sat, 11 Feb 2017 23:39:14 +0000 (23:39 +0000)]
Remove useless .Pp after the .Sh macro and remove empty line

Reported by: make manlint
MFC after: 2 days

7 years agoEscape No to avoid confusion with the No macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:38:28 +0000 (23:38 +0000)]
Escape No to avoid confusion with the No macro

Reported by: make manlint
MFC after: 2 days

7 years agoAdd missing section after .Xr reference
Baptiste Daroussin [Sat, 11 Feb 2017 23:37:48 +0000 (23:37 +0000)]
Add missing section after .Xr reference

Reported by: make manlint
MFC after: 2 days

7 years agoAdd missing -width after -Bl -tag
Baptiste Daroussin [Sat, 11 Feb 2017 23:36:52 +0000 (23:36 +0000)]
Add missing -width after -Bl -tag

Reported by: make manlint
MFC after: 2 days

7 years agoEscape Ss to avoid confusion by mdoc parser with the Ss macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:14:28 +0000 (23:14 +0000)]
Escape Ss to avoid confusion by mdoc parser with the Ss macro

Reported by: make manlint
MFC after: 2 days

7 years agoRemove empty Li
Baptiste Daroussin [Sat, 11 Feb 2017 23:09:50 +0000 (23:09 +0000)]
Remove empty Li

Reported by: make manlint
MFC after: 2 days

7 years agoRemove space at and of line
Baptiste Daroussin [Sat, 11 Feb 2017 23:06:53 +0000 (23:06 +0000)]
Remove space at and of line

Reported by: make manlint
MFC after: 2 days

7 years agoRevert r313565 -- :mmap__bad_arguments passes again after r313655
Enji Cooper [Sat, 11 Feb 2017 20:31:57 +0000 (20:31 +0000)]
Revert r313565 -- :mmap__bad_arguments passes again after r313655

PR: 216976
Sponsored by: Dell EMC Isilon