]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoepair(4): make sure we do not duplicate MAC addresses
Eugene Grosbein [Mon, 23 Jul 2018 07:11:58 +0000 (07:11 +0000)]
epair(4): make sure we do not duplicate MAC addresses
in case of reused if_index.

PR: 229957
Tested by: O. Hartmann <ohartmann@walstatt.org>
Approved by: avg (mentor)

5 years agoFix the attempt to see if we're overriding the console in the command
Warner Losh [Mon, 23 Jul 2018 06:38:48 +0000 (06:38 +0000)]
Fix the attempt to see if we're overriding the console in the command
line args. I had thought console would be NULL, but it's efi. Set it
to efi (as a clue) before we initialize the console, then test it to
see if it changed on the command line to do the automatic
override. This gets my serial console back.

5 years agoOlder zfs boot blocks don't support symlinks. install the link to
Warner Losh [Mon, 23 Jul 2018 06:04:05 +0000 (06:04 +0000)]
Older zfs boot blocks don't support symlinks. install the link to
zfsloader as a hard link. While newer ones do, the whole point of the
link was to transition to the new world order smoothly. A hard link is
less flexible, but it works and will result in fewer bumps. Adjust
UPDATING entry to match.

5 years agoMake pw(8) showuser work the same with or without -R <path> for non-root
Ian Lepore [Sun, 22 Jul 2018 23:41:40 +0000 (23:41 +0000)]
Make pw(8) showuser work the same with or without -R <path> for non-root
users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users.  With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd and zeroes out the 3 fields
that aren't available in the passwd file, which duplicates the behavior of
getpwnam(3).  The net effect is that the showuser output is identical
whether using -R or not.

5 years agofix use of empty in Makefile.ec2
Matt Macy [Sun, 22 Jul 2018 23:33:48 +0000 (23:33 +0000)]
fix use of empty in Makefile.ec2

empty() takes a variable name - not the expanded value

Reported by: sjg

5 years agoAdd busy detect quirk to list of console options
Matt Macy [Sun, 22 Jul 2018 23:32:21 +0000 (23:32 +0000)]
Add busy detect quirk to list of console options

This change allows one to set the busy_detect flag
required by the synopsys UART at the loader prompt.
This is needed by the EPYC 3000 SoC.

This will give users a working console up to the point where getty is required:
hw.uart.console="mm:0xfedc9000,rs:2,bd:1"

Reviewed by: imp
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D16399

5 years agoCorrectly reference SRCTOP, avoid multiple invocations of svn
Matt Macy [Sun, 22 Jul 2018 23:20:24 +0000 (23:20 +0000)]
Correctly reference SRCTOP, avoid multiple invocations of svn

Reported by: sjg

5 years agofix build non-svn checkouts post r336593
Matt Macy [Sun, 22 Jul 2018 22:57:52 +0000 (22:57 +0000)]
fix build non-svn checkouts post r336593

The change made in r336593 assumes that the build is happening in a
svn checkout resulting in misleading debug output. Check that we're
actually working in an svn checkout before proceeding to call svn.

5 years agoAdd udma_barrier definitions for RISC-V
Li-Wen Hsu [Sun, 22 Jul 2018 22:35:17 +0000 (22:35 +0000)]
Add udma_barrier definitions for RISC-V

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

5 years agoSet the pw_class field to NULL when scanning the non-master passwd file.
Ian Lepore [Sun, 22 Jul 2018 22:34:20 +0000 (22:34 +0000)]
Set the pw_class field to NULL when scanning the non-master passwd file.
This avoids a null pointer deref in pw_dup(), which assumes that all
pointers are either NULL or valid.

5 years agoTemporarily disable the sys/acl/00 and sys/acl/02 tests
Alan Somers [Sun, 22 Jul 2018 21:00:11 +0000 (21:00 +0000)]
Temporarily disable the sys/acl/00 and sys/acl/02 tests

These tests are failing due to PR 229930.  Unfortunately, TAP tests can't be
marked as expected failures.

PR: 229930
Reported by: Jenkins

5 years agoFix a potential use after free in getsockopt() access to inp_options
Matt Macy [Sun, 22 Jul 2018 20:02:14 +0000 (20:02 +0000)]
Fix a potential use after free in getsockopt() access to inp_options

Discussed with: jhb
Reviewed by: sbruno, transport
MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14621

5 years agoUse the right buffer size when calling snprintf().
Mark Johnston [Sun, 22 Jul 2018 18:31:15 +0000 (18:31 +0000)]
Use the right buffer size when calling snprintf().

PR: 229952

5 years agoAdd a regression test for PR 131876.
Mark Johnston [Sun, 22 Jul 2018 18:07:08 +0000 (18:07 +0000)]
Add a regression test for PR 131876.

PR: 131876
MFC after: 1 week

5 years agoauditd(8): Log a better error when no hostname is set in audit_control
Alan Somers [Sun, 22 Jul 2018 18:06:42 +0000 (18:06 +0000)]
auditd(8): Log a better error when no hostname is set in audit_control

Cherry-pick from https://github.com/openbsm/openbsm/commit/01ba03b

Reviewed by: cem
Obtained from: OpenBSM
MFC after: 2 weeks
Pull Request: https://github.com/openbsm/openbsm/pull/38

5 years agoUse the maximum of isc_tx_{nsegments,tso_segments_max} for MAX_TX_DESC.
Marius Strobl [Sun, 22 Jul 2018 17:51:11 +0000 (17:51 +0000)]
Use the maximum of isc_tx_{nsegments,tso_segments_max} for MAX_TX_DESC.
Since r336313, TSO support for LEM-class devices is removed again as it
was before the conversion of {l,}em(4) to iflib(4) in r311849 and as a
result, isc_tx_tso_segments_max is 0 for LEM-class devices now. Thus,
inappropriate watermarks were used for this class.

