]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoSimplify the EFI delay() function by calling BS->Stall()
bcran [Fri, 26 Oct 2018 21:57:22 +0000 (21:57 +0000)]
Simplify the EFI delay() function by calling BS->Stall()

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

5 years agoAdd a very basic regression test for setfacl -R with NFSv4 ACLs.
markj [Fri, 26 Oct 2018 21:20:04 +0000 (21:20 +0000)]
Add a very basic regression test for setfacl -R with NFSv4 ACLs.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoMFV r339792:
mm [Fri, 26 Oct 2018 21:17:50 +0000 (21:17 +0000)]
MFV r339792:
Sync libarchive with vendor.

Relevant vendor changes:
  RAR5 reader: more maybe-uninitialized size_t fixes for riscv64
               FreeBSD build

MFC after: 1 month

5 years agoDon't set NFSv4 ACL inheritance flags on non-directories.
markj [Fri, 26 Oct 2018 21:17:06 +0000 (21:17 +0000)]
Don't set NFSv4 ACL inheritance flags on non-directories.

They only make sense in the context of directory ACLs, and attempting
to set them on regular files results in errors, causing a recursive
setfacl invocation to abort.

This is derived from patches by Shawn Webb <shawn.webb@hardenedbsd.org>
and Mitchell Horne <mhorne063@gmail.com>.

PR: 155163
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15061

5 years agoAdd initial descriptions for SCTP related MIB variable.
tuexen [Fri, 26 Oct 2018 21:04:17 +0000 (21:04 +0000)]
Add initial descriptions for SCTP related MIB variable.
This work was mostly done by Marie-Helene Kvello-Aune.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3583

5 years agoFortuna: Add failpoints to simulate initial seeding conditions
cem [Fri, 26 Oct 2018 21:03:57 +0000 (21:03 +0000)]
Fortuna: Add failpoints to simulate initial seeding conditions

Set debug.fail_point.random_fortuna_pre_read=return(1) and
debug.fail_point.random_fortuna_seeded=return(1) to return to unseeded
status (sort of).  See the Differential URL for more detail.

The goal is to reproduce e.g. Lev's recent CURRENT report[1] about failing
newfs arc4random(3) usage (fixed in r338542).

No functional change when failpoints are not set.

[1]: https://lists.freebsd.org/pipermail/freebsd-current/2018-September/071067.html

Reported by: lev
Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17047

5 years agofortuna: Drop global lock to zero stack variables
cem [Fri, 26 Oct 2018 21:00:26 +0000 (21:00 +0000)]
fortuna: Drop global lock to zero stack variables

Also drop explicit zeroing of hash context -- hash finish() operation is
expected to do this.

PR: 230877
Suggested by: delphij@
Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16986

5 years agoFortuna: fix a correctness issue in reseed (fortuna_pre_read)
cem [Fri, 26 Oct 2018 20:55:01 +0000 (20:55 +0000)]
Fortuna: fix a correctness issue in reseed (fortuna_pre_read)

'i' counts the number of pools included in the array 's'.  Passing 'i+1' to
reseed_internal() as the number of blocks in 's' is a bogus overrun of the
initialized portion of 's' -- technically UB.

I found this via code inspection, referencing ยง9.5.2 "Pools" of the Fortuna
chapter, but I would expect Coverity to notice the same issue.
Unfortunately, it doesn't appear to.

Reviewed by: markm
Approved by: secteam (gordon)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16985

5 years agorijndael (AES): Avoid leaking sensitive data on kernel stack
cem [Fri, 26 Oct 2018 20:53:01 +0000 (20:53 +0000)]
rijndael (AES): Avoid leaking sensitive data on kernel stack

Noticed this investigating Fortuna.  Remove useless duplicate stack copies
of sensitive contents when possible, or if not possible, be sure to zero
them out when we're finished.

Approved by: secteam (gordon)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16935

5 years agopoll: Unify userspace pollfd pointer name
cem [Fri, 26 Oct 2018 20:07:46 +0000 (20:07 +0000)]
poll: Unify userspace pollfd pointer name

Some of the poll code used 'fds' and some used 'ufds' to refer to the
uap->fds userspace pointer that was passed around to subroutines.  Some of
the poll code used 'fds' to refer to the kernel memory pollfd arrays, which
seemed unnecessarily confusing.

Unify on 'ufds' to refer to the userspace pollfd array.

Additionally, 'bits' is not an accurate description of the kernel pollfd
array in kern_poll, so rename that to 'kfds'.  Finally, clean up some logic
with mallocarray() and nitems().

No functional change.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D17670

5 years agodumpon.8: Significantly revamp page
cem [Fri, 26 Oct 2018 20:03:59 +0000 (20:03 +0000)]
dumpon.8: Significantly revamp page

Start with a short summary and cover the options in a standard list style.

Organize sections by common focus and prioritize more useful information
closer to the top.

Flesh out authors, history, caveats, and security considerations sections.

Reviewed by: markj, eadler (previous version)
Differential Revision: https://reviews.freebsd.org/D17679

5 years agodumpon(8): Provide seatbelt against weak RSA keys
cem [Fri, 26 Oct 2018 19:53:59 +0000 (19:53 +0000)]
dumpon(8): Provide seatbelt against weak RSA keys

The premise of dumpon -k foo.pem is that dump contents will be confidential
except to anyone holding the corresponding RSA private key.

This guarantee breaks down when weak RSA keys are used.  Small RSA keys
(e.g. 512 bits) can be broken on a single personal computer in tractible
time.  Marginal RSA keys (768 bits) can be broken by EC2 and a few dollars.
Even 1024 bit keys can probably be broken by sophisticated and wealthy
attackers.

NIST SP800-57 (2016) recommends a minimum of 2048 bit RSA keys, and
estimates this provides 112 bits of security.

It would also be good to protect users from weak values of 'e' (i.e., 3) and
perhaps sanity check that their public key .pem does not accidentally
contain their private key as well.  These considerations are left as future
work.

Reviewed by: markj, darius AT dons.net.au (previous version)
Discussed with: bjk
Differential Revision: https://reviews.freebsd.org/D17678

5 years agoAdd blank line after each item in "ngctl ls -l"
dteske [Fri, 26 Oct 2018 19:16:17 +0000 (19:16 +0000)]
Add blank line after each item in "ngctl ls -l"

The output of "ngctl ls -l" is hard to read. To make it easier, add a blank
line after each listed item much how traditional "ls -l" does when listing
the contents of multiple directories.

Sponsored by: Smule, Inc.

5 years agoUpdate and re-enable ACL tests following r332396 and r339781.
markj [Fri, 26 Oct 2018 19:03:30 +0000 (19:03 +0000)]
Update and re-enable ACL tests following r332396 and r339781.

PR: 229930
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoDon't print pathconf() errors if the target file doesn't exist.
markj [Fri, 26 Oct 2018 19:01:52 +0000 (19:01 +0000)]
Don't print pathconf() errors if the target file doesn't exist.

The subsequent acl_get_file(3) call will simply echo the same error.

PR: 229930
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoAvoid leaking memory in error paths.
markj [Fri, 26 Oct 2018 18:56:58 +0000 (18:56 +0000)]
Avoid leaking memory in error paths.

CID: 1390906
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoMove 32-bit compat support for FIODGNAME to the right place.
brooks [Fri, 26 Oct 2018 17:59:25 +0000 (17:59 +0000)]
Move 32-bit compat support for FIODGNAME to the right place.

ioctl(2) commands only have meaning in the context of a file descriptor
so translating them in the syscall layer is incorrect.

The new handler users an accessor to retrieve/construct a pointer from
the last member of the passed structure and relies on type punning to
access the other member which requires no translation.

Unlike r339174 this change supports both places FIODGNAME is handled.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17475

5 years agoRemove empty directories after r339776.
imp [Fri, 26 Oct 2018 16:34:19 +0000 (16:34 +0000)]
Remove empty directories after r339776.

git svn won't remove empty directories without --rmdir which I
forgot in r339776.

5 years agoAdd statistics for TRIM comands
imp [Fri, 26 Oct 2018 16:23:51 +0000 (16:23 +0000)]
Add statistics for TRIM comands

Add a counter for the LBAs, Ranges and hardware commands so that we
can provide additional color to the statistics we provide to vendors.

Sponsored by: Netflix, Inc

5 years agoRedo r339563: Remove joy(4) driver.
imp [Fri, 26 Oct 2018 16:03:30 +0000 (16:03 +0000)]
Redo r339563: Remove joy(4) driver.

This driver was marked as gone in 12. We're at 13 now. Remove it.
Data from nycbug's dmesg cache shows only one potential user,
suggesting it never was used much. However, even though this device
has been obsolete for 15 years at least, sys/joystick.h is included in
a number of graphics packages still, so that remains. A full exprun
is needed before that can be removed.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D17629

5 years agoPut a workaround in for command timeout malfunctioning
imp [Fri, 26 Oct 2018 14:27:37 +0000 (14:27 +0000)]
Put a workaround in for command timeout malfunctioning

At least one NVMe drive has a bug that makeing the Command Time Out
PCIe feature unreliable. The workaround is to disable this
feature. The driver wouldn't deal correctly with a timeout anyway.
Only do this for drives that are known bad.

Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D17708

5 years agoo Add pmap lock around pmap_fault_fixup() to ensure other thread will not
br [Fri, 26 Oct 2018 12:27:07 +0000 (12:27 +0000)]
o Add pmap lock around pmap_fault_fixup() to ensure other thread will not
  modify l3 pte after we loaded old value and before we stored new value.
o Preset A(accessed), D(dirty) bits for kernel mappings.

Reported by: kib
Reviewed by: markj
Discussed with: jhb
Sponsored by: DARPA, AFRL

5 years agoAdd __dso_handle to the BSD crtbegin. This is used to identify shared
andrew [Fri, 26 Oct 2018 11:53:20 +0000 (11:53 +0000)]
Add __dso_handle to the BSD crtbegin. This is used to identify shared
objects.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoDrop the csu tests WARNS to 5 to fix the powerpc64 build.
andrew [Fri, 26 Oct 2018 08:12:28 +0000 (08:12 +0000)]
Drop the csu tests WARNS to 5 to fix the powerpc64 build.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoAdjust bsdinstall zfsboot code to 80-columns and whitespace fixes
dteske [Fri, 26 Oct 2018 05:25:22 +0000 (05:25 +0000)]
Adjust bsdinstall zfsboot code to 80-columns and whitespace fixes

No functional changes.

Sponsored by: Smule, Inc.

5 years agoRemove #warning since it breaks libsysdecode
imp [Fri, 26 Oct 2018 04:53:29 +0000 (04:53 +0000)]
Remove #warning since it breaks libsysdecode

5 years agoBump to 1300002 for sys/joystick.h removal reversion.
imp [Fri, 26 Oct 2018 04:13:56 +0000 (04:13 +0000)]
Bump to 1300002 for sys/joystick.h removal reversion.

5 years agoAdd warning to sys/joystick.h announcing its planned demise.
imp [Fri, 26 Oct 2018 04:11:58 +0000 (04:11 +0000)]
Add warning to sys/joystick.h announcing its planned demise.

5 years agoRevert r339563.
imp [Fri, 26 Oct 2018 04:10:32 +0000 (04:10 +0000)]
Revert r339563.

I held the mistaken belief this was completely unused. While the
driver is unused and likely not relevant for a long time,
sys/joystick.h lives on in maybe half a dozen ports, even though
hardware to use it hasn't been widely used in maybe 15 years.

5 years agoFix dialog autosizing in bsdinstall auto error messages
dteske [Fri, 26 Oct 2018 02:08:44 +0000 (02:08 +0000)]
Fix dialog autosizing in bsdinstall auto error messages

Sponsored by: Smule, Inc.

5 years agoWhitespace alignment in bsdinstall hostname
dteske [Fri, 26 Oct 2018 01:57:32 +0000 (01:57 +0000)]
Whitespace alignment in bsdinstall hostname

Aligning line-continuation characters to prevent mistakes.
This is also the prevalent style replication throughout.

Sponsored by: Smule, Inc.

5 years agoSort i18n strings in bsdinstall hostname
dteske [Fri, 26 Oct 2018 01:47:52 +0000 (01:47 +0000)]
Sort i18n strings in bsdinstall hostname

Sponsored by: Smule, Inc.

5 years agoUpdate elftoolchain bootstrapping test after r339083
emaste [Fri, 26 Oct 2018 01:13:20 +0000 (01:13 +0000)]
Update elftoolchain bootstrapping test after r339083

Sponsored by: The FreeBSD Foundation

5 years agoAdd improved error checking to bsdinstall hostname
dteske [Fri, 26 Oct 2018 01:06:03 +0000 (01:06 +0000)]
Add improved error checking to bsdinstall hostname

Sponsored by: Smule, Inc.

5 years agoFix dialog autosizing in bsdinstall hostname
dteske [Fri, 26 Oct 2018 00:08:27 +0000 (00:08 +0000)]
Fix dialog autosizing in bsdinstall hostname

Sponsored by: Smule, Inc.

5 years agoDistinguish _CID match and _HID match and make lower priority probe
takawata [Fri, 26 Oct 2018 00:05:46 +0000 (00:05 +0000)]
Distinguish _CID match and _HID match and make lower priority probe
when _CID match.

Reviewed by: jhb, imp
Differential Revision:https://reviews.freebsd.org/D16468

5 years agoRemove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr
dteske [Thu, 25 Oct 2018 23:32:32 +0000 (23:32 +0000)]
Remove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr

Sponsored by: Smule, Inc.

5 years agoMFV r339750:
mm [Thu, 25 Oct 2018 23:13:19 +0000 (23:13 +0000)]
MFV r339750:
Sync libarchive with vendor.

Relevant vendor changes:
  RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64),
               sparc64 and riscv64

MFC after: 1 month

5 years agocxgbe(4): Add a knob to split the rx queues for a netmap enabled
np [Thu, 25 Oct 2018 22:55:18 +0000 (22:55 +0000)]
cxgbe(4): Add a knob to split the rx queues for a netmap enabled
interface into two groups.  Filters can be used to match traffic
and distribute it across a group.

hw.cxgbe.nm_split_rss

Sponsored by: Chelsio Communications

5 years agoImplement O_BENEATH and AT_BENEATH.
kib [Thu, 25 Oct 2018 22:16:34 +0000 (22:16 +0000)]
Implement O_BENEATH and AT_BENEATH.

Flags prevent open(2) and *at(2) vfs syscalls name lookup from
escaping the starting directory.  Supposedly the interface is similar
to the same proposed Linux flags.

Reviewed by: jilles (code, previous version of manpages), 0mp (manpages)
Discussed with: allanjude, emaste, jonathan
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17547

5 years agoMinor style fixes around script execution.
markj [Thu, 25 Oct 2018 21:45:24 +0000 (21:45 +0000)]
Minor style fixes around script execution.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoMFV r339640,339641,339644:
mm [Thu, 25 Oct 2018 21:44:17 +0000 (21:44 +0000)]
MFV r339640,339641,339644:
Sync libarchive with vendor

Relevant vendor changes:
  PR #1013: Add missing h_base offset when performing absolute seeks in
            xar decompression
  PR #1061: Add support for extraction of RAR v5 archives
  PR #1066: Fix out of bounds read on empty string filename for gnutar, pax
            and v7tar
  PR #1067: Fix temporary file path buffer overflow in tests
  IS #1068: Correctly process and verify integer arguments passed to
            bsdcpio and bsdtar
  PR #1070: Don't default XAR entry atime/mtime to the current time

MFC after: 1 month

5 years agoClarify the description of the -u option.
markj [Thu, 25 Oct 2018 21:41:58 +0000 (21:41 +0000)]
Clarify the description of the -u option.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoAdd a missing include for src.opts.mk. Without it MK_TESTS isn't defined.
andrew [Thu, 25 Oct 2018 21:08:15 +0000 (21:08 +0000)]
Add a missing include for src.opts.mk. Without it MK_TESTS isn't defined.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoUpdate SHLIB_VERSION_NUMBER following the OpenSSL shared library
gjb [Thu, 25 Oct 2018 18:46:45 +0000 (18:46 +0000)]
Update SHLIB_VERSION_NUMBER following the OpenSSL shared library
number bump.

Reported by: jkim
Discussed with: kib
MFC after: immediate
Sponsored by: The FreeBSD Foundation

5 years agoUse correct format specificator to print setdscp action.
ae [Thu, 25 Oct 2018 18:06:23 +0000 (18:06 +0000)]
Use correct format specificator to print setdscp action.

PR: 232642
MFC after: 3 days

5 years agoRegen src.conf.5 to add WITH_BSD_CRTBEGIN
andrew [Thu, 25 Oct 2018 17:42:43 +0000 (17:42 +0000)]
Regen src.conf.5 to add WITH_BSD_CRTBEGIN

Sponsored by: DARPA, AFRL

5 years agoImplement a BSD licensed crtbegin/crtend
andrew [Thu, 25 Oct 2018 17:39:41 +0000 (17:39 +0000)]
Implement a BSD licensed crtbegin/crtend

These are needed for .ctors/.dtors and .jcr handling. The former needs
all the function pointers to be called in the correct order from the
.init/.fini section. The latter just needs to call a gcj specific function
if it exists with a pointer to the start of the .jcr section.

This is currently disabled until __dso_handle support is added.

Reviewed by: emaste
MFC after: 1 month
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17587

5 years agoRemove a dead store.
markj [Thu, 25 Oct 2018 17:36:28 +0000 (17:36 +0000)]
Remove a dead store.

CID: 1304878
MFC after: 1 week

5 years agoUpdate comment for AMI00[12]0 override.
imp [Thu, 25 Oct 2018 17:17:11 +0000 (17:17 +0000)]
Update comment for AMI00[12]0 override.

The AML is even stupider than always returning 0. It will only return
non-zero for an OS that reports itself as "Windows 2015", at least
on the Threadripper board's AML that I've examined.

Those AMLs also suggest we may need this quirk for AMI0030 as well.
There may be other cases where we need to override the _STA in a
generic way, so we should consider writing code to do that.

5 years agoAdd FALLTHROUGH comments to appease Coverity.
markj [Thu, 25 Oct 2018 15:43:21 +0000 (15:43 +0000)]
Add FALLTHROUGH comments to appease Coverity.

CID: 1017862-10178641017866-1017868
MFC after: 2 weeks

5 years agoBump __FreeBSD_version following the OpenSSL shared library version
gjb [Thu, 25 Oct 2018 15:41:26 +0000 (15:41 +0000)]
Bump __FreeBSD_version following the OpenSSL shared library version
number bump.

Submitted by: antoine
MFC with: r339709
Sponsored by: The FreeBSD Foundation

5 years agoefivar(3): Fix some typos and improve style
0mp [Thu, 25 Oct 2018 15:41:19 +0000 (15:41 +0000)]
efivar(3): Fix some typos and improve style

- Fix some typos.
- Remove redundant semicolons from the synopsis section.
- Stylize variable names and types with Vt and Va respectively.
- Use a list to present non-implemented functions.
- Sort the order of the sections.
- Add a history section.
- Use Nm when "libefivar" is mentioned.

PR: 232626
Reported by: Tiwei Bie <btw@mail.ustc.edu.cn>
Reviewed by: bcr, imp
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17686

5 years agoRemove a redundant check.
markj [Thu, 25 Oct 2018 15:40:59 +0000 (15:40 +0000)]
Remove a redundant check.

CID: 1042100
MFC after: 2 weeks

5 years agocxgbe(4): Allow "pass" filters to distribute matching traffic using a
np [Thu, 25 Oct 2018 14:37:26 +0000 (14:37 +0000)]
cxgbe(4): Allow "pass" filters to distribute matching traffic using a
subset of a VI's RSS indirection table.

This makes it possible to make groups out of rx queues and steer
different kinds of traffic to different groups.  For example, an
interface with 8 rx queues could have all non-TCP traffic delivered to
queues 0-3 and all TCP traffic to queues 4-7.

Note that it is already possible for filters to steer traffic to a
particular queue or to distribute it using the full indirection table
(much like normal rx does).

Sponsored by: Chelsio Communications

5 years agoBump base OpenSSL libraries versions to avoid conflict with port's libraries.
kib [Thu, 25 Oct 2018 13:37:57 +0000 (13:37 +0000)]
Bump base OpenSSL libraries versions to avoid conflict with port's libraries.

Reported by: many
Reviewed by: gjb
Sponsored by: The FreeBSD Foundation
MFC after: 3 hours

5 years agoAllow fdisk(8) to deal with sectors larger than 2048
rgrimes [Thu, 25 Oct 2018 12:13:13 +0000 (12:13 +0000)]
Allow fdisk(8) to deal with sectors larger than 2048
especially for 4Kn drives with PMBR's

Approved by:    bde (mentor)
MFC:            3 days

5 years agoNow that the portsnap buildbox is generating the raw bits for INDEX-13,
delphij [Thu, 25 Oct 2018 08:05:53 +0000 (08:05 +0000)]
Now that the portsnap buildbox is generating the raw bits for INDEX-13,
add it to the set of INDEX files built by portsnap.

Switch to INDEX-13 for head/.

5 years agocxgbe(4): Update the VI's default queue when netmap is enabled/disabled.
np [Thu, 25 Oct 2018 06:24:42 +0000 (06:24 +0000)]
cxgbe(4): Update the VI's default queue when netmap is enabled/disabled.

Sponsored by: Chelsio Communications

5 years agoDeprecate a number of less used 10 and 10/100 Ethernet devices.
brooks [Thu, 25 Oct 2018 04:10:41 +0000 (04:10 +0000)]
Deprecate a number of less used 10 and 10/100 Ethernet devices.

The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,
pcn, sf, sn, tl, tx, txp, vx, wb, xe

The list as refined as part of FCP-0101. Per the FCP, devices may be
removed from the deprecation list if enough users are found or they are
converted to iflib.

FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md

5 years agolualoader: Improve module loading diagnostics
kevans [Thu, 25 Oct 2018 02:14:35 +0000 (02:14 +0000)]
lualoader: Improve module loading diagnostics

Some fixes:

- Maintain historical behavior more accurately w.r.t verbose_loading;
  verbose_loading strictly prints "${module_name...}" and later "failed!"
  or "ok" based on load success
- With or without verbose_loading, dump command_errbuf on load failure.
  This usually happens prior to ok/failed if we're verbose_loading

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17694

5 years agoUpdate lualoader test script a little bit
kevans [Thu, 25 Oct 2018 02:04:01 +0000 (02:04 +0000)]
Update lualoader test script a little bit

Use userboot.so from the test directory if possible, fall back to .OBJDIR.
This avoids a problem that we've had since userboot coexistence was added,
where userboot.so alone no longer exists in the .OBJDIR but is instead just
a link installed later.

5 years agocxgbe(4): new sysctl to display the start of the RSS region for a VI.
np [Thu, 25 Oct 2018 01:20:32 +0000 (01:20 +0000)]
cxgbe(4): new sysctl to display the start of the RSS region for a VI.

dev.<ifname>.<inst>.rss_base

For example:
dev.cc.0.rss_base: 0
dev.cc.1.rss_base: 128
dev.vcc.0.rss_base: 256
dev.vcc.1.rss_base: 384

Sponsored by: Chelsio Communications

5 years agoRemove code that is dead since r287197. Today wlan(4) interfaces aren't
glebius [Wed, 24 Oct 2018 20:49:51 +0000 (20:49 +0000)]
Remove code that is dead since r287197. Today wlan(4) interfaces aren't
children of some other interface. Creation happens only in wlan_up().

5 years agoCorrect condition to detect mount(2) support by a filesystem.
kib [Wed, 24 Oct 2018 19:40:09 +0000 (19:40 +0000)]
Correct condition to detect mount(2) support by a filesystem.

Reported and tested by: cy
Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)

5 years agoadd links to the saga of CTM
imp [Wed, 24 Oct 2018 19:21:04 +0000 (19:21 +0000)]
add links to the saga of CTM

Submitted by: phk

5 years agoClarify slightly the interaction between wait*() and pdfork().
markj [Wed, 24 Oct 2018 18:42:13 +0000 (18:42 +0000)]
Clarify slightly the interaction between wait*() and pdfork().

There are multiple ways to wait for any child process to return a
status (e.g., waitpid(-1, ...), waitid(P_ALL, ...)), so don't be so
specific.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoAdd a !NUMA definition for vm_domainset_iter_policy_ref_init().
markj [Wed, 24 Oct 2018 17:09:20 +0000 (17:09 +0000)]
Add a !NUMA definition for vm_domainset_iter_policy_ref_init().

Pointy hat: markj
X-MFC with: r339661
Sponsored by: The FreeBSD Foundation

5 years agoAdd an #include required after r339686.
markj [Wed, 24 Oct 2018 16:49:16 +0000 (16:49 +0000)]
Add an #include required after r339686.

X-MFC with: r339686
Sponsored by: The FreeBSD Foundation

5 years agoAlways free dynamically allocated memory before returning.
markj [Wed, 24 Oct 2018 16:46:26 +0000 (16:46 +0000)]
Always free dynamically allocated memory before returning.

CID: 1007418
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoUse a vm_domainset iterator in keg_fetch_slab().
markj [Wed, 24 Oct 2018 16:41:47 +0000 (16:41 +0000)]
Use a vm_domainset iterator in keg_fetch_slab().

Previously, it used a hand-rolled round-robin iterator.  This meant that
the minskip logic in r338507 didn't apply to UMA allocations, and also
meant that we would call vm_wait() for individual domains rather than
permitting an allocation from any domain with sufficient free pages.

Discussed with: jeff
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17420

5 years agonetmap: add man page for the vale-ctl program
vmaffione [Wed, 24 Oct 2018 16:01:56 +0000 (16:01 +0000)]
netmap: add man page for the vale-ctl program

Added man page for vale-ctl program.
Small fixes to vale-ctl, including the support for -m option
(to specify the netmap memory allocator id).

Reviewed by: 0mp
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17683

5 years agoReduce the GCE image size to 27G to be lower than the free
gjb [Wed, 24 Oct 2018 15:51:55 +0000 (15:51 +0000)]
Reduce the GCE image size to 27G to be lower than the free
quota limit.

PR: 232313
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoRemove redundant redeclaration of netmap_vp_reg().
bz [Wed, 24 Oct 2018 14:14:49 +0000 (14:14 +0000)]
Remove redundant redeclaration of netmap_vp_reg().
This should unbreak sparc64 and powerpc LINT builds.

5 years agorip6_input() inp validation after epoch(9)
bz [Wed, 24 Oct 2018 10:42:35 +0000 (10:42 +0000)]
rip6_input() inp validation after epoch(9)

After r335924 rip6_input() needs inp validation to avoid
working on FREED inps.

Apply the relevant bits from r335497,r335501 (rip_input() change)
to the IPv6 counterpart.

PR: 232194
Reviewed by: rgrimes, ae (,hps)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17594

5 years agoAllow the bhyve VNC server to listen on IPv6 for incoming connections.
bz [Wed, 24 Oct 2018 08:45:33 +0000 (08:45 +0000)]
Allow the bhyve VNC server to listen on IPv6 for incoming connections.

Alternatively to IPv4 address:port this will allow to listen on IPv6
link-local (incl. scope), a specific address, or ::.  Addresses have
to be given in RFC2732 format so that [::]:port parsing will work.

This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve.

PR: 232018
Submitted by: Dave Rush (northwoodlogic.free gmail.com) (original)
Reviewed by: Dave Rush (updated verison)
MFC after: 3 days

5 years agomenu.lua: Abort autoboot sequence on failed command
kevans [Wed, 24 Oct 2018 03:14:10 +0000 (03:14 +0000)]
menu.lua: Abort autoboot sequence on failed command

Currently, a timeout in the menu autoboot sequence would effectively do
nothing. We would return from the autoboot handling, then begin processing
the menu without redrawing it.

This change makes the behavior a little more friendly. Returning the user to
the menu can't have any good effects, so abort the autoboot sequence and
drop to the loader prompt.

MFC after: 3 days

5 years agolualoader: unload upon kernel change if a kernel was previously loaded
kevans [Wed, 24 Oct 2018 02:02:37 +0000 (02:02 +0000)]
lualoader: unload upon kernel change if a kernel was previously loaded

In the majority of cases, a kernel is not loaded before we hit the menu.
However, if a password is set, we'll trigger autoboot and have loadelf'd
beforehand. We also need to take into account one dropping to the loader
prompt and twiddling with things manually; if they try to toggle through
kernels, we'll assume they mean it.

Reported by: trasz
MFC after:  3 days

5 years agopf: Fix copy/paste error in IPv6 address rewriting
kp [Wed, 24 Oct 2018 00:19:44 +0000 (00:19 +0000)]
pf: Fix copy/paste error in IPv6 address rewriting

We checked the destination address, but replaced the source address. This was
fixed in OpenBSD as part of their NAT rework, which we don't want to import
right now.

CID: 1009561
MFC after: 3 weeks

5 years agoFix comments.
markj [Wed, 24 Oct 2018 00:17:19 +0000 (00:17 +0000)]
Fix comments.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agopf: ifp can never be NULL in pfi_ifaddr_event()
kp [Tue, 23 Oct 2018 23:15:44 +0000 (23:15 +0000)]
pf: ifp can never be NULL in pfi_ifaddr_event()

There's no point in the NULL check for ifp, because we'll already have
dereferenced it by then. Moreover, the event will always have a valid ifp.

Replace the late check with an early assertion.

CID: 1357338

5 years agoFix stand/ build after r339671.
kib [Tue, 23 Oct 2018 23:11:38 +0000 (23:11 +0000)]
Fix stand/ build after r339671.

ffs_subr.c requires calculate_crc32c() from libkern.  Unfortunately we
cannot just add libkern/crc32.c to libstand because crc32.o is already
compiled from contrib/zlib/crc32.c. Use the include trick to rename
the source.

Note that libstand also provides crc32.c which seems to be unused.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17677

5 years agoOnly call sigdeferstop() for NFS.
kib [Tue, 23 Oct 2018 21:43:41 +0000 (21:43 +0000)]
Only call sigdeferstop() for NFS.

Use bypass to catch any NFS VOP dispatch and route it through the
wrapper which does sigdeferstop() and then dispatches original
VOP. NFS does not need a bypass below it, which is not supported.

The vop offset in the vop_vector is added since otherwise it is
impossible to get vop_op_t from the internal table, and I did not
wanted to create the layered fs only to wrap NFS VOPs.

VFS_OP()s wrap is straightforward.

Requested and reviewed by: mjg (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17658

5 years agoContinuing efforts to provide hardening of FFS, this change adds a
mckusick [Tue, 23 Oct 2018 21:10:06 +0000 (21:10 +0000)]
Continuing efforts to provide hardening of FFS, this change adds a
check hash to the superblock. If a check hash fails when an attempt
is made to mount a filesystem, the mount fails with EINVAL (Invalid
argument). This avoids a class of filesystem panics related to
corrupted superblocks. The hash is done using crc32c.

Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily
used in embedded systems with small memories and low-powered processors
which need as light-weight a filesystem as possible.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoFor the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
imp [Tue, 23 Oct 2018 20:45:46 +0000 (20:45 +0000)]
For the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
some ports can be updated.

5 years agocxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.
np [Tue, 23 Oct 2018 18:32:55 +0000 (18:32 +0000)]
cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.

Submitted By: Lily Wang @ Netapp

MFC after: 1 week

5 years agoSupport the SHA224 HMAC algorithm in ccr(4).
jhb [Tue, 23 Oct 2018 18:31:39 +0000 (18:31 +0000)]
Support the SHA224 HMAC algorithm in ccr(4).

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoAdd sha224 to the authctx union.
jhb [Tue, 23 Oct 2018 18:07:37 +0000 (18:07 +0000)]
Add sha224 to the authctx union.

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoInitialize static domainsets regardless of whether an SRAT is present.
markj [Tue, 23 Oct 2018 18:07:16 +0000 (18:07 +0000)]
Initialize static domainsets regardless of whether an SRAT is present.

Reported by: yuripv
X-MFC with: r339452
Sponsored by: The FreeBSD Foundation

5 years agoInitializer error variable in nvdimm_spa_uio().
kib [Tue, 23 Oct 2018 17:53:35 +0000 (17:53 +0000)]
Initializer error variable in nvdimm_spa_uio().

Several code paths might result in returning uninitialized value.

Reported by: coverity through cem
CID: 1396315
Sponsored by: The FreeBSD Foundation

5 years agoRevert r339634.
erj [Tue, 23 Oct 2018 17:06:36 +0000 (17:06 +0000)]
Revert r339634.

That commit is causing kernel panics in em(4), so this will be reverted
until those are fixed.

Reported by: ae@, pho@, et al
Sponsored by: Intel Corporation

5 years agoRefactor domainset iterators for use by malloc(9) and UMA.
markj [Tue, 23 Oct 2018 16:35:58 +0000 (16:35 +0000)]
Refactor domainset iterators for use by malloc(9) and UMA.

Before this change we had two flavours of vm_domainset iterators: "page"
and "malloc".  The latter was only used for kmem_*() and hard-coded its
behaviour based on kernel_object's policy.  Moreover, its use contained
a race similar to that fixed by r338755 since the kernel_object's
iterator was being run without the object lock.

In some cases it is useful to be able to explicitly specify a policy
(domainset) or policy+iterator (domainset_ref) when performing memory
allocations.  To that end, refactor the vm_dominset_* KPI to permit
this, and get rid of the "malloc" domainset_iter KPI in the process.

Reviewed by: jeff (previous version)
Tested by: pho (part of a larger patch)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17417

5 years agonetmap: add man page for the bridge program
vmaffione [Tue, 23 Oct 2018 15:34:43 +0000 (15:34 +0000)]
netmap: add man page for the bridge program

Added bridge(8).
Also, minor fixes to the netmap "bridge" application:
 - indentation fixes and code cleanup
 - better usage description
 - better processing of netmap flags

Reviewed by: 0mp
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17664

5 years agoloader: biosdisk interface should be able to cope with 4k sectors
tsoome [Tue, 23 Oct 2018 14:44:32 +0000 (14:44 +0000)]
loader: biosdisk interface should be able to cope with 4k sectors

The 4kn support in current bios specific biosdisk.c is broken, as the code
is only implementing the support for the 512B sector size.

This work is building the support for custom size sectors, we still do assume
the requested data to be multiple of 512B blocks and we only do address the
biosdisk.c interface here.

For reference, see also:
https://www.illumos.org/issues/8303
https://www.illumos.org/rb/r/547

As the GELI is moved above biosdisk "layer", the GELI should just work

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D11174

5 years agoAdd debug.witness.trace=0 back to the installer sysctl.conf(5),
gjb [Tue, 23 Oct 2018 14:38:08 +0000 (14:38 +0000)]
Add debug.witness.trace=0 back to the installer sysctl.conf(5),
incorrectly removed from head when it should have been removed
from stable/12 post-branch.

Reported by: bdrewery
Sponsored by: The FreeBSD Foundation

5 years agoFollow up on r331936. gets_s(3) will also fail in the same way that
cy [Tue, 23 Oct 2018 14:16:02 +0000 (14:16 +0000)]
Follow up on r331936. gets_s(3) will also fail in the same way that
gets(3) does. This was missed in r331936.

Reported by: emaste@
MFC after: 3 days

5 years agoPick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:
trasz [Tue, 23 Oct 2018 14:11:35 +0000 (14:11 +0000)]
Pick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:

    Rework the way jemalloc uses mmap(2) on FreeBSD.

    This makes it directly use MAP_EXCL and MAP_ALIGNED() instead
    of weird workarounds involving mapping at random places and then
    unmapping parts of them.

Discussed with: jasone
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoPick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:
trasz [Tue, 23 Oct 2018 13:54:54 +0000 (13:54 +0000)]
Pick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:

    Disable runtime detection of lazy purging support on FreeBSD.

    The check doesn't seem to serve any purpose here, and this shaves
    off three syscalls on binary startup.

Discussed by: jasone
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoAdd an IMPLEMENTATION NOTES section to ldd.1.
markj [Tue, 23 Oct 2018 13:49:53 +0000 (13:49 +0000)]
Add an IMPLEMENTATION NOTES section to ldd.1.

PR: 231926
Reviewed by: emaste
MFC after: 1 month

5 years agolibsa: re-send ACK for older data packets in tftp
tsoome [Tue, 23 Oct 2018 13:38:39 +0000 (13:38 +0000)]
libsa: re-send ACK for older data packets in tftp

In current tftp code we drop out-of-order packets; however, we should play
nice and re-send ACK for older data packets we are receiving. This will
hopefully stop server repeating those packets we already have received.
Note we do not answer duplicates from "previous" session (that is, session
with different port number), those will eventually time out.

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