]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r303520
vangyzen [Mon, 1 Aug 2016 16:39:40 +0000 (16:39 +0000)]
MFC r303520

Fix markup for -j in cpuset(1) synopsis

Approved by: re (kib)
Sponsored by: Dell Inc.

7 years agoMFC r303519
vangyzen [Mon, 1 Aug 2016 16:24:46 +0000 (16:24 +0000)]
MFC r303519

Fix two return types in the cpuset(9) and bitset(9) man pages

The *_FFS() and *_COUNT() functions return int, not size_t.

Approved by: re (gjb)
Sponsored by: Dell Inc.

7 years agoiMFC r303400: libcxxrt: fix demangling of wchar_t
emaste [Mon, 1 Aug 2016 16:18:01 +0000 (16:18 +0000)]
iMFC r303400: libcxxrt: fix demangling of wchar_t

'wchar_t' is 7 characters long, not 6. r303297 (MFC'd in r303398) fixed
this in libelftc, but not the second copy of this file that we have in
libcxxrt.

PR: 208661
Approved by: re (gjb)

7 years agoMFC r303521: libunwind: correct return code in unwinding trace log message
emaste [Mon, 1 Aug 2016 16:03:20 +0000 (16:03 +0000)]
MFC r303521: libunwind: correct return code in unwinding trace log message

Approved by: re (gjb)

7 years agoMFC r303282: avoid building otusfw when WITHOUT_SOURCELESS_UCODE set
emaste [Mon, 1 Aug 2016 15:49:50 +0000 (15:49 +0000)]
MFC r303282: avoid building otusfw when WITHOUT_SOURCELESS_UCODE set

PR: 204748
Approved by: re (kib)

7 years agoMFC r302614:
kib [Mon, 1 Aug 2016 06:34:55 +0000 (06:34 +0000)]
MFC r302614:
Revive the check, disabled in r197963.

MFC r302999:
On first exec after vfork(), call signotify() to handle pending
reenabled signals.

Approved by: re (delphij)

7 years agoMFC r303424:
kib [Sun, 31 Jul 2016 15:13:51 +0000 (15:13 +0000)]
MFC r303424:
Fix typo in comment.

Approved by: re (gjb)

7 years agoMFC r303456:
dim [Sun, 31 Jul 2016 15:03:31 +0000 (15:03 +0000)]
MFC r303456:

Add tblgen to ObsoleteFiles.inc, as it was renamed to llvm-tblgen.

Approved by: re (kib)
Noticed by: pluknet

7 years agoMFC r302929: Now that potentially buggy versions of Xen are automatically
cperciva [Sat, 30 Jul 2016 20:02:08 +0000 (20:02 +0000)]
MFC r302929: Now that potentially buggy versions of Xen are automatically
detected (see r302635, MFCed as r302895), there is no need to force msix
interrupt migration off via loader.conf.

Reverts: r302184
Approved by: re (gjb)

7 years agoMFC r303213:
kib [Sat, 30 Jul 2016 09:46:29 +0000 (09:46 +0000)]
MFC r303213:
Add missed required call to xo_finish() when only header is printed.

Approved by: re (gjb)

7 years agoMFC r303211:
kib [Sat, 30 Jul 2016 09:28:13 +0000 (09:28 +0000)]
MFC r303211:
Implement mtx_trylock_spin(9).

Approved by: re (gjb)

7 years agoUpdate stable/11 to BETA3 as part of the 11.0-RELEASE cycle.
gjb [Fri, 29 Jul 2016 00:00:54 +0000 (00:00 +0000)]
Update stable/11 to BETA3 as part of the 11.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303202: Update to note that operations on local files are safe.
jhb [Thu, 28 Jul 2016 21:16:18 +0000 (21:16 +0000)]
MFC 303202: Update to note that operations on local files are safe.

Approved by: re (gjb)

7 years agoMFC 303164: Add more documentation regarding unsafe AIO requests.
jhb [Thu, 28 Jul 2016 20:31:30 +0000 (20:31 +0000)]
MFC 303164: Add more documentation regarding unsafe AIO requests.

The asynchronous I/O changes made previously result in different
behavior out of the box. Previously all AIO requests failed with
ENOSYS / SIGSYS unless aio.ko was explicitly loaded. Now, some AIO
requests complete and others ("unsafe" requests) fail with EOPNOTSUPP.

Reword the introductory paragraph in aio(4) to add a general
description of AIO before describing the vfs.aio.enable_unsafe sysctl.

Remove the ENOSYS error description from aio_fsync(2), aio_read(2),
and aio_write(2) and replace it with a description of EOPNOTSUPP.

Remove the ENOSYS error description from aio_mlock(2).

Log a message to the system log the first time a process requests an
"unsafe" AIO request that fails with EOPNOTSUPP. This is modeled on
the log message used for processes using the legacy pty devices.

Approved by: re (gjb)

7 years agoMFC r302897:
robak [Thu, 28 Jul 2016 15:54:17 +0000 (15:54 +0000)]
MFC r302897:

Add new System Hardening menu and options to bsdinstall.

This patch add new 'hardening' file responsible for new bsdinstall
'System Hardening' menu allowing users to set some sane and carefully
picked system security options (like random process id's, hiding
other users/groups processes and others).

All options are OFF by default in this patch due to POLA principle
with intention to turn change some of them to ON by default in future.

Reviewed by: adrian, allanjude, bdrewery, nwhitehorn
Approved by: re@, adrian, allanjude

7 years agoMFC r303154:
kib [Thu, 28 Jul 2016 12:06:40 +0000 (12:06 +0000)]
MFC r303154:
Declare aio requests on files from local filesystems safe.

Approved by: re (gjb)

7 years agoMFC r303151:
kib [Thu, 28 Jul 2016 11:43:25 +0000 (11:43 +0000)]
MFC r303151:
Provide counter_warning(9) KPI.

MFC r303155:
Hide counted_warning(9) under #ifdef _KERNEL braces.

Approved by: re (gjb)

7 years agoMFC r303160.
cy [Wed, 27 Jul 2016 19:39:25 +0000 (19:39 +0000)]
MFC r303160.

Update leap-seconds to leap-seconds.3676752000.

As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16:

                                  UTC TIME STEP
                            on the 1st of January 2017

 A positive leap second will be introduced at the end of December 2016.
 The sequence of dates of the UTC second markers will be:

                          2016 December 31, 23h 59m 59s
                          2016 December 31, 23h 59m 60s
                          2017 January   1,  0h  0m  0s

 The difference between UTC and the International Atomic Time TAI is:

  from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC   : UTC-TAI = - 36s
  from 2017 January 1, 0h UTC, until further notice    : UTC-TAI = - 37s

Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000
See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html
https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16

Relnotes: yes

Approved by: re@ (delphij@)

7 years agoMFC 303109: Update crashinfo to work with newer gdb from ports.
jhb [Wed, 27 Jul 2016 17:55:14 +0000 (17:55 +0000)]
MFC 303109: Update crashinfo to work with newer gdb from ports.

If gdb from ports is installed, use it instead of the base system gdb
to extract variables from a kernel.  Note that base gdb and ports gdb
do not support the same options for invoking a single command in batch
mode, so a wrapper shell function is used.  In addition, prefer kgdb
from ports when generating a backtrace if present.

PR: 193335
Approved by: re (gjb)

7 years agoMFC r303279: libelftc: fix demangling of wchar_t
emaste [Wed, 27 Jul 2016 17:10:09 +0000 (17:10 +0000)]
MFC r303279: libelftc: fix demangling of wchar_t

"wchar_t" is 7 characters long, not 6.

PR: 208661
Submitted by: Daniel McRobb
Approved by: re (kib)
Obtained from: ELF Tool Chain r3480

7 years agoMFC r303090:
kib [Wed, 27 Jul 2016 08:47:24 +0000 (08:47 +0000)]
MFC r303090:
Ensure that the UFS directory vnode' vm_object is properly sized
before UFS_BALLOC() is called.

Approved by: re (delphij)

7 years agoMFC r302842:
ngie [Wed, 27 Jul 2016 06:29:41 +0000 (06:29 +0000)]
MFC r302842:

Don't delete usr/share/local/kk_KZ.UTF-8 with "make delete-old" after r302329

kk_KZ.UTF-8 was originally removed in r290494, but restored as an alias to
en_US.UTF-8 in r302329

Approved by: re (kib)
PR: 211046

7 years agoMFC r303274:
bdrewery [Wed, 27 Jul 2016 05:38:09 +0000 (05:38 +0000)]
MFC r303274:

  Don't disable binutils/elftoolchain bootstrapping with external compiler.

Approved by: re (kib)

7 years agoMFC r303272,r303273:
bdrewery [Wed, 27 Jul 2016 05:17:55 +0000 (05:17 +0000)]
MFC r303272,r303273:

  r303272:
    SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.
  r303273:
    Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.

Approved by: re (kib)

7 years agoMFC r303115:
avos [Tue, 26 Jul 2016 20:26:03 +0000 (20:26 +0000)]
MFC r303115:

urtwn: fix A-MSDU tx aggregation when encryption is used.

Clear unused (undocumented) CAM bytes while setting a key;
without that, hardware does weird things when A-MSDU bit in QoS header
is set.

Tested with RTL8188CUS (AP) -> RTL8188EU (STA) (A-MSDU transmit).

Reported by: many
Approved by: re (gjb)
Obtained from: https://github.com/s3erios/urtwm

7 years agoMFC r303034: Include makewhatis in ITOOLS when MK_MAN_UTILS is true
emaste [Tue, 26 Jul 2016 15:22:21 +0000 (15:22 +0000)]
MFC r303034: Include makewhatis in ITOOLS when MK_MAN_UTILS is true

Previously it was conditional on MK_MAN. It's possible to build
FreeBSD with man pages but without man page tools. MK_MAN_UTILS
is the conditional used in share/man/Makefile for determining whether
makewhatis is executed at install time, so it is the proper one for
ITOOLS as well.

PR: 210142
Approved by: re (gjb)

7 years agoMFC r303046:
pfg [Tue, 26 Jul 2016 14:12:11 +0000 (14:12 +0000)]
MFC r303046:
libc: tag the rune initialization function prototypes visibility as hidden.

It is good practice to export as few symbols as possible from your shared
libraries, so use the GCC visibility attribute in this case, matching what
Apple's libc does.

Reference:
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

Hinted by: Apple's libc 1082.20.4
Approved by: re (gjb)

7 years agoMFC: r303039
manu [Tue, 26 Jul 2016 05:52:53 +0000 (05:52 +0000)]
MFC: r303039

Do not use TERM_EMU on arm and arm64 as it doesn't behave
well with serial console.

Approved by: re (gjb)

7 years agoMFC: r302790, r302795
allanjude [Tue, 26 Jul 2016 05:27:26 +0000 (05:27 +0000)]
MFC: r302790, r302795

Add new menu to bsdinstall to allow user to set date and time after
selecting timezone. The 'skip' button is the default selection.

Submitted by: des
Approved by: re (gjb)

7 years agoMFC: r302940
allanjude [Tue, 26 Jul 2016 05:26:53 +0000 (05:26 +0000)]
MFC: r302940

Fix error in bsdinstall triggered when doing a GELI encrypted install to
an MBR formatted disk

Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

7 years agoMFC: r302941
allanjude [Tue, 26 Jul 2016 05:26:07 +0000 (05:26 +0000)]
MFC: r302941

At the start of the installation process, all ZFS pools are exported and
all GELI instances are detached, to allow a restarted install to proceed.

PR: 210814
Approved by: re (gjb)

7 years agoMFC 302899: Add documentation for the sigevent structure.
jhb [Mon, 25 Jul 2016 23:37:47 +0000 (23:37 +0000)]
MFC 302899: Add documentation for the sigevent structure.

- Add a sigevent(3) manpage to give a general overview of the sigevent
  structure and the available notification mechanisms.
- Document that AIO requests contain a nested sigevent structure that can
  be used to request completion notification.
- Expand the sigevent details in other manuals to note details such as
  the extra values stored in a queued signal's information or in a posted
  kevent.

Approved by: re (gjb)

7 years agoMFC r303091
asomers [Mon, 25 Jul 2016 20:02:11 +0000 (20:02 +0000)]
MFC r303091

Fix camdd for host-aware and host-managed SMR disks.
This should've gone in as part of r300207

Approved by: re (gjb)

7 years agoMerge LLVM libunwind fixes
emaste [Mon, 25 Jul 2016 19:37:10 +0000 (19:37 +0000)]
Merge LLVM libunwind fixes

r302475: libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

r303061: libunwind: Properly align _Unwind_Exception.

_Unwind_Exception is required to be double word aligned.  GCC has
interpreted this to mean "use the maximum useful alignment for the
target" so follow that lead.

PR: 206384 (r302475)
Obtained from: LLVM review D22543 (r303061)
Approved by: re (gjb)

7 years agoMFC 302861: Fix rendering issues.
jhb [Mon, 25 Jul 2016 19:16:49 +0000 (19:16 +0000)]
MFC 302861: Fix rendering issues.

- Use Ta to separate column headers.
- Correct width of the 'Code' column in the last table.

Approved by: re (gjb)

7 years agoMFC r303195:
bdrewery [Mon, 25 Jul 2016 18:25:19 +0000 (18:25 +0000)]
MFC r303195:

  Don't run find(1) for __MPATH with NO_MODULES set.

Approved by: re (gjb)

7 years agoMFC r303043:
bdrewery [Mon, 25 Jul 2016 17:37:02 +0000 (17:37 +0000)]
MFC r303043:

  Increase vt(4) framebuffer maximum size

PR: 210382
Approved by: re (gjb)

7 years agoMFC r303199:
np [Mon, 25 Jul 2016 17:17:59 +0000 (17:17 +0000)]
MFC r303199:

ctld(8): Fix MaxBurstLength negotiation.

The target must reply with the selected value of MaxBurstSize instead of
just echoing back the initiator's offered value.

Reviewed by: mav@
Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7278

7 years agoMFC 302860: Fix aio system call wrappers in librt.
jhb [Mon, 25 Jul 2016 15:56:37 +0000 (15:56 +0000)]
MFC 302860: Fix aio system call wrappers in librt.

- Update aio_return/waitcomplete wrappers for the ssize_t return type.
- Fix the aio_return() wrapper to fail with EINVAL on a pending job.
  This matches the semantics of the in-kernel system call.  Also,
  aio_return() returns errors via errno, not via the return value.

Approved by: re (gjb)
Sponsored by: Chelsio Communications

7 years agoMFC r302911:
pfg [Mon, 25 Jul 2016 15:03:14 +0000 (15:03 +0000)]
MFC r302911:
mail(1): Avoid closing negative file descriptors.

CID: 10081051008106
Approved by: re (gjb)

7 years agoFix bspatch heap overflow vulnerability.
delphij [Mon, 25 Jul 2016 14:52:12 +0000 (14:52 +0000)]
Fix bspatch heap overflow vulnerability.

Obtained from: Chromium
Reported by: Lu Tung-Pin
Security: FreeBSD-SA-16:25.bspatch
Approved by: re (so@ blanket)

7 years agoMFC r302542:
delphij [Mon, 25 Jul 2016 14:35:48 +0000 (14:35 +0000)]
MFC r302542:

Use _PATH_DEVNULL instead of hardcoding.

Approved by: re (kib)

7 years agoMFC r303157: libcxxrt: add padding in __cxa_allocate_* to fix alignment
emaste [Mon, 25 Jul 2016 14:16:28 +0000 (14:16 +0000)]
MFC r303157: libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302567:
kib [Mon, 25 Jul 2016 13:28:59 +0000 (13:28 +0000)]
MFC r302567:
In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called,
if vnode is VMIO.  For VMIO vnodes, set BO_DEAD in vm_object_terminate().

MFC r302580:
Fix grammar.

Approved by: re (gjb)

7 years agoMFC r303032
sbruno [Sun, 24 Jul 2016 16:32:34 +0000 (16:32 +0000)]
MFC r303032
Fixup DA cable detection routines to not set the cable type to
unknown if they do not match one of two cable types.

PR: 150249
Approved by: re (gjb)

7 years agoMFC r302904:
tuexen [Sun, 24 Jul 2016 14:50:16 +0000 (14:50 +0000)]
MFC r302904:
Fix a bug which results in a core dump when running netstat with
the -W option and having a listening SCTP socket.
The bug was introduced in r279122 when adding support for libxo.

MFC r302907:
When calling netstat -Laptcp the local address values are not aligned
with the corresponding entry in the table header. r295136
increased the value width from 14 to 32 without the corresponding
change to the table header. This commit adds the change to the table
header width.

MFC r302917:
Ensure that the -a, -W, -L options for SCTP behave similar
as for TCP.

MFC r302928:
Address a potential memory leak found a the clang static code analyzer
running on the userland stack.

MFC r302930:
Don't free a data chunk twice.
Found by the clang static code analyzer running for the userland stack.

MFC r302935:
Deal with a portential memory allocation failure, which was reported
by the clang static code analyzer.
Joint work with rrs@.

MFC r302942:
Add missing sctps_reasmusrmsgs counter.
Joint work with rrs@.

MFC r302945:
Don't duplicate code for SCTP, just use the ones used for UDP and TCP.
This fixes a bug with link local addresses. This will require and
upcoming change in the kernel to bring SCTP to the same behaviour
as UDP and TCP.

MFC r302949:
Fix the PR-SCTP behaviour.
This is done by rrs@.

MFC r302950:
Add a constant required by RFC 7496.

MFC r303024:
netstat and sockstat expect the IPv6 link local addresses to
have an embedded scope. So don't recover.

MFC r303025:
Use correct order of conditions to avoid NULL deref.

MFC r303073:
Fix a bug in deferred stream reset processing which results
in using a length field before it is set.
Thanks to Taylor Brandstetter for reporting the issue and
providing a fix.

Approved by: re (kib)

7 years agoMFC r303132:
trasz [Sun, 24 Jul 2016 10:00:29 +0000 (10:00 +0000)]
MFC r303132:

Add documentation for "ctld -u", the UCL configuration file format.

Submitted by: jceel@
Approved by: re (kib)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7222

7 years agoMFC: r303219
bapt [Sun, 24 Jul 2016 09:00:16 +0000 (09:00 +0000)]
MFC: r303219

Add weekday to the date format of more locales
Approved by: re (kib)

7 years agoiDo not try to delete the home of the user if is is not a directory for example
bapt [Sun, 24 Jul 2016 08:12:23 +0000 (08:12 +0000)]
iDo not try to delete the home of the user if is is not a directory for example
"/dev/null"

PR: 211195
Submitted by: rday <ryan@ryanday.net>
Reported by: eniorm <eniorm@gmail.com>
Approved by: re (kib)

7 years agoMFC r303101
alc [Sat, 23 Jul 2016 21:56:52 +0000 (21:56 +0000)]
MFC r303101
  Add a comment describing the 'fast path' that was introduced in r270011.

Approved by: re (gjb)

7 years agoMFC 302858: Move nested include of <sys/queue.h> inside _KERNEL.
jhb [Sat, 23 Jul 2016 17:37:59 +0000 (17:37 +0000)]
MFC 302858: Move nested include of <sys/queue.h> inside _KERNEL.

This removes namespace pollution for userland brought in by r299122.

PR: 210319
Approved by: re (kib)

7 years agoMFC r302936:
kib [Sat, 23 Jul 2016 08:23:57 +0000 (08:23 +0000)]
MFC r302936:
Explicitely check for the valid range of file descriptor values.

Approved by: re (gjb)

7 years agoMFC r302919:
kib [Fri, 22 Jul 2016 17:34:58 +0000 (17:34 +0000)]
MFC r302919:
In ptrace_vm_entry(), do not call vmspace_free() while owning a vm
object lock.

Approved by: re (gjb)

7 years agoMFC libunwind improvements
emaste [Fri, 22 Jul 2016 17:34:28 +0000 (17:34 +0000)]
MFC libunwind improvements

r302450: libunwind: update to upstream snapshot r272680

The key improvement is that it may be built without cross-unwinding
support, which significantly reduces the stack space requirement.

r302456: libunwind: enable only the native unwinder by default

This significantly reduces stack space requirements, and runtimes
require only native unwinding.

r302475: libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

r303016: llvm-libunwind: use conventional (non-Darwin) X86 register numbers

For historical reasons Darwin/i386 has ebp and esp swapped in the
eh_frame register numbering.  That is:

              Darwin      Other
    Reg #    eh_frame    eh_frame    DWARF
    =====    ========    ========    =====
      4        ebp         esp        esp
      5        esp         ebp        ebp

Although the UNW_X86_* constants are not supposed to be coupled to
DWARF / eh_frame numbering they are currently conflated in LLVM
libunwind, and thus we require the non-Darwin numbering.

PR: 206384
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302908:
bdrewery [Fri, 22 Jul 2016 17:24:36 +0000 (17:24 +0000)]
MFC r302908:

  Fix dlsym(RTLD_NEXT) handling to only return the next library in last library
  cases.

Approved by: re (gjb)

7 years agoMFC r302893:
kib [Fri, 22 Jul 2016 17:22:37 +0000 (17:22 +0000)]
MFC r302893:
Do not allow creation of char or block special nodes with VNOVAL dev_t.

Approved by: re (gjb)

7 years agoMFC r303031: clang++: Always use --eh-frame-hdr on FreeBSD, even for -static
emaste [Fri, 22 Jul 2016 12:55:31 +0000 (12:55 +0000)]
MFC r303031: clang++: Always use --eh-frame-hdr on FreeBSD, even for -static

FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and we expect to
use it more widely in the future) and it requires the EH frame segment
in static binaries.

Approved by: re (kib)

7 years agoUpdate stable/11 to BETA2 as part of the 11.0-RELEASE cycle.
gjb [Fri, 22 Jul 2016 00:00:09 +0000 (00:00 +0000)]
Update stable/11 to BETA2 as part of the 11.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoDisable debugging options in arm configurations.
ian [Thu, 21 Jul 2016 22:13:40 +0000 (22:13 +0000)]
Disable debugging options in arm configurations.

Approved by: re (gjb)

7 years agoMFC r302980
alc [Thu, 21 Jul 2016 20:11:43 +0000 (20:11 +0000)]
MFC r302980
  Break up vm_fault()'s implementation of the read-ahead and delete-behind
  optimizations into two distinct pieces.  The first piece consists of the
  code that should only be performed once per page fault and requires the
  map to be locked.  The second piece consists of the code that should be
  performed each time a pager is called on an object in the shadow chain.
  (This second piece expects the map to be unlocked.)

  Previously, the entire implementation could be executed multiple times.
  Moreover, the second and subsequent executions would occur with the map
  unlocked.  Usually, the ensuing unsynchronized accesses to the map were
  harmless because the map was not changing.  Nonetheless, it was possible
  for a use-after-free error to occur, where vm_fault() wrote to a freed
  map entry.  This change corrects that problem.

Approved by: re (gjb)

7 years agoMerge r302894, r303098: fix regression caused by r302350. Stopping a
glebius [Thu, 21 Jul 2016 19:18:49 +0000 (19:18 +0000)]
Merge r302894, r303098: fix regression caused by r302350. Stopping a
not scheduled not running callout should return (-1).

PR: 210884
Approved by: re (gjb)

7 years agoMFC r302981:
kib [Thu, 21 Jul 2016 12:50:23 +0000 (12:50 +0000)]
MFC r302981:
Fix another bug after r302350.

Approved by: re (gjb)

7 years agoMFC r302960: Restore PIM_ATA_EXT flag handling, lost at r300207.
mav [Thu, 21 Jul 2016 12:15:04 +0000 (12:15 +0000)]
MFC r302960: Restore PIM_ATA_EXT flag handling, lost at r300207.

This re-enables NCQ TRIM usage on capable hardware (bhyve).

Approved by: re (kib)

7 years agoMFC r302957: Fix NCQ TRIM emulation.
mav [Thu, 21 Jul 2016 11:57:41 +0000 (11:57 +0000)]
MFC r302957: Fix NCQ TRIM emulation.

When this code was written, there was no guests using it to test.

Approved by: re (kib)

7 years agoUpdate if_hwassist when interface options are changed.
mav [Thu, 21 Jul 2016 11:39:43 +0000 (11:39 +0000)]
Update if_hwassist when interface options are changed.

In particular for me this fixes checksum problem when if_bridge attached
to the interface requests TXCSUM to be disabled, but effectively ignored.

Approved by: re (kib)

7 years agoMFC r303003:
gjb [Thu, 21 Jul 2016 10:44:26 +0000 (10:44 +0000)]
MFC r303003:

 Make sure we clean up the rdoc and reldoc directories if NODOC
 is not set.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC: r302916
bapt [Wed, 20 Jul 2016 20:12:58 +0000 (20:12 +0000)]
MFC: r302916

Revert 302324 and properly fix the crash with ISO-8859-5 locales

PR: 211135
Reported by: jkim
Tested by: jkim
Approved by: re (gjb)

7 years agoMFC r302770:
kib [Wed, 20 Jul 2016 15:02:37 +0000 (15:02 +0000)]
MFC r302770:
Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.

Approved by: re (gjb)

7 years agoMFC r302973:
pfg [Wed, 20 Jul 2016 04:45:59 +0000 (04:45 +0000)]
MFC r302973:
sed(1): Fix off by one introduced in r299211.

Detected by running the gsed tests.

Submitted by: Mikhail Teterin
PR: 195929
Approved by: re (gjb)

7 years agoMFC r302673
slm [Tue, 19 Jul 2016 16:46:27 +0000 (16:46 +0000)]
MFC r302673
Use real values to calculate Max I/O size instead of guessing.

Reviewed by: ken, scottl
Approved by: re(gjb), ken, scottl, ambrisko (mentors)
Differential Revision: https://reviews.freebsd.org/D7043

7 years agoReduce the disc1.iso size from 850+M to just over 650M.
gjb [Tue, 19 Jul 2016 16:22:50 +0000 (16:22 +0000)]
Reduce the disc1.iso size from 850+M to just over 650M.

As a result of this change, the 'kernel-dbg.txz' distribution
is no longer provided on disc1.iso, and deselected by default
in bsdinstall(8).  When 'kernel-dbg.txz' is selected, network
configuration happens before the installer proceeds, to fetch
the distribution from the mirrors.

This is a direct commit to stable/11, as there is intention
to solve this differently for 12.0-RELEASE.

Reviewed by: nwhitehorn (glanced at)
Approved by: re (hrs)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302518, r302626:
dchagin [Mon, 18 Jul 2016 16:39:53 +0000 (16:39 +0000)]
MFC r302518, r302626:

Add linux_mmap.c to the appropriate conf/files.

Approved by: re (gjb)

7 years agoMFC r302517:
dchagin [Mon, 18 Jul 2016 16:38:06 +0000 (16:38 +0000)]
MFC r302517:

Fix a copy/paste bug introduced during X86_64 Linuxulator work.
FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation
use READ_IMPLIES_EXEC flag, introduced in r302515.

While here move common part of mmap() and mprotect() code to the files in compat/linux
to reduce code dupcliation between Linuxulator's

Approved by: re (gjb)

7 years agoMFC r302516:
dchagin [Mon, 18 Jul 2016 16:35:44 +0000 (16:35 +0000)]
MFC r302516:

Regen for r302515 (Linux personality).

Approved by: re (gjb)

7 years agoMFC r302515:
dchagin [Mon, 18 Jul 2016 16:34:11 +0000 (16:34 +0000)]
MFC r302515:

Implement Linux personality() system call mainly due to READ_IMPLIES_EXEC flag.
In Linux if this flag is set, PROT_READ implies PROT_EXEC for mmap().
Linux/i386 set this flag automatically if the binary requires executable stack.

READ_IMPLIES_EXEC flag will be used in the next Linux mmap() commit.

Approved by: re (gjb)

7 years agoMFC r302772: re-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of
avg [Mon, 18 Jul 2016 07:06:44 +0000 (07:06 +0000)]
MFC r302772: re-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of
snapshot's root

The change has been undone in r301275 on the assumption that it was no
longer required.  But that was incorrect, because in this case (and only
in this case) the snapshot root vnode is looked up before z_parent is
fixed up.

Approved by: re (delphij)

7 years agoMFC r302573:
kib [Mon, 18 Jul 2016 04:33:12 +0000 (04:33 +0000)]
MFC r302573:
Fill tf_trapno for trap frames created for syscall.

Approved by: re (gjb)

7 years agoMFC r302561,302565:
ae [Mon, 18 Jul 2016 04:16:53 +0000 (04:16 +0000)]
MFC r302561,302565:
  Flush buffer after output. This fixes adding new data to already
  printed flows.

  PR: 210882
Approved by: re (kib)

7 years agoMFC r302511, r302771, r302845:
pfg [Sun, 17 Jul 2016 18:23:20 +0000 (18:23 +0000)]
MFC r302511, r302771, r302845:
mail(1): check for out of memory conditions when calling calloc(3).

Approved by: re (gjb)

7 years agoMFC r302857:
jamie [Sun, 17 Jul 2016 14:07:51 +0000 (14:07 +0000)]
MFC r302857:

  Start jails non-parallel if jail_parallel_start is NO.  This was true
  for an explicitly specified jail list; now it's also true for all jails.

PR: 209112
Approved by: re (gjb)

7 years agoMFC r302856:
jamie [Sun, 17 Jul 2016 14:06:17 +0000 (14:06 +0000)]
MFC r302856:

  Fix up the order in which jail creation processes are run, to preserve
  the config file's order in the non-parallel-start case.

PR: 209112
Approved by: re (gjb)

7 years agoMFC r302855:
jamie [Sun, 17 Jul 2016 14:05:11 +0000 (14:05 +0000)]
MFC r302855:

  Wait for jails to complete startup if jail_parallel_start is YES,
  instead of assuming they'll take less than one second.

PR: 203172
Submitted by: dmitry2004@yandex.ru
Approved by: re (gjb)

7 years agoMFC r302787
vangyzen [Sat, 16 Jul 2016 15:52:14 +0000 (15:52 +0000)]
MFC r302787

zpool(8): update Hot Spares section to mention zfsd(8)

Approved by: re (gjb)

7 years agoMFC r302784:
dim [Sat, 16 Jul 2016 10:50:28 +0000 (10:50 +0000)]
MFC r302784:

Fix a page fault in ip6_setpktopt(), occurring when the pflog module is
loaded, and syncthing is started, which uses setsockopt(IPV6_PKGINFO).

This is because pflog interfaces do not normally have an IPv6 address,
causing the ND_IFINFO() macro to dereference a NULL pointer.

Approved by: re (kib)
Reviewed by: ae
PR: 210943

7 years agoMFC r302667
truckman [Sat, 16 Jul 2016 06:41:02 +0000 (06:41 +0000)]
MFC r302667

Fix problems in the FQ-PIE AQM cleanup code that could leak memory or
cause a crash.

Because dummynet calls pie_cleanup() while holding a mutex, pie_cleanup()
is not able to use callout_drain() to make sure that all callouts are
finished before it returns, and callout_stop() is not sufficient to make
that guarantee.  After pie_cleanup() returns, dummynet will free a
structure that any remaining callouts will want to access.

Fix these problems by allocating a separate structure to contain the
data used by the callouts.  In pie_cleanup(), call callout_reset_sbt()
to replace the normal callout with a cleanup callout that does the cleanup
work for each sub-queue.  The instance of the cleanup callout that
destroys the last flow will also free the extra allocated block of memory.
Protect the reference count manipulation in the cleanup callout with
DN_BH_WLOCK() to be consistent with all of the other usage of the reference
count where this lock is held by the dummynet code.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7174

7 years agoMFC r302502, r302505:
ian [Fri, 15 Jul 2016 21:30:19 +0000 (21:30 +0000)]
MFC r302502, r302505:

  Consolidate debugging options from all arm kernel configs to std.arm[v6].

  Correct syntax errors that only show up when compiled with INVARIANTS.

Approved by: re (gjb)

7 years agoMFC r302507:
markj [Fri, 15 Jul 2016 20:26:28 +0000 (20:26 +0000)]
MFC r302507:
Avoid truncating the return value of DTrace predicates.

Approved by: re (gjb)

7 years agoMFC r302674:
bdrewery [Fri, 15 Jul 2016 19:58:05 +0000 (19:58 +0000)]
MFC r302674:

  META_MODE: Don't require filemon(4) for mergemaster(8)/etcupdate(8)

Approved by: re (gjb)

7 years agoMFC r302635:
royger [Fri, 15 Jul 2016 09:44:48 +0000 (09:44 +0000)]
MFC r302635:

xen: automatically disable MSI-X interrupt migration

Approved by: re (kib)

7 years agoMFC 302541,302605
sephe [Fri, 15 Jul 2016 02:24:39 +0000 (02:24 +0000)]
MFC 302541,302605

302541
    hyperv/stor: Fix the INQUIRY checks

    Don't check the area that the host has not filled.

    PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209443
    PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210425
    Submitted by:       Hongjiang Zhang <honzhan microsoft com>
    Reviewed by:        sephe, Dexuan Cui <decui microsoft com>
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6955

302605
    hyperv/stor: Save the response status and xfer length properly.

    The current command response handling discards status and xfer
    length unconditionally, so that all of the commands would be
    considered successful, even if errors happened.  When errors
    really happens, this causes all kinds of wiredness, since the
    buffer will not be filled on the host side and sense data will
    be ignored.

    Most of the time, errors do not happen, however, error does
    happen for the request sent immediately after the disk resizing.
    Discarding the SCSI status (SCSI_STATUS_CHECK_COND) and sense
    data (capacity changes) prevents the disk resizing from working
    properly.

    This commit saves the response status and xfer length properly
    for later use.

    Submitted by:       Dexuan Cui <decui microsoft com>
    Noticed by: sephe
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D7181

Approved by: re (gjb)

7 years agoRemove GENERIC-NODEBUG kernel configurations, missed during
gjb [Thu, 14 Jul 2016 08:20:17 +0000 (08:20 +0000)]
Remove GENERIC-NODEBUG kernel configurations, missed during
the stable/11 branch.

This is a direct commit to stable/11.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoRemove the 'debug.witness.trace' entry, as WITNESS is not
gjb [Thu, 14 Jul 2016 08:19:25 +0000 (08:19 +0000)]
Remove the 'debug.witness.trace' entry, as WITNESS is not
enabled on stable branches by default.

This is a direct commit to stable/11.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302476:
pfg [Wed, 13 Jul 2016 15:51:58 +0000 (15:51 +0000)]
MFC r302476:
ng_mppc(4):: basic code readability cleanups.

In particular use __unreachable() to appease static analyzers.
No functional change.

CID: 1356591
Approved by: re (gjb)

7 years agoMFC r302439:
bdrewery [Tue, 12 Jul 2016 17:22:13 +0000 (17:22 +0000)]
MFC r302439:

  iflib: Fix typo in 'iflib_rx_miss_bufs' sysctl name

Approved by: re (gjb)

7 years agoMFC r302503:
trasz [Tue, 12 Jul 2016 13:12:01 +0000 (13:12 +0000)]
MFC r302503:

Fix ctld(8) to not exit when reloading configuration with invalid
initiator-portal clause.

Approved by: re (gjb)

7 years agoMFC r302448:
ed [Tue, 12 Jul 2016 06:25:28 +0000 (06:25 +0000)]
MFC r302448:

  Don't forget to set sa->narg for CloudABI system calls.

  It turns out that this value is not used within the system call code
  under normal conditions, except when using tracing tools like ktrace.
  If we forget to set this value, it is set to random garbage. This may
  cause ktrace to hang indefinitely, making it impossible to kill.

Approved by: re@
Reported by: Michael Plass
PR: 210800

7 years agoMFC r302532:
ngie [Tue, 12 Jul 2016 06:06:10 +0000 (06:06 +0000)]
MFC r302532:

Correct OLD_LIBS change done in r298840

libkvm.so lives in /lib, not /usr/lib

Approved by: re (gjb)

7 years agoFix the branch name in the release notes.
gjb [Mon, 11 Jul 2016 14:24:50 +0000 (14:24 +0000)]
Fix the branch name in the release notes.

Approved by: re (implicit, relnotes)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302534:
delphij [Mon, 11 Jul 2016 04:50:32 +0000 (04:50 +0000)]
MFC r302534:

Allow - in distribution names.  This is needed for freebsd-update to
work with 11.0+, where the debugging symbols use a new naming scheme
for release distribution files.

Errata candidate.

Approved by: re (gjb)

7 years agoTurn off WITNESS, INVARIANTS, etc., in the powerpc GENERIC64
gjb [Sun, 10 Jul 2016 17:16:56 +0000 (17:16 +0000)]
Turn off WITNESS, INVARIANTS, etc., in the powerpc GENERIC64
kernel configuration, missed after the stable/11 branch.

Approved by: re (kib)
PR: 210974
Sponsored by: The FreeBSD Foundation