This is really only a band-aid, though, because so far iflib(9) doesn't
fully take into account that DMA engines can support different maxima
of segments for transfers of TSO and non-TSO packets. For example, the
DESC_RECLAIMABLE macro is based on isc_tx_nsegments while MAX_TX_DESC
used isc_tx_tso_segments_max only. For most in-tree consumers that
doesn't make a difference as the maxima are the same for both kinds of
transfers (that is, apart from the fact that TSO may require up to 2
sentinel descriptors but also not with every MAC supported). However,
isc_tx_nsegments is 8 but isc_tx_tso_segments_max is 85 by default
with ixl(4).

5 years ago- Given that the controlling expression of the receive loop in iflib_rxeof()
Marius Strobl [Sun, 22 Jul 2018 17:45:44 +0000 (17:45 +0000)]
- Given that the controlling expression of the receive loop in iflib_rxeof()
  tests for avail > 0, avail can never be 0 within that loop. Thus, move
  decrementing avail and budget_left into the loop and before the code which
  checks for additional descriptors having become available in case all the
  previous ones have been processed but there still is budget left so the
  latter code works as expected. [1]
- In iflib_{busdma_load_mbuf_sg,parse_header}(), remove dead stores to m
  and n respectively. [2, 3]
- In collapse_pkthdr(), ensure that m_next isn't NULL before dereferencing
  it. [4]
- Remove a duplicate assignment of segs in iflib_encap().

Reported by: Coverity
CID: 1356027 [1], 1356047 [2], 1368205 [3], 1356028 [4]

5 years agoo In em_if_update_admin_status():
Marius Strobl [Sun, 22 Jul 2018 17:40:13 +0000 (17:40 +0000)]
o In em_if_update_admin_status():
  - Don't bother calling if_setbaudrate(9) as iflib_link_state_change(9)
    takes care of that,
  - correctly check for E1000_CTRL_EXT_LINK_MODE_GMII in E1000_CTRL_EXT [1],
  - properly convert the uint16_t link_speed to a uint64_t baudrate by
    using IF_Mbps() which contains an appropriate cast [2],
  - remove the duplicate link down announcement when bootverbose isn't
    zero and bring the remaining one in line with the other link state
    messages.
o Remove a dead store to rid in em_if_msix_intr_assign(). [3]
o Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR
  remain intact as intended in igb_init_dmac(). [4]

Reported by: Coverity
CID: 1378464 [1], 1368765 [2], 1381681 [3], 1304929 [4]

5 years agoFix several Coverity warnings in tftp
Alan Somers [Sun, 22 Jul 2018 17:10:12 +0000 (17:10 +0000)]
Fix several Coverity warnings in tftp

Some of the changes are in the libexec/tftpd directory, but to functions that
are only used by tftp(1) (they share some code).

* strcpy => strlcpy (1006793100679410067961006741)
* Unchecked return value and TOCTTOU (1009314)
* NULL pointer dereference (10180351018036)

Reported by: Coverity
CID: 100679310067941006796100674110093141018035
CID: 1018036
MFC after: 2 weeks

5 years agoAlpha-sort the list of user/group IDs to check at install time.
Ian Lepore [Sun, 22 Jul 2018 16:51:11 +0000 (16:51 +0000)]
Alpha-sort the list of user/group IDs to check at install time.

5 years agoRemove the .if ${MK_FOO} wrappers around the user/group ID checks. These
Ian Lepore [Sun, 22 Jul 2018 16:42:22 +0000 (16:42 +0000)]
Remove the .if ${MK_FOO} wrappers around the user/group ID checks.  These
names are referenced in mtree files without any conditional logic, so the
users/groups must exist even if the corresponding tool(s) are disabled.

5 years agoAdd ntpd to the list of users not allowed to log into ftp.
Ian Lepore [Sun, 22 Jul 2018 16:17:45 +0000 (16:17 +0000)]
Add ntpd to the list of users not allowed to log into ftp.

5 years agoFix multiple Coverity warnings in tftpd(8)
Alan Somers [Sun, 22 Jul 2018 16:14:30 +0000 (16:14 +0000)]
Fix multiple Coverity warnings in tftpd(8)

* Initialize uninitialized variable (CID 1006502)
* strcpy => strlcpy (CID 100679210067911006790)
* Check function return values (CID 100944210094411009440)
* Delete dead code in receive_packet (not reported by Coverity)
* Remove redundant alarm(3) in receive_packet (not reported by Coverity)

Reported by: Coverity
CID: 1006502100679210067911006790100944210094411009440
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11287

5 years agoFix audit of chflagsat, lgetfh, and setfib
Alan Somers [Sun, 22 Jul 2018 14:11:52 +0000 (14:11 +0000)]
Fix audit of chflagsat, lgetfh, and setfib

These syscalls were always supposed to have been auditted, but due to
oversights never were.

PR: 228374
Reported by: aniketp
Reviewed by: aniketp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16388

5 years agodtb/allwinner: Build sun8i-h2-plus-orangepi-r1.dts
Ganbold Tsagaankhuu [Sun, 22 Jul 2018 14:01:49 +0000 (14:01 +0000)]
dtb/allwinner: Build sun8i-h2-plus-orangepi-r1.dts
We have a u-boot port for this board so add the dtb to the build.

5 years agogeli attach: Fix exit codes and errors not being printed after r335673
Ben Woods [Sun, 22 Jul 2018 13:40:52 +0000 (13:40 +0000)]
geli attach: Fix exit codes and errors not being printed after r335673

Now that multiple providers can be attached at once, exit codes and
error messages must be handled correctly if there are failures in on
any of the providers.

Reported by: asomers (Kyua test failures via continuous integration)
Reviewed by: asomers
Approved by: allanjude
Differential Revision: https://reviews.freebsd.org/D16386

5 years agoRemove old Kyua test files for indent(1) after a rename.
Piotr Pawel Stefaniak [Sun, 22 Jul 2018 12:45:02 +0000 (12:45 +0000)]
Remove old Kyua test files for indent(1) after a rename.

This continues work in r334944.

Reported by: asomers

5 years agorelease: Add rpi firmware dtb and mmc overlays for RPI-B and RPI2
Emmanuel Vadot [Sun, 22 Jul 2018 12:04:21 +0000 (12:04 +0000)]
release: Add rpi firmware dtb and mmc overlays for RPI-B and RPI2

This is needed with new u-boot that uses the rpi-firmware dtbs.

Reviewed by: gjb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16240

5 years agorelease: Add arm_install_boot to install the commit boot bits
Emmanuel Vadot [Sun, 22 Jul 2018 12:03:17 +0000 (12:03 +0000)]
release: Add arm_install_boot to install the commit boot bits

This reduce the per-board arm_install_uboot to just install u-boot.
While here remove the installation of rpi.dtb and rpi2.dtb as we load
them from the UFS partition via ubldr.

Reviewed by: gjb, imp (older version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16239

5 years agorelease: Uniform release arm image size
Emmanuel Vadot [Sun, 22 Jul 2018 12:02:07 +0000 (12:02 +0000)]
release: Uniform release arm image size

Create a 50m fat16 for all boards.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16238

5 years agoImprove TCP related tests for dtrace.
Michael Tuexen [Sun, 22 Jul 2018 10:50:59 +0000 (10:50 +0000)]
Improve TCP related tests for dtrace.

Ensure that the TCP connections are terminated gracefully as expected
by the test. Use appropriate numbers for sent/received packets.
In addition, enable tst.localtcpstate.ksh, which should pass, but
doesn't until https://reviews.freebsd.org/D16369 is committed.

Reviewed by: markj@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16288

5 years agoNULL out cc_data in pluggable TCP {cc}_cb_destroy
Matt Macy [Sun, 22 Jul 2018 05:37:58 +0000 (05:37 +0000)]
NULL out cc_data in pluggable TCP {cc}_cb_destroy

When ABE was added (rS331214) to NewReno and leak fixed (rS333699) , it now has
a destructor (newreno_cb_destroy) for per connection state. Other congestion
controls may allocate and free cc_data on entry and exit, but the field is
never explicitly NULLed if moving back to NewReno which only internally
allocates stateful data (no entry contstructor) resulting in a situation where
newreno_cb_destory might be called on a junk pointer.

 -    NULL out cc_data in the framework after calling {cc}_cb_destroy
 -    free(9) checks for NULL so there is no need to perform not NULL checks
     before calling free.
 -    Improve a comment about NewReno in tcp_ccalgounload

This is the result of a debugging session from Jason Wolfe, Jason Eggleston,
and mmacy@ and very helpful insight from lstewart@.

Submitted by: Kevin Bowling
Reviewed by: lstewart
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16282

5 years agoSkip the pftcl(8) tests if pf isn't loaded.
Alan Somers [Sun, 22 Jul 2018 03:58:01 +0000 (03:58 +0000)]
Skip the pftcl(8) tests if pf isn't loaded.

Previously, they would simply fail.

MFC after: 2 weeks

5 years agoFix tmpfs detection in the sys/fs/tmpfs tests
Alan Somers [Sat, 21 Jul 2018 23:54:40 +0000 (23:54 +0000)]
Fix tmpfs detection in the sys/fs/tmpfs tests

This code was originally written for NetBSD.  r306031 tried to adapt it to
FreeBSD, but didn't correctly handle the case that tmpfs was available, but
not already loaded.  Fix the logic to load the module if necessary.  The
tmpfs tests shouldn't be skipped anymore.

Also, fix a comment that was dislocated by r306031.

Reported by: Jenkins
MFC after: 2 weeks

5 years agoUse svn or svnlite, or ${SVN_CMD} if set, for extracting the SVN branch
Colin Percival [Sat, 21 Jul 2018 22:54:43 +0000 (22:54 +0000)]
Use svn or svnlite, or ${SVN_CMD} if set, for extracting the SVN branch
and revision number announced in SNS notifications about new EC2 AMIs.

While I'm here, incorporate that information into the AMI "description"
fields, since it's more useful than simply echoing the information
already provided via the AMI "name".

Approved by: gjb

5 years agoTake the mapping's segment offset into account when resolving symbols.
Mark Johnston [Sat, 21 Jul 2018 22:15:48 +0000 (22:15 +0000)]
Take the mapping's segment offset into account when resolving symbols.

Reported by: Jenkins, via asomers
MFC after: 2 weeks

5 years agoDisable optimization of the libproc test program.
Mark Johnston [Sat, 21 Jul 2018 22:10:28 +0000 (22:10 +0000)]
Disable optimization of the libproc test program.

Dead code elimination may remove symbols that are required by the tests.

Reported by: Jenkins, via asomers
MFC after: 1 week

5 years agoStop further SCSI recovery attempts after one has failed.
Alexander Motin [Sat, 21 Jul 2018 21:34:10 +0000 (21:34 +0000)]
Stop further SCSI recovery attempts after one has failed.

We've got a set of probably damaged hard disks, reporting 0x04,0x02
("Logical unit not ready, initializing command required") in response
to READ CAPACITY(16), where attempts to use START STOP UNIT for recovery
results in 0x44,0x00 ("Internal target failure") after ~1 second delay.
As result of all recovery retries, device open attempt took ~3 seconds
before finally reporting to GEOM that device is opened, but has no media.
If the open was for writing and since it hasn't formally failed, following
close triggered GEOM retaste, opening device few more times with respective
delays.

This change reduces whole time of this cycle from ~12 seconds to ~3 by
giving up on recovery after the first failure.

Reviewed by: ken
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

5 years agoEliminate a comment that doesn't apply to this pmap implementation.
Alan Cox [Sat, 21 Jul 2018 21:26:38 +0000 (21:26 +0000)]
Eliminate a comment that doesn't apply to this pmap implementation.

Coalesce the variable definitions for PV entry management.

MFC after: 3 weeks

5 years agoFix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967
Alan Somers [Sat, 21 Jul 2018 20:14:01 +0000 (20:14 +0000)]
Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967

In r321967 ngie "fixed" these tests by changing their expectations to match
the device numbers produced by the new ino64 code.  But it wasn't the tests
that were broken, it was the kernel.  bde fixed the kernel in r335053.

Reported by: Jenkins
MFC after: Never (only applies to >= 12)

5 years agotftpd(8): when completing an WRQ, flush the file before acknowleding receipt
Alan Somers [Sat, 21 Jul 2018 19:48:31 +0000 (19:48 +0000)]
tftpd(8): when completing an WRQ, flush the file before acknowleding receipt

tftpd(8) should flush a newly written file to disk before ACKing the final DATA
packet.  Otherwise there is a narrow race window when a subsequent read may not
see the file.  This is somewhat related to r330710, but the race window is much
smaller.  Hopefully this will fix the intermittent tests in Jenkins.

Reported by: Jenkins
MFC after: 2 weeks

5 years agoClear expected failures for aesni_aes_gcm tests
Alan Somers [Sat, 21 Jul 2018 19:28:07 +0000 (19:28 +0000)]
Clear expected failures for aesni_aes_gcm tests

These tests were fixed by r335584

PR: 228094
PR: 201447
MFC after: 2 weeks
X-MFC-With: 335584

5 years agoUse the correct DOT language syntax for an ID with a leading digit (0mp).
Mateusz Piotrowski [Sat, 21 Jul 2018 19:16:38 +0000 (19:16 +0000)]
Use the correct DOT language syntax for an ID with a leading digit (0mp).

It turns out that my username (0mp) is not a valid ID in the DOT language
because it starts with a digit. The easiest way to fix it is to put my
username in double quotes.

Reported by: pstef
Reviewed by: krion (mentor)
Approved by: krion (mentor)
Differential Revision: https://reviews.freebsd.org/D16372

5 years agoMention the Linux compatibility layer instead of the Linux emulator in the BUGS section.
Mateusz Piotrowski [Sat, 21 Jul 2018 19:09:29 +0000 (19:09 +0000)]
Mention the Linux compatibility layer instead of the Linux emulator in the BUGS section.

linux(4) explicitly states that it is not an emulator.

While here, pet mandoc and igor.

Reviewed by: mat (mentor), rpokala
Approved by: manpages (rpokala), mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16375

5 years agoAdd option MAC to armv6 and armv7 kernels by default, it needs to be
Ian Lepore [Sat, 21 Jul 2018 18:54:24 +0000 (18:54 +0000)]
Add option MAC to armv6 and armv7 kernels by default, it needs to be
compiled-in to allow loading policy modules at runtime.

5 years agomakefs(8): add test case for PR 229929
Alan Somers [Sat, 21 Jul 2018 17:24:14 +0000 (17:24 +0000)]
makefs(8): add test case for PR 229929

Fix two failing makefs test cases by adding "-M 1m", which was already used
for every other FFS test case.  Add a new test case for the underlying
issue: with no -M, -m, or -s options, makefs can underestimate image size.

PR: 229929
Reported by: Jenkins
MFC after: 2 weeks

5 years agoRevert r336572 and wrap them in machine checks so they are only installed on
Brad Davis [Sat, 21 Jul 2018 17:13:39 +0000 (17:13 +0000)]
Revert r336572 and wrap them in machine checks so they are only installed on
i386.

Approved by: allanjude (mentor), imp
Differential Revision: https://reviews.freebsd.org/D16380

5 years agoaudit(4): add test cases for chflagsat(2), lgetfh(2), setfib(2)
Alan Somers [Sat, 21 Jul 2018 16:34:38 +0000 (16:34 +0000)]
audit(4): add test cases for chflagsat(2), lgetfh(2), setfib(2)

These three syscalls aren't currently audited correctly, so the tests are
marked as expected failures.

PR: 228374
Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16379

5 years agoaudit(4): add more test cases for auditon(2)
Alan Somers [Sat, 21 Jul 2018 16:26:00 +0000 (16:26 +0000)]
audit(4): add more test cases for auditon(2)

auditon(2) is an ioctl-like syscall with several different variants, each of
which has a distinct audit event.  This commit tests the remaining variants
that weren't tested in r336564.

Submitted by: aniketp
MFC after: 2 weeks
X-MFC-With: 336564
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16381

5 years agorun(4): Support the D-Link DWA-125 rev A3
Gavin Atkinson [Sat, 21 Jul 2018 14:56:15 +0000 (14:56 +0000)]
run(4): Support the D-Link DWA-125 rev A3

Submitted by: Ali Mashtizadeh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16029

5 years agoRaise "Report Count" value limit in HID descriptor parser.
Vladimir Kondratyev [Sat, 21 Jul 2018 14:20:17 +0000 (14:20 +0000)]
Raise "Report Count" value limit in HID descriptor parser.

This fixes usage/report size calculation of Microsoft`s "Touch Hardware
Quality Assurance" certificate blob found in many touchscreens.

While here, join several "c->flags = dval" lines in to single line.

Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16357

5 years agoSet the IPv4 version in the IP header for UDP and UDPLite.
Michael Tuexen [Sat, 21 Jul 2018 02:14:13 +0000 (02:14 +0000)]
Set the IPv4 version in the IP header for UDP and UDPLite.

5 years agoSet CLSET_TIMEOUT on TCP connections to pNFS DSs.
Rick Macklem [Sat, 21 Jul 2018 01:33:07 +0000 (01:33 +0000)]
Set CLSET_TIMEOUT on TCP connections to pNFS DSs.

Use CLSET_TIMEOUT to set the timeout for connections to DSs instead of
specifying a timeout on each RPC. This is done so that SO_SNDTIMEO
is set on the TCP socket as well as specifying a time limit when
waiting for an RPC reply.  Useful if the send queue for the TCP
connection has become constipated, due to a failed DS.
The choice of lease_duration / 4 is fairly arbitrary, but seems to work
ok, with a lower bound of 10sec.
For client connections to a DS, set the retry limit to vfs.nfsd.dsretries,
which is 2 by default.
This patch should only affect pNFS connections to DSs.
This patch requires r336542.

MFC after: 2 weeks

5 years agoPurge some old apmd files
Brad Davis [Sat, 21 Jul 2018 00:12:41 +0000 (00:12 +0000)]
Purge some old apmd files

Approved by: allanjude
Differential Revision: https://reviews.freebsd.org/D16373

5 years agoRegenerate src.conf.5.
Konstantin Belousov [Fri, 20 Jul 2018 23:55:47 +0000 (23:55 +0000)]
Regenerate src.conf.5.

Sponsored by: Mellanox Technologies

5 years agoEnable OFED build (without extras) by default.
Konstantin Belousov [Fri, 20 Jul 2018 23:53:20 +0000 (23:53 +0000)]
Enable OFED build (without extras) by default.

Reviewed by: bdrewery, hselasky (previous version)
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Release notes: yes
Differential revision: https://reviews.freebsd.org/D16230

5 years agoMove mostly useless examples binaries from OFED, as well as the Subnet
Konstantin Belousov [Fri, 20 Jul 2018 23:52:11 +0000 (23:52 +0000)]
Move mostly useless examples binaries from OFED, as well as the Subnet
Manager, under the new option WITH_OFED_EXTRA, disabled by default.

Reviewed by: bdrewery, hselasky (previous version)
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16230

5 years agoMove OFED libraries libmlx5.so.1 and libibverbs.so.1 to /lib.
Konstantin Belousov [Fri, 20 Jul 2018 23:49:57 +0000 (23:49 +0000)]
Move OFED libraries libmlx5.so.1 and libibverbs.so.1 to /lib.

The is required because libpcap.so depends on the libraries when OFED
is enabled.

Reviewed by: bdrewery, hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16230

5 years agoImprove the binmiscctl manual page
Mateusz Piotrowski [Fri, 20 Jul 2018 22:50:21 +0000 (22:50 +0000)]
Improve the binmiscctl manual page

- Use "Fl -" instead of "Cm --" for long options.
- Sort options alphabetically.
- Pet "mandoc -Tlint".
- Clean up the description of the "--interpreter" option.
- Clean up the description of the first example in the examples section.
- Use ".Bd -literal -offset indent" for all example code blocks for consistency.
- Use "Nm" instead of "Cm binmiscctl".
- Indent all examples for consistency.

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

5 years agoRegenerate src.conf.5 after several accumulated changes.
Konstantin Belousov [Fri, 20 Jul 2018 22:37:25 +0000 (22:37 +0000)]
Regenerate src.conf.5 after several accumulated changes.

The larger is the removal of arm/armeb architecture.  Also noted is
the addition of WITHOUT_SERVICESDB and default change for WITH_CXX.

Sponsored by: Mellanox Technologies

5 years agoAllow mounting FUSE filesystems in jails
Alan Somers [Fri, 20 Jul 2018 21:35:31 +0000 (21:35 +0000)]
Allow mounting FUSE filesystems in jails

Reviewed by: jamie
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16371

5 years agoSeparate the audit(4) tests for auditon(2)'s individual commands
Alan Somers [Fri, 20 Jul 2018 18:59:48 +0000 (18:59 +0000)]
Separate the audit(4) tests for auditon(2)'s individual commands

auditon(2) is an ioctl-like syscall with several different variants, each of
which has a distinct audit event.  Write separate audit(4) tests for each
variant.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16255

5 years agoRecommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD
Dimitry Andric [Fri, 20 Jul 2018 18:27:30 +0000 (18:27 +0000)]
Recommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD

This is a follow-up to r336299.

* lib/msun/Makefile:
  . Remove polevll.c

* lib/msun/ld80/e_powl.c:
  . Copy contents of polevll.c to here.  This is the only consumer of
    these functions.  Make functions 'static inline'.
  . Make reducl a 'static inline' function.

* lib/msun/man/exp.3:
  . Remove BUGS section that no longer applies.

* lib/msun/src/math_private.h:
  . Remove prototypes of __p1evll() and __polevll()

* lib/msun/src/s_cpow.c:
* lib/msun/src/s_cpowf.c:
* lib/msun/src/s_cpowl.c
  . Include math_private.h.
  . Use the CMPLX macro from either C99 or math_private.h (depends on
    compiler support) instead of the problematic use of complex I.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
PR: 229876
MFC after: 1 week

5 years agoAdd a note about the new 'ntpd' userid, and the fact that rc.d/ntpd now
Ian Lepore [Fri, 20 Jul 2018 18:02:52 +0000 (18:02 +0000)]
Add a note about the new 'ntpd' userid, and the fact that rc.d/ntpd now
automatically runs the daemon as that user if it can.

5 years agoFix `make` in sys/modules/spigen
Li-Wen Hsu [Fri, 20 Jul 2018 17:46:55 +0000 (17:46 +0000)]
Fix `make` in sys/modules/spigen

Reviewed by: ian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16368

5 years agoAdd knob to control tx ring abdication.
Stephen Hurd [Fri, 20 Jul 2018 17:45:26 +0000 (17:45 +0000)]
Add knob to control tx ring abdication.

r323954 changed the mp ring behaviour when 64-bit atomics were
available to abdicate the TX ring rather than having one become a
consumer thereby running to completion on TX. The consumer of the mp
ring was then triggered in the tx task rather than blocking the TX call.
While this significantly lowered the number of RX drops in small-packet
forwarding, it also negatively impacts TX performance.

With this change, the default behaviour is reverted, causing one TX ring
to become a consumer during the enqueue call. A new sysctl,
dev.X.Y.iflib.tx_abdicate is added to control this behaviour.

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16302

5 years agoImprove netmap TX handling when TX IRQs are not used/supported
Stephen Hurd [Fri, 20 Jul 2018 17:24:45 +0000 (17:24 +0000)]
Improve netmap TX handling when TX IRQs are not used/supported

Use the timer to poll for TX completions when there are
outstanding TX slots. Track when the last driver timer was called
to prevent overcalling it. Also clean up some kring vs NIC ring
usage.

Reviewed by: marius, Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16300

5 years agoAdd support for pmap_enter(psind = 1) to the arm64 pmap.
Mark Johnston [Fri, 20 Jul 2018 16:37:04 +0000 (16:37 +0000)]
Add support for pmap_enter(psind = 1) to the arm64 pmap.

See the commit log messages for r321378 and r336288 for descriptions of
this functionality.

Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D16303

5 years agoAnnotate a parameter as unused.
Alan Cox [Fri, 20 Jul 2018 16:31:25 +0000 (16:31 +0000)]
Annotate a parameter as unused.

X-MFC with: r336288

5 years agoInitialize the L3 page's wire count correctly after a L2 entry demotion.
Mark Johnston [Fri, 20 Jul 2018 16:31:08 +0000 (16:31 +0000)]
Initialize the L3 page's wire count correctly after a L2 entry demotion.

Reviewed by: alc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16303

5 years agovt/ofwfb: Fix brain-o from r336514, use the correct form of /chosen/stdout-path
Justin Hibbits [Fri, 20 Jul 2018 16:18:24 +0000 (16:18 +0000)]
vt/ofwfb: Fix brain-o from r336514, use the correct form of /chosen/stdout-path

/chosen/stdout-path is a string, not ihandle.  Treat it as such.

With this, ofwfb now starts correctly on a POWER9 system when launched from
the local console (not serial).

5 years agovt/ofwfb: Check that /chosen/stdout is valid before using it in initialization
Justin Hibbits [Fri, 20 Jul 2018 16:08:14 +0000 (16:08 +0000)]
vt/ofwfb: Check that /chosen/stdout is valid before using it in initialization

The FDT implementation of OF_instance_to_package() backend checks the
cross-reference to get the node.  On failure, this returns the input handle
unchanged.  In the case of ofwfb attachment, if /chosen/stdout property does not
exist, sc->sc_handle is either garbage or 0, which then gets propagated to node.
This will prevent "screen" from being used, resulting in not properly attaching.
Correct this by matching the code in ofwfb_probe().

5 years agoApply some late-arriving markup suggestions from the phab review, and add a
Ian Lepore [Fri, 20 Jul 2018 16:06:44 +0000 (16:06 +0000)]
Apply some late-arriving markup suggestions from the phab review, and add a
paragraph that mentions the possibility of starting ntpd as a non-root user
rather than starting it as root and using its '-u' option to drop root privs
after startup.

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

5 years agoTest that the dtrace UDP receive probe fires.
Michael Tuexen [Fri, 20 Jul 2018 15:37:29 +0000 (15:37 +0000)]
Test that the dtrace UDP receive probe fires.

This test ensures that the fix committed in
https://svnweb.freebsd.org/changeset/base/336551
actually works.

Reviewed by: dteske@, markj@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16046

5 years agoAdd missing dtrace probes for received UDP packets.
Michael Tuexen [Fri, 20 Jul 2018 15:32:20 +0000 (15:32 +0000)]
Add missing dtrace probes for received UDP packets.

Fire UDP receive probes when a packet is received and there is no
endpoint consuming it. Fire the probe also if the TTL of the
received packet is smaller than the minimum required by the endpoint.

Clarify also in the man page, when the probe fires.

Reviewed by: dteske@, markj@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16046

5 years agoDocument kernel/signal/crashdump devd(8) notification.
Edward Tomasz Napierala [Fri, 20 Jul 2018 14:32:36 +0000 (14:32 +0000)]
Document kernel/signal/crashdump devd(8) notification.

Discussed with: kib@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16323

5 years agoSupport installing manpages for multiple or alternate architecture(s).
Ian Lepore [Fri, 20 Jul 2018 14:23:01 +0000 (14:23 +0000)]
Support installing manpages for multiple or alternate architecture(s).

Some section-4 manpages are architecture-specific, and the build process
currently generates only the pages for the MACHINE_CPUARCH being built.
man(1) supports a '-m' option to find manpages belonging to an arbitrary
architecture other than the MACHINE_[CPU]ARCH, but we have no way to
generate and install alternate-arch pages right now.

This change adds a new make.conf variable, MAN_ARCH, which can be a list of
one or more MACHINE_ARCH or MACHINE_CPUARCH values. All arch-specific
manpages that exist for the named arches will be installed. If unset, it
continues the behavior of installing just the MACHINE_CPUARCH being built.

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

5 years agoAutomatically run ntpd as non-root when possible.
Ian Lepore [Fri, 20 Jul 2018 13:59:29 +0000 (13:59 +0000)]
Automatically run ntpd as non-root when possible.

Ntpd needs only a subset of full root privileges to do its job. Specifically
it needs the ability to manipulate system time, and to re-bind to a
privileged UDP port after interface changes. The mac_ntpd(4) policy module
(see r336525) can grant these privs.

These changes detect the availability of mac_ntpd(4). If enabled, and if the
ntpd configuration is fairly vanilla, it automatically runs ntpd as the
non-root user 'ntpd' (uid 123). "Vanilla" means the config doesn't include
command line or ntp.conf options changing the location of files or using any
files/dirs likely to be inaccessible to user ntpd.  Ntpd can still run as
non-root when using such options, but the admin must ensure all required
files and dirs are accessible, and then set ntpd_user=ntpd in rc.conf.

Note that these changes also address PR 199127 by using the command_args
technique suggested in the patch. They also tangentially address PR 113552,
which is primarily about inconsistent filenames in documentation, but some
of the inconsistancy was caused by old code in rc.d/ntpd which is leftover
from the intial import from netbsd. There was code to do chroot setup which
required the use of the netbsd clockctl(4) device; that code never had any
effect on freebsd, because we lack that device and don't build ntpd with the
options that would allow using it.

PR: 113552 199127
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16050

5 years agoAdd SPDX tags to example manual pages and POSIX copyright.
Mateusz Piotrowski [Fri, 20 Jul 2018 13:45:09 +0000 (13:45 +0000)]
Add SPDX tags to example manual pages and POSIX copyright.

Reviewed by: eadler
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D14958

5 years agoCentralize the complications for special efficient rounding to integers.
Bruce Evans [Fri, 20 Jul 2018 12:42:24 +0000 (12:42 +0000)]
Centralize the complications for special efficient rounding to integers.

This was open-coded in range reduction for trig and exp functions.  Now
there are 3 static inline functions rnint[fl]() that replace open-coded
expressions, and type-generic irint() and i64rint() macros that hide the
complications for efficiently using non-generic irint() and irintl()
functions and casts.

Special details:

ld128/e_rem_pio2l.h needs to use i64rint() since it needs a 46-bit integer
result.  Everything else only needs a (less than) 32-bit integer result so
uses irint().

Float and double cases now use float_t and double_t locally instead of
STRICT_ASSIGN() to avoid bugs in extra precision.

On amd64, inline asm is now only used for irint() on long doubles.  The SSE
asm for irint() on amd64 only existed because the ifdef tangles made the
correct method of simply casting to int for this case non-obvious.

5 years agoSet SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done.
Rick Macklem [Fri, 20 Jul 2018 12:03:16 +0000 (12:03 +0000)]
Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done.

During testing of the pNFS client, it was observed that an RPC could get
stuck in sosend() for a very long time if the network connection to a DS
had failed. This is fixed by setting SO_SNDTIMEO on the TCP socket.
This is only done when CLSET_TIMEOUT is done and this is not done by any
use of the krpc currently in the source tree, so there should be no effect
on extant uses.
A future patch will use CLSET_TIMEOUT for TCP connections to DSs.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16293

5 years agolibcrypt: There is no need to clear message digest context after they
Xin LI [Fri, 20 Jul 2018 07:16:28 +0000 (07:16 +0000)]
libcrypt: There is no need to clear message digest context after they
are finialized after r336539, so do not do it.

Submitted by: David CARLIER <devnexen gmail com>
MFC after: 1 month (after r336539)
Differential Revision: https://reviews.freebsd.org/D16059

5 years agoGet rid of unused variables.
Xin LI [Fri, 20 Jul 2018 07:07:27 +0000 (07:07 +0000)]
Get rid of unused variables.

copied_key and copied_salt are assigned with NULL and never used
otherwise. Remove the two variables and related code.

Reviewed by: pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16314

5 years agolibmd: Always erase context in _Final method, and when doing
Xin LI [Fri, 20 Jul 2018 07:01:28 +0000 (07:01 +0000)]
libmd: Always erase context in _Final method, and when doing
it, consistently use explicit_bzero().

Update manual pages to match the behavior.

Reviewed by: pfg, allanjude, jmg
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D16316

5 years agoBump version to 1200075 for zfsloader being folded into loader.
Warner Losh [Fri, 20 Jul 2018 05:34:02 +0000 (05:34 +0000)]
Bump version to 1200075 for zfsloader being folded into loader.

As an aside: 1200074 should be used as the last version with big
endian arm support, should that be needed. it was actually removed
a day later, but no bump was made until now.

5 years agoMention zfsloader being folded into loader in UPDATING.
Warner Losh [Fri, 20 Jul 2018 05:26:36 +0000 (05:26 +0000)]
Mention zfsloader being folded into loader in UPDATING.

5 years agoRemove three stray instances of zfsloader.
Warner Losh [Fri, 20 Jul 2018 05:26:14 +0000 (05:26 +0000)]
Remove three stray instances of zfsloader.

5 years agoHoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc
Warner Losh [Fri, 20 Jul 2018 05:18:03 +0000 (05:18 +0000)]
Hoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc

5 years agoNM and OBJCOPY are already defined for all builds. There's no need to
Warner Losh [Fri, 20 Jul 2018 05:17:56 +0000 (05:17 +0000)]
NM and OBJCOPY are already defined for all builds. There's no need to
conditionally define them here.

5 years agoEliminate zfsloader man page.
Warner Losh [Fri, 20 Jul 2018 05:17:49 +0000 (05:17 +0000)]
Eliminate zfsloader man page.

Remove all cross references to zfsloader.8 and /boot/zfsloader.
Move ZFS specific info into loader.8.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16361

5 years agoCollapse zfsloader functionality back down into loader.
Warner Losh [Fri, 20 Jul 2018 05:17:37 +0000 (05:17 +0000)]
Collapse zfsloader functionality back down into loader.

We no longer really need a separate zfsloader. It was useful when we
were first supporting ZFS and had limited ability to properly boot off
of ZFS without the special boot loader. Now that the boot loader has
matured, go the way loader.efi pioneered and just build one
binary. Change the name of the loader to load in the secondary boot
blocks to be just /boot/loader. Provide a symbolic link from zfsloader
to loader so people who have not upgraded their boot blocks are not
affected. This has the happy benefit of making coexistence easier as
well (fewer binaries in the matrix).

Discussed with: allanjude@, kevans@
RelNotes: Yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16361

5 years agoRemove a redundant declaration.
Cy Schubert [Fri, 20 Jul 2018 02:25:39 +0000 (02:25 +0000)]
Remove a redundant declaration.

While at it add a blank line, conforming with the convention
used in this file.

X-MFC-with: r336203

5 years agoTo reduce our diff between our sources and our upline, sync up
Cy Schubert [Fri, 20 Jul 2018 02:17:19 +0000 (02:17 +0000)]
To reduce our diff between our sources and our upline, sync up
with upline. Also making it easier to read.

Obtained from: diffing base with ports
X-MFC-with: r336203

5 years agoMFV: r336486
Cy Schubert [Fri, 20 Jul 2018 02:04:10 +0000 (02:04 +0000)]
MFV: r336486

Prevent reinstallation of an already in-use group key.
Upline git commit cb5132bb35698cc0c743e34fe0e845dfc4c3e410.

Obtained from: https://w1.fi/security/2017-1/\
rebased-v2.6-0002-Prevent-reinstallation-\
of-an-already-in-use-group-ke.patch
X-MFC-with: r336203

5 years agoRevert r336501. It was a of the wrong rev from the vendor branch.
Cy Schubert [Fri, 20 Jul 2018 01:53:28 +0000 (01:53 +0000)]
Revert r336501. It was a of the wrong rev from the vendor branch.

5 years agocryptocheck: Correct mismatch between OpenSSL use and OCF Blake2
Conrad Meyer [Fri, 20 Jul 2018 01:51:05 +0000 (01:51 +0000)]
cryptocheck: Correct mismatch between OpenSSL use and OCF Blake2

This corrects a mistake introduced to the cryptocheck tool in r331418.

Our CRYPTO_BLAKE2B and CRYPTO_BLAKE2S algorithms refer to either the plain,
unkeyed hashes (specified with cri_klen = 0), or a Blake2-specific keyed MAC
(when a cri_key is provided).

In contrast, OpenSSL's Blake2 algorithms only provide the plain hash.
Cryptocheck's T_HMAC corresponds to OpenSSL's HMAC() routine, which is the
ordinary HMAC construction applied to any plain, unkeyed hash.  We don't
have any HMAC-Blake2 cipher modes in OCF, so fix the test to only test
Blake2 as a plain hash.

(Ideally we would test keyed Blake2 as well, but that is left as future
work.)

PR: 229795

5 years agoAdd ntpd to the list of users/groups to check before installing.
Ian Lepore [Fri, 20 Jul 2018 00:44:04 +0000 (00:44 +0000)]
Add ntpd to the list of users/groups to check before installing.

5 years agoMake it possible to run ntpd as a non-root user, add ntpd uid and gid.
Ian Lepore [Thu, 19 Jul 2018 23:55:29 +0000 (23:55 +0000)]
Make it possible to run ntpd as a non-root user, add ntpd uid and gid.

Code analysis and runtime analysis using truss(8) indicate that the only
privileged operations performed by ntpd are adjusting system time, and
(re-)binding to privileged UDP port 123. These changes add a new mac(4)
policy module, mac_ntpd(4), which grants just those privileges to any
process running with uid 123.

This also adds a new user and group, ntpd:ntpd, (uid:gid 123:123), and makes
them the owner of the /var/db/ntp directory, so that it can be used as a
location where the non-privileged daemon can write files such as the
driftfile, and any optional logfile or stats files.

Because there are so many ways to configure ntpd, the question of how to
configure it to run without root privs can be a bit complex, so that will be
addressed in a separate commit. These changes are just what's required to
grant the limited subset of privs to ntpd, and the small change to ntpd to
prevent it from exiting with an error if running as non-root.

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

5 years agoNote big endian arm removal.
Warner Losh [Thu, 19 Jul 2018 23:54:18 +0000 (23:54 +0000)]
Note big endian arm removal.

5 years agoarm64: Add vt_efifb to GENERIC
Emmanuel Vadot [Thu, 19 Jul 2018 21:59:52 +0000 (21:59 +0000)]
arm64: Add vt_efifb to GENERIC

We can now have efifb being setup correctly.
Enjoy video output on some boards when you couldn't before.

Tested-On:  Pine64
Tested-On:  Pine64-LTS
Tested-On:  Pinebook