61 min agoReally fix the style. master github/master
lwhsu [Tue, 19 Jun 2018 18:43:02 +0000 (18:43 +0000)]
Really fix the style.

Approved by: oshogbo
Sponsored by: The FreeBSD Foundation

72 min agotop(1): Fix Coverity warning
asomers [Tue, 19 Jun 2018 18:32:06 +0000 (18:32 +0000)]
top(1): Fix Coverity warning

Don't call strerror on negative errnos

Reported by: Coverity
CID: 976708
Reviewed by: eadler
Differential Revision:

79 min agostyle(9) fix, I was also going to silence gcc.
lwhsu [Tue, 19 Jun 2018 18:25:43 +0000 (18:25 +0000)]
style(9) fix, I was also going to silence gcc.

Approved by: emaste, oshogbo
Sponsored by: The FreeBSD Foundation

95 min agoSet prev to NULL so its garaunteed to have a value of some kind and
sbruno [Tue, 19 Jun 2018 18:09:15 +0000 (18:09 +0000)]
Set prev to NULL so its garaunteed to have a value of some kind and
gcc doesn't explode.  Feel free to fix this correctly or whatever for
gcc builds.

This *should* quiesce tinderbox after r335347 for the gcc builds.

2 hours agoaudit(4): add tests for sendmsg, recvmsg, shutdown, and sendfile
asomers [Tue, 19 Jun 2018 17:41:46 +0000 (17:41 +0000)]
audit(4): add tests for sendmsg, recvmsg, shutdown, and sendfile

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

2 hours agousr.bin/ar: remove incorrect SPDX tags
emaste [Tue, 19 Jun 2018 17:30:11 +0000 (17:30 +0000)]
usr.bin/ar: remove incorrect SPDX tags

Three ar files have a non-standard variation of the BSD license, so
remove their SPDX tags.

Sponsored by: The FreeBSD Foundation

2 hours agousr.bin/ar: use standard 2-Clause FreeBSD license
emaste [Tue, 19 Jun 2018 17:28:05 +0000 (17:28 +0000)]
usr.bin/ar: use standard 2-Clause FreeBSD license

Many licenses on ar files contained small variations from the standard
FreeBSD license text. To avoid license proliferation switch to the usual
standard 2-clause FreeBSD license for those files where I have obtained
permission from all of the listed copyright holders.

Approved by: jkoshy, kaiw
Differential Revision:

2 hours agoaudit(4): add tests for utimes(2) and friends, mprotect, and undelete
asomers [Tue, 19 Jun 2018 16:55:39 +0000 (16:55 +0000)]
audit(4): add tests for utimes(2) and friends, mprotect, and undelete

Includes utimes(2), futimes(2), lutimes(2), futimesat(2), mprotect(2), and
undelete(2).  undelete, for now, is tested only in failure mode.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

3 hours agoMove common GIC interrupt numbers to the common header. These are the same
andrew [Tue, 19 Jun 2018 16:14:23 +0000 (16:14 +0000)]
Move common GIC interrupt numbers to the common header. These are the same
across the GICv2 and GICv3 drivers so we only need a single copy of them.

Sponsored by: Turing Robotic Industries

3 hours agoRemove "diff" line indicator. Next to see if this code works or not.
sbruno [Tue, 19 Jun 2018 15:55:21 +0000 (15:55 +0000)]
Remove "diff" line indicator.  Next to see if this code works or not.

Submitted by: mmacy
Sponsored by: Limelight Networks

4 hours agolualoader: Correct kernel_options handling
kevans [Tue, 19 Jun 2018 15:05:31 +0000 (15:05 +0000)]
lualoader: Correct kernel_options handling

`kernel_options` were being passed as flags to load, rather than to the
kernel being loaded. This is the kernel_options counterpart to r335009.

4 hours agoo Implement unw_getcontext()
br [Tue, 19 Jun 2018 14:46:59 +0000 (14:46 +0000)]
o Implement unw_getcontext()
o Restore floating-point registers in jumpto()

These are required to native cross build GCC and GDB
(both do require libc++ and libunwind).

These are not tested.

Sponsored by: DARPA, AFRL

6 hours agoDon't use TARGET_ARCH in this file, use MACHINE_ARCH instead.
br [Tue, 19 Jun 2018 13:28:02 +0000 (13:28 +0000)]
Don't use TARGET_ARCH in this file, use MACHINE_ARCH instead.

TARGET_ARCH is not defined when building ports/packages.

Sponsored by: DARPA, AFRL

7 hours agoshare/misc/ updates
pi [Tue, 19 Jun 2018 12:16:19 +0000 (12:16 +0000)]
share/misc/ updates

- add krion, philip to postmaster@
- remove trhodes from donations@, email bounces

Approved by: remko

8 hours agoDon't try to turn power down MMC bus if it is already down
kibab [Tue, 19 Jun 2018 11:28:50 +0000 (11:28 +0000)]
Don't try to turn power down MMC bus if it is already down

Regulator framework doens't like turning off already turned off
regulators, so we get panic on AllWinner boards.

Approved by: imp (mentor)
Differential Revision:

8 hours agoCorrectly define rawscr so initializing it doesn't result in overwriting memory.
kibab [Tue, 19 Jun 2018 11:25:40 +0000 (11:25 +0000)]
Correctly define rawscr so initializing it doesn't result in overwriting memory.

We need 8 bytes of storage for rawscr.

Approved by: imp (mentor)
Differential Revision:

8 hours agoSet MMC_DATA_MULTI flag when doing multi-block transfers
kibab [Tue, 19 Jun 2018 11:23:48 +0000 (11:23 +0000)]
Set MMC_DATA_MULTI flag when doing multi-block transfers

Lower layers (MMC / SDHCI controller drivers) may make certain decisions
based on the presence of this flag. The fact that sdhci.c doesn't
look at this flag is another problem that should be fixed separately.

Found when adding MMCCAM support to AllWinner MMC controller driver
where the presence of this flag actually matters.

Approved by: imp (mentor)
Differential Revision:

8 hours agoMake sure that the t_peakrate_thr is not compiled in
rrs [Tue, 19 Jun 2018 11:20:28 +0000 (11:20 +0000)]
Make sure that the t_peakrate_thr is not compiled in
by default until NF can upstream it.

Reviewed by: and suggested lstewart
Sponsored by: Netflix Inc.

9 hours agoMove BPFIF_* macro definitions into .c file, where struct bpf_if is
ae [Tue, 19 Jun 2018 10:34:45 +0000 (10:34 +0000)]
Move BPFIF_* macro definitions into .c file, where struct bpf_if is

They are only used in this file and there is no need to export them via

14 hours agoMove the tp set back to where it was before
rrs [Tue, 19 Jun 2018 05:28:14 +0000 (05:28 +0000)]
Move the tp set back to where it was before
we started playing with the VNET sets. This
way we have verified the INP settings before
we go to the trouble of de-referencing it.

Reviewed by: and suggested by lstewart
Sponsored by: Netflix Inc.

14 hours agotop(1): correct assertion
eadler [Tue, 19 Jun 2018 05:01:07 +0000 (05:01 +0000)]
top(1): correct assertion

15 hours agotop(1): correct header in UP mode
eadler [Tue, 19 Jun 2018 04:18:23 +0000 (04:18 +0000)]
top(1): correct header in UP mode

Fix an oversight from r334869 which made the same change, but only for
SMP systems. This avoids a segfault while D15801 is being reviewed.

Reviewed by: kevans

16 hours agoixl(4): Remove ixlvc.c from files.amd64
erj [Tue, 19 Jun 2018 03:11:09 +0000 (03:11 +0000)]
ixl(4): Remove ixlvc.c from files.amd64

ixlvc.c is only used by the VF driver (ixlv), and that driver currently doesn't work.

It will be re-added once the VF driver is finished being ported to iflib.

16 hours agoremove ixl iwarp and ixlv from the build until they are in a working state
mmacy [Tue, 19 Jun 2018 02:48:53 +0000 (02:48 +0000)]
remove ixl iwarp and ixlv from the build until they are in a working state

17 hours agoconvert inpcbinfo hash and info rwlocks to epoch + mutex
mmacy [Tue, 19 Jun 2018 01:54:00 +0000 (01:54 +0000)]
convert inpcbinfo hash and info rwlocks to epoch + mutex

- Convert inpcbinfo info & hash locks to epoch for read and mutex for write
- Garbage collect code that handled INP_INFO_TRY_RLOCK failures as
  INP_INFO_RLOCK which can no longer fail

When running 64 netperfs sending minimal sized packets on a 2x8x2 reduces
unhalted core cycles samples in rwlock rlock/runlock in udp_send from 51% to

Overall packet throughput rate limited by CPU affinity and NIC driver design

On the receiver unhalted core cycles samples in in_pcblookup_hash went from
13% to to 1.6%

Tested by LLNW and pho@

Reviewed by: jtl
Sponsored by: Limelight Networks
Differential Revision:

18 hours agoFix amq -i timestamp segmentation violation.
cy [Tue, 19 Jun 2018 01:33:03 +0000 (01:33 +0000)]
Fix amq -i timestamp segmentation violation.

MFC after: 1 week

18 hours agoaudit(4): add tests for ioctl(2)
asomers [Tue, 19 Jun 2018 01:32:33 +0000 (01:32 +0000)]
audit(4): add tests for ioctl(2)

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

18 hours agoDon't bootstrap lld if an external linker is used.
bdrewery [Tue, 19 Jun 2018 01:00:27 +0000 (01:00 +0000)]
Don't bootstrap lld if an external linker is used.

Sponsored by: Dell EMC

18 hours agocxgbe(4): Some mailbox commands require access to the Tx pipeline and
np [Tue, 19 Jun 2018 00:50:27 +0000 (00:50 +0000)]
cxgbe(4): Some mailbox commands require access to the Tx pipeline and
can time out if it's backed up due to a non-stop deluge of PAUSE frames
from a misbehaving peer.  Detect this situation and toggle MPS TxEn
to allow forward progress.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

19 hours agortwn(4): decode some bit fields + merge duplicate code.
avos [Tue, 19 Jun 2018 00:38:28 +0000 (00:38 +0000)]
rtwn(4): decode some bit fields + merge duplicate code.

Add macros for R12A_RXDMA_PRO register (descriptions were seen in the
RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies.

No functional change intended.

19 hours agoAdd my script for coping with git-svn and the need to rebase
imp [Tue, 19 Jun 2018 00:27:30 +0000 (00:27 +0000)]
Add my script for coping with git-svn and the need to rebase
changes for different branches. It's a bit rough right now,
but should be good enough for most people to try to use. It's
definitely 'tools' tree quality.

20 hours agoSwitch to creating UEFI ESPs using loader.efi instead of boot1.efi.
imp [Mon, 18 Jun 2018 23:16:47 +0000 (23:16 +0000)]
Switch to creating UEFI ESPs using loader.efi instead of boot1.efi.
Cope for the fact that laoder.efi, not being boot1, doesn't read
/boot.config by setting boot_serial and force the serial console.

Also add sysctl so we can display the boot method.

Provide a variable, do_boot1_efi, if you want to use boot1 for
testing. But since it's transient, it's just a variable and not
available on the command line.

20 hours agolibnv: add note about nvlist_pack and nvlist_unpack
oshogbo [Mon, 18 Jun 2018 23:00:15 +0000 (23:00 +0000)]
libnv: add note about nvlist_pack and nvlist_unpack

Fix small typo as well.

Submitted by: Mindaugas Rasiukevicius <>

20 hours agolibnv: Add nvlist_append_*_array() family of functions.
oshogbo [Mon, 18 Jun 2018 22:57:32 +0000 (22:57 +0000)]
libnv: Add nvlist_append_*_array() family of functions.

The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions
allows to dynamically extend array stored in the nvlist.

Submitted by: Mindaugas Rasiukevicius <>

21 hours agoremove epoch_test from default build
mmacy [Mon, 18 Jun 2018 22:27:29 +0000 (22:27 +0000)]
remove epoch_test from default build

21 hours agolibnv: add regression test for r335344.
oshogbo [Mon, 18 Jun 2018 22:22:06 +0000 (22:22 +0000)]
libnv: add regression test for r335344.

21 hours agolibnv: clean parent in nvlist_array when removing it.
oshogbo [Mon, 18 Jun 2018 22:21:28 +0000 (22:21 +0000)]
libnv: clean parent in nvlist_array when removing it.

When we are removing element form the nvlist we should also clean parent,
because the array is not a part of the nvlist anymore.

Submitted by: Mindaugas Rasiukevicius <>

22 hours agolibnv: Remove nvlist argument from cnvlist_{take,free}_* functions.
oshogbo [Mon, 18 Jun 2018 21:26:58 +0000 (21:26 +0000)]
libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.

All information which are need for those operations is already stored in
the cookie.

We decided not to bump libnv version because this API is not used yet in the
base system.

Reviewed by: pjd

22 hours agolibnv: add const to cookies arguments
oshogbo [Mon, 18 Jun 2018 21:23:40 +0000 (21:23 +0000)]
libnv: add const to cookies arguments

Pointed out by: pjd@

22 hours agolibnv: change name of cookie from cookiep to cookie.
oshogbo [Mon, 18 Jun 2018 21:18:20 +0000 (21:18 +0000)]
libnv: change name of cookie from cookiep to cookie.

The name was inconsistent with rest of the library.
No functional change intended.

Pointed out by: pjd@

23 hours agoixl(4): Update version number to 2.0.0-k
erj [Mon, 18 Jun 2018 20:32:53 +0000 (20:32 +0000)]
ixl(4): Update version number to 2.0.0-k

And update copyrights to current year.

MFC after: 1 month
Sponsored by: Intel Corporation

23 hours agoixl(4): Update to use iflib
erj [Mon, 18 Jun 2018 20:12:54 +0000 (20:12 +0000)]
ixl(4): Update to use iflib

Update the driver to use iflib in order to bring performance,
maintainability, and (hopefully) stability benefits to the driver.

The driver currently isn't completely ported; features that are missing:

- VF driver (ixlv)
- SR-IOV host support
- RDMA support

The plan is to have these re-added to the driver before the next FreeBSD release.

Reviewed by: gallatin@
Contributions by: gallatin@, mmacy@,
Tested by:
MFC after: 1 month
Sponsored by: Intel Corporation
Differential Revision:

23 hours agoRemove stray debugging line.
imp [Mon, 18 Jun 2018 19:53:11 +0000 (19:53 +0000)]
Remove stray debugging line.

Noticed by: ian@

24 hours agoRemove now-empty geli directory
imp [Mon, 18 Jun 2018 19:40:21 +0000 (19:40 +0000)]
Remove now-empty geli directory

24 hours agoIntroduce arm64 linuxulator stubs
emaste [Mon, 18 Jun 2018 19:34:34 +0000 (19:34 +0000)]
Introduce arm64 linuxulator stubs

This provides stub implementations of arm64 Linux vdso and machdep,
ptrace, and futex sufficient for executing an arm64 Linux 'hello world'

Reviewed by: andrew
Sponsored by: Turing Robotic Industries
Differential Revision:

25 hours agolinuxulator: add debugging for invalid capget/capset version
emaste [Mon, 18 Jun 2018 18:43:45 +0000 (18:43 +0000)]
linuxulator: add debugging for invalid capget/capset version

Sponsored by: Turing Robotic Industries Inc.

25 hours agoThe IP, TCP, and UDP provider report IP addresses as strings.
tuexen [Mon, 18 Jun 2018 18:35:29 +0000 (18:35 +0000)]
The IP, TCP, and UDP provider report IP addresses as strings.
In some cases, the required information is not available and the
UDP provider reported an empty string in this case and the IP
and TCP provider reported a NULL pointer.

This patch changes the value provided in this case to the string
"<unknown>". This make the behaviour consistent and in-line with
the behaviour of Solaris.

Reviewed by: markj@, dteske@, gnn@
Differential Revision:

25 hours agoRegen arm64 linuxulator sysent files after r335323
emaste [Mon, 18 Jun 2018 18:10:11 +0000 (18:10 +0000)]
Regen arm64 linuxulator sysent files after r335323

25 hours agoarm64 linuxulator: add dup syscall entry
emaste [Mon, 18 Jun 2018 18:08:19 +0000 (18:08 +0000)]
arm64 linuxulator: add dup syscall entry

Missed in r333027

Sponsored by: Turing Robotic Industries Inc.

26 hours agoiflib: Style fixes
erj [Mon, 18 Jun 2018 17:27:43 +0000 (17:27 +0000)]
iflib: Style fixes

MFC after: 1 week

27 hours agostand: move libgeliboot into libsa.
imp [Mon, 18 Jun 2018 16:24:42 +0000 (16:24 +0000)]
stand: move libgeliboot into libsa.

Reduce by 1 the number of crazy libraries we need in stand by moving
geli into libsa (where architecturally it belonged all along). This
just moves things around without any code changes.

28 hours agoaudit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr
asomers [Mon, 18 Jun 2018 15:37:43 +0000 (15:37 +0000)]
audit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

28 hours agoaudit(4): add tests for send, recv, sendto, and recvfrom
asomers [Mon, 18 Jun 2018 15:27:31 +0000 (15:27 +0000)]
audit(4): add tests for send, recv, sendto, and recvfrom

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

28 hours agoaudit(4): add tests for extattr_set_file and friends
asomers [Mon, 18 Jun 2018 15:07:10 +0000 (15:07 +0000)]
audit(4): add tests for extattr_set_file and friends

Includes extattr_{set_file, _set_fd, _set_link, _delete_file, _delete_fd,

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

29 hours agoMove to using the inp->vnet pointer has suggested by lstewart.
rrs [Mon, 18 Jun 2018 14:10:12 +0000 (14:10 +0000)]
Move to using the inp->vnet pointer has suggested by lstewart.
This is far better since the hpts system is using the inp
as its basis anyway. Unfortunately his comments came late.

Sponsored by: Netflix Inc.

29 hours agoImprove spelling and capitalize "Kerberos".
trasz [Mon, 18 Jun 2018 13:49:44 +0000 (13:49 +0000)]
Improve spelling and capitalize "Kerberos".

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

30 hours agolinsysfs: depend on linux_common module on arm64, as on amd64
emaste [Mon, 18 Jun 2018 13:26:45 +0000 (13:26 +0000)]
linsysfs: depend on linux_common module on arm64, as on amd64

Sponsored by: Turing Robotic Industries

37 hours agoFix bad logic in iovlist_truncate().
ed [Mon, 18 Jun 2018 06:01:28 +0000 (06:01 +0000)]
Fix bad logic in iovlist_truncate().

To conform to RFC 5426, this function is intended to truncate messages
if they exceed the message size limits. Unfortunately, the amount of
space was computed the wrong way around, causing messages to be
truncated entirely.

Reported by: Michael Grimm on stable@
MFC after: 3 days

38 hours agolibcapsicum: adding missing man page links
eadler [Mon, 18 Jun 2018 04:58:48 +0000 (04:58 +0000)]
libcapsicum: adding missing man page links

38 hours agodc: make use of caph_enter
eadler [Mon, 18 Jun 2018 04:54:09 +0000 (04:54 +0000)]
dc: make use of caph_enter

We already use caph library so this makes sense.

39 hours agoFix 32-bit build after 335307
asomers [Mon, 18 Jun 2018 04:12:58 +0000 (04:12 +0000)]
Fix 32-bit build after 335307

This was correct in the final version on Phabricator, but somehow I screwed
up applying the patch locally.

Reported by: linimon
Pointy-hat-to: asomers
MFC after: 2 weeks
X-MFC-With: 335307

41 hours agotop(1): use more modern signal code
eadler [Mon, 18 Jun 2018 02:06:16 +0000 (02:06 +0000)]
top(1): use more modern signal code

Rather than manually build signal masks use functions designed for that
reason. Also use sigprocmask instead of sigblock.

44 hours agoRevert r335263, since it can cause crashes in unusual circumstances.
rmacklem [Sun, 17 Jun 2018 23:08:54 +0000 (23:08 +0000)]
Revert r335263, since it can cause crashes in unusual circumstances.
This needs to be fixed in a different way.

45 hours agobsdconfig: Fix a bug when editing users
dteske [Sun, 17 Jun 2018 22:09:43 +0000 (22:09 +0000)]
bsdconfig: Fix a bug when editing users

The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.

Fixed by localizing menu-specific contents as to not leak outside API.

PR: bin/208774
Reported by: Martin Waschbuesch <>
MFC after: 1 week
X-MFC-to: stable/11, stable/10
Sponsored by: Smule, Inc.

46 hours agoaudit(4): add tests for Sys V shared memory syscalls
asomers [Sun, 17 Jun 2018 21:29:35 +0000 (21:29 +0000)]
audit(4): add tests for Sys V shared memory syscalls

includes shmget, shmat, shmdt, and shmctl

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc (GSoC 2018)
Differential Revision:

46 hours agobsdconfig: Make examples optional
dteske [Sun, 17 Jun 2018 21:09:21 +0000 (21:09 +0000)]
bsdconfig: Make examples optional

PR: bin/228485
Submitted by: Dmitry Wagin <>
Reported by: Dmitry Wagin <>
MFC after: 1 week
Sponsored by: Smule, Inc.

46 hours agoUpdate VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers
bryanv [Sun, 17 Jun 2018 20:45:48 +0000 (20:45 +0000)]
Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers

47 hours agoacpi: Add support for Thinkpads Mic led
eadler [Sun, 17 Jun 2018 20:44:20 +0000 (20:44 +0000)]
acpi: Add support for Thinkpads Mic led

PR: 229074
Submitted by: "Ali Abdallah" <>

47 hours agoAssorted fixes to MSI-X/MSI/INTx setup in iflib(9):
marius [Sun, 17 Jun 2018 20:33:02 +0000 (20:33 +0000)]
Assorted fixes to MSI-X/MSI/INTx setup in iflib(9):
- In iflib_msix_init(), VMMs with broken MSI-X activation are trying
  to be worked around by manually enabling PCIM_MSIXCTRL_MSIX_ENABLE
  before calling pci_alloc_msix(9). Apart from constituting a layering
  violation, this has the problem of leaving PCIM_MSIXCTRL_MSIX_ENABLE
  enabled when falling back to MSI or INTx when e. g. MSI-X is black-
  listed and initially also when disabled via hw.pci.enable_msix. The
  later in turn was incorrectly worked around in r325166.
  Since r310806, pci(4) itself has code to deal with broken MSI-X
  handling of VMMs, so all of these workarounds in iflib(9) can go,
  fixing non-working interrupts when falling back to MSI/INTx. In
  any case, possibly further adjustments to broken MSI-X activation
  of VMMs like enabling r310806 by default in VM environments need to
  be placed into pci(4), not iflib(9). [1]
- Also remove the pci_enable_busmaster(9) call from iflib_msix_init(),
  which is already more properly invoked from iflib_device_attach().
- When falling back to MSI/INTx, release the MSI-X BAR resource again.
- When falling back to INTx, ensure scctx->isc_vectors is set to 1 and
  not to something higher from a device with more than one MSI message
- Make the nearby ring_state(s) stuff (static) const.

Discussed with: jhb at BSDCan 2018 [1]
Reviewed by: imp, jhb
Differential Revision:

47 hours agosysrc.subr: Fix a comment for accuracy
dteske [Sun, 17 Jun 2018 20:32:43 +0000 (20:32 +0000)]
sysrc.subr: Fix a comment for accuracy

PR: bin/203435
Reported by: Andreas Sommer <>
MFC after: 6 days
X-MFC-to: stable/11
X-MFC-with: r335280
Sponsored by: Smule, Inc.

47 hours agogpart: add EFI alias for MBR partition scheme
emaste [Sun, 17 Jun 2018 20:10:48 +0000 (20:10 +0000)]
gpart: add EFI alias for MBR partition scheme

Sponsored by: The FreeBSD Foundation
Differential Revision:

47 hours agoSort geom/part mbr/ebr/ldm alias table entries
emaste [Sun, 17 Jun 2018 20:06:27 +0000 (20:06 +0000)]
Sort geom/part mbr/ebr/ldm alias table entries

Having the table entries in alpha order simplifies future additions.

Sponsored by: The FreeBSD Foundation

2 days agoREADME: add generic notes about GENERIC and NOTES
eadler [Sun, 17 Jun 2018 19:44:24 +0000 (19:44 +0000)]
README: add generic notes about GENERIC and NOTES

Inform new users what GENERIC and NOTES are. These are useful for people
perusing the tree without a great deal of specific fbsd knowledge.
See discussion of r334073 for further motivation.

Requested by: jhb

2 days agostand/common/disk.c: Update debug printf
allanjude [Sun, 17 Jun 2018 19:31:35 +0000 (19:31 +0000)]
stand/common/disk.c: Update debug printf

This was missed in r330809 because it is compiled out by default

Sponsored by: Klara Systems

2 days agoFix build of ndis with base gcc on i386
dim [Sun, 17 Jun 2018 19:24:40 +0000 (19:24 +0000)]
Fix build of ndis with base gcc on i386

Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so use an
intermediate cast to uintptr_t to suppress it.  In this case, the I/O
port range is effectively limited to the range of 0..65535.

Reviewed by: imp
MFC after: 3 days
Differential Revision:

2 days agoFix build of aibs with base gcc on i386
dim [Sun, 17 Jun 2018 19:14:05 +0000 (19:14 +0000)]
Fix build of aibs with base gcc on i386

Add a few intermediate casts to intptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc.  In this case, the
'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an
intermediate intmax_t, so no information is lost.

Reviewed by: avg
MFC after: 3 days
Differential Revision:

2 days agoliby: rewrite yyerror.h
eadler [Sun, 17 Jun 2018 18:05:27 +0000 (18:05 +0000)]
liby: rewrite yyerror.h

In order to prevent confusion about copyright, rewrite from scratch
yyerror.h. See discussion on r335270 for details.

2 days agoaudit(4): add tests for connect, connectat, and accept
asomers [Sun, 17 Jun 2018 17:43:55 +0000 (17:43 +0000)]
audit(4): add tests for connect, connectat, and accept

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

2 days agopraudit(1): add tests
asomers [Sun, 17 Jun 2018 17:31:16 +0000 (17:31 +0000)]
praudit(1): add tests

Submitted by: aniketp
MFC after: 2 weeks
X-MFC-With: 335287
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

2 days agopraudit(1): return 0 on success
asomers [Sun, 17 Jun 2018 17:10:35 +0000 (17:10 +0000)]
praudit(1): return 0 on success

Cherry pick

Submitted by: aniketp
Reviewed by: rwatson, 0mp
Obtained from: OpenBSM
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request:

2 days agoMake the pNFS NFSv4.1 client return a Flexible File layout upon error.
rmacklem [Sun, 17 Jun 2018 16:30:06 +0000 (16:30 +0000)]
Make the pNFS NFSv4.1 client return a Flexible File layout upon error.

The Flexible File layout LayoutReturn operation has argument fields where
an I/O error encountered when attempting I/O on a DS can be reported back
to the MDS.
This patch adds code to the client to do this for the Flexible File layout
mirrored case.
This patch should only affect mounts using the "pnfs" option against servers
that support the Flexible File layout.

MFC after: 2 weeks

2 days agoaudit(4): Add tests for a few syscalls in the ad class
asomers [Sun, 17 Jun 2018 16:24:46 +0000 (16:24 +0000)]
audit(4): Add tests for a few syscalls in the ad class

The ad audit class is for administrative commands.  This commit adds test
for settimeofday, adjtime, and getfh.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

2 days agoaudit(4): add tests for extattr_get_file(2) and friends
asomers [Sun, 17 Jun 2018 15:22:27 +0000 (15:22 +0000)]
audit(4): add tests for extattr_get_file(2) and friends

This commit includes extattr_{get_file, get_fd, get_link, list_file,
list_fd, list_link}.  It does not include any syscalls that modify, set, or
delete extended attributes, as those are in a different audit class.

Submitted by: aniketpt
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

2 days agoBuild LOCAL_LIB_DIRS along with system lib dirs, rather than building them
ian [Sun, 17 Jun 2018 14:13:45 +0000 (14:13 +0000)]
Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.

2 days agoFix false positive on failure
slavash [Sun, 17 Jun 2018 07:08:47 +0000 (07:08 +0000)]
Fix false positive on failure

When running mckey, errors may happen in the init/connect stage.
When leaving multicast groups, we override this value.

Fix that by saving the return value from rdma_leave_multicast to different
parameter, and only in case of failure in rdma_leave_multicast override it.

MFC after:      1 week
Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

2 days agosysrc.subr: Fix display when value is "-n"
dteske [Sun, 17 Jun 2018 06:25:32 +0000 (06:25 +0000)]
sysrc.subr: Fix display when value is "-n"

PR: bin/226406
Reported by: Marius Halden <>
MFC after: 1 week
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

2 days agosysrc.subr: Fix handling of files with missing newline at EOF
dteske [Sun, 17 Jun 2018 06:03:48 +0000 (06:03 +0000)]
sysrc.subr: Fix handling of files with missing newline at EOF

PR: bin/203435
Reported by: Andreas Sommer <>
MFC after: 1 week
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

2 days complete all profiles except GELI+MBR (not supported)
allanjude [Sun, 17 Jun 2018 05:55:31 +0000 (05:55 +0000)] complete all profiles except GELI+MBR (not supported)

This extends the test suite to generate images for every combination of:
amd64: mbr/gpt geli/nogeli ufs/zfs legacy/uefi/both

Except for mbr+geli, which is not currently possible.

Reviewed by: imp (previous version)
Sponsored by: Klara Systems
Differential Revision:

2 days agopwd: mark usage as dead
eadler [Sun, 17 Jun 2018 05:14:50 +0000 (05:14 +0000)]
pwd: mark usage as dead

2 days agosysrc(8): Exit with failure on API error
dteske [Sun, 17 Jun 2018 03:33:29 +0000 (03:33 +0000)]
sysrc(8): Exit with failure on API error

Fix exit status when f_sysrc_set() fails. Errors in the underlying API
provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not
being communicated back to the command-line. This was affecting ansible
modules using sysrc as they were not able to accurately test for error.

PR: bin/211448
Reported by: Christian Schwarz <>
MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

2 days agogptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
allanjude [Sun, 17 Jun 2018 03:18:56 +0000 (03:18 +0000)]
gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early

Normally the serial console is not enabled until /boot.config is read and
we know how the serial console should be configured.  Initialize the
consoles early in 'dual' mode (serial & keyboard) with a default serial
rate of 115200. Then serial is re-initialized once the disk is decrypted
and the /boot.config file can be read.

This allows the GELIBoot passphrase to be provided via the serial console.

PR: 221526
Requested by: many
Reviewed by: imp
Sponsored by: Klara Systems
Differential Revision:

2 days agoaudit(4): add tests for chflags and friends
asomers [Sun, 17 Jun 2018 03:10:25 +0000 (03:10 +0000)]
audit(4): add tests for chflags and friends

chflags, fchflags, and lchflags (but not chflagsat) are included.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision:

2 days agoFreeBSD/amd64 requires 256MiB to boot UEFI, 128MB simply doesn't work.
imp [Sun, 17 Jun 2018 02:49:42 +0000 (02:49 +0000)]
FreeBSD/amd64 requires 256MiB to boot UEFI, 128MB simply doesn't work.
128MiB still works for Legacy booting, however. Go ahead and do 256MiB
for all amd64 boxes, since the number of such boxes < 256MiB is
vanishingly small.

2 days agogvinum: revert WARNS change in Makefile
eadler [Sun, 17 Jun 2018 01:39:22 +0000 (01:39 +0000)]
gvinum: revert WARNS change in Makefile

Architectures that passed on a local build universe, failed on
tinderbox. Revert the number change for now while I investigate.

2 days agoMany netboot scenarios don't have /boot/defaults/loader.conf. As
imp [Sun, 17 Jun 2018 01:26:57 +0000 (01:26 +0000)]
Many netboot scenarios don't have /boot/defaults/loader.conf. As
a fallback, also check /boot/kernel/kernel existing as well, since
that's the fallback behavior of the loader.

2 days agoddb: unbreak ppc
eadler [Sun, 17 Jun 2018 00:00:24 +0000 (00:00 +0000)]
ddb: unbreak ppc

warning: shadowed declaration is here

2 days agoliby: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:50:34 +0000 (23:50 +0000)]
liby: build with WARNS=6

Tested with amd64, arm64, i386, mips

2 days agonetrate: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:49:22 +0000 (23:49 +0000)]
netrate: build with WARNS=6

Tested with amd64, i386

2 days agoquotacheck: build with WARNS=3
eadler [Sat, 16 Jun 2018 23:47:59 +0000 (23:47 +0000)]
quotacheck: build with WARNS=3


Tested with amd64, arm64, i386, mips

2 days agogvinum: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:45:59 +0000 (23:45 +0000)]
gvinum: build with WARNS=6

This also removes an unused and uninitialized variable.

Tested with amd64, arm64, i386, mips