]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoProvide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
yuripv [Sat, 27 Oct 2018 21:24:28 +0000 (21:24 +0000)]
Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
Architectures Software Developer’s Manual Volume 3").  Add the document
to SEE ALSO in bhyve.8 (and pet manlint here a bit).

Reviewed by: jhb, rgrimes, 0mp
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17531

5 years agoevdev: disable evdev if it is invoked from KDB or panic context
wulf [Sat, 27 Oct 2018 21:04:34 +0000 (21:04 +0000)]
evdev: disable evdev if it is invoked from KDB or panic context

This allow to prevent deadlock on entering KDB if one of evdev locks is
already taken by userspace process.

Also this change discards all but LED console events produced by KDB as
unrelated to userspace.

Tested by: dumbbell (as part of D15070)
Objected by: bde (as 'KDB lock an already locked mutex' problem solution)
MFC after: 1 month

5 years agoevdev: Use console lock as evdev lock for all supported keyboard drivers.
wulf [Sat, 27 Oct 2018 20:22:41 +0000 (20:22 +0000)]
evdev: Use console lock as evdev lock for all supported keyboard drivers.

Now evdev part of keyboard drivers does not take any locks if corresponding
input/eventN device node is not opened by userland consumers.

Do not assert console lock inside evdev to handle the cases when keyboard
driver is called from some special single-threaded context like shutdown
thread.

5 years agosh: Use exitstatus instead of exerrno to pass EXEXEC status
jilles [Sat, 27 Oct 2018 20:17:57 +0000 (20:17 +0000)]
sh: Use exitstatus instead of exerrno to pass EXEXEC status

No functional change is intended.

5 years agoUse M_WAITOK in init_hwpmc().
markj [Sat, 27 Oct 2018 18:48:49 +0000 (18:48 +0000)]
Use M_WAITOK in init_hwpmc().

No functional change intended.

MFC after: 2 weeks

5 years agoEliminate typically pointless calls to vm_fault_prefault() on soft, copy-
alc [Sat, 27 Oct 2018 17:49:46 +0000 (17:49 +0000)]
Eliminate typically pointless calls to vm_fault_prefault() on soft, copy-
on-write faults.  On a page fault, when we call vm_fault_prefault(), it
probes the pmap and the shadow chain of vm objects to see if there are
opportunities to create read and/or execute-only mappings to neighoring
pages.  For example, in the case of hard faults, such effort typically pays
off, that is, mappings are created that eliminate future soft page faults.
However, in the the case of soft, copy-on-write faults, the effort very
rarely pays off.  (See the review for some specific data.)

Reviewed by: kib, markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D17367

5 years agorcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume"
eugen [Sat, 27 Oct 2018 17:21:13 +0000 (17:21 +0000)]
rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume"
and runs scripts containing "KEYWORD: resume" with single "resume" argument.

Working example is the port sysutils/cpupdate that defines
extra_commands="resume" to reload CPU microcode cleared
by suspend/resume sequence.

This change does nothing for a system having no scripts with KEYWORD: resume.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15247

5 years agomakewhatis: do not try to operate on read-only mounted directories
eugen [Sat, 27 Oct 2018 17:15:58 +0000 (17:15 +0000)]
makewhatis: do not try to operate on read-only mounted directories
just to fail later.

MFC after: 1 month

5 years agomount_msdosfs: do not fail mounts requiring locale name conversion table
eugen [Sat, 27 Oct 2018 16:41:34 +0000 (16:41 +0000)]
mount_msdosfs: do not fail mounts requiring locale name conversion table
that is already present in a kernel statically.

For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error
"mount_msdosfs: msdosfs_iconv: File exists" for a kernel having
options LIBICONV and MSDOSFS_ICONV. After this change, it mounts successfully.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D16951

5 years agoExtend stripeoffset and stripesize of GEOMs from u_int to off_t
eugen [Sat, 27 Oct 2018 16:14:42 +0000 (16:14 +0000)]
Extend stripeoffset and stripesize of GEOMs from u_int to off_t

GEOM's stripeoffset overflows at 4 gigabyte margin (2^32)
because of its u_int type. This leads to incorrect data in the output
generated by "sysctl kern.geom.confxml" command, "graid list" etc.
when GEOM array has volumes larger than 4G, for example.

This change does not affect ABI but changes KBI. No MFC planned.

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

5 years agorandom(4): Match enabled sources mask to build options
cem [Sat, 27 Oct 2018 15:09:35 +0000 (15:09 +0000)]
random(4): Match enabled sources mask to build options

r287023 and r334450 added build option mechanisms to permanently disable
spammy and/or low quality entropy sources.

Follow-up those changes by updating the 'enabled' sources mask to match.
When sources are compile-time disabled, represent them as disabled in the
source mask, and prevent users from modifying that, like pure sources.
(Modifying the mask bit would have no effect, but users might think it did
if it was not prevented.)

Mostly a cosmetic change.

Reviewed by: markm
Approved by: secteam (gordon)
X-MFC-With: 334450
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17252

5 years agoAdd default value for local_unbound_tls + fix nearby style bugs.
des [Sat, 27 Oct 2018 09:34:33 +0000 (09:34 +0000)]
Add default value for local_unbound_tls + fix nearby style bugs.

Reported by: bcran@
MFC after: 3 days

5 years agoroute(8): correctly return exit status when "-q" flag is used.
eugen [Sat, 27 Oct 2018 07:59:19 +0000 (07:59 +0000)]
route(8): correctly return exit status when "-q" flag is used.

Previously, route returned 1 in case of error  properly signalling failure
but "route -q" it returned 0 for same case. Fix it.

PR: 186333
MFC after: 1 month

5 years agoipfw: implement ngtee/netgraph actions for layer-2 frames.
eugen [Sat, 27 Oct 2018 07:32:26 +0000 (07:32 +0000)]
ipfw: implement ngtee/netgraph actions for layer-2 frames.

Kernel part of ipfw does not support and ignores rules other than
"pass", "deny" and dummynet-related for layer-2 (ethernet frames).
Others are processed as "pass".

Make it support ngtee/netgraph rules just like they are supported
for IP packets. For example, this allows us to mirror some frames
selectively to another interface for delivery to remote network analyzer
over RSPAN vlan. Assuming ng_ipfw(4) netgraph node has a hook named "900"
attached to "lower" hook of vlan900's ng_ether(4) node, that would be
as simple as:

ipfw add ngtee 900 ip from any to 8.8.8.8 layer2 out xmit igb0

PR: 213452
MFC after: 1 month
Tested-by: Fyodor Ustinov <ufm@ufm.su>

5 years agocxgbetool(8): Add a subaction (tcbrss <n>) that can be used with "pass"
np [Sat, 27 Oct 2018 05:26:09 +0000 (05:26 +0000)]
cxgbetool(8): Add a subaction (tcbrss <n>) that can be used with "pass"
action to distribute traffic using the half of the VI's RSS indirection
table.

The value specified should either be the start of the VI's RSS slice
(available at dev.<ifname>.<inst>.rss_base since r339700) or the
midpoint (rss_base + rss_size/2).  The traffic that hits the filter will
use the first or second half of the indirection table respectively.
The indirection table can be populated in different ways to achieve
different kinds of traffic/load distributions.  For example, r339749
allows a netmap interface to have half the rx queues in the first half
of the table and the rest in the other.

Sponsored by: Chelsio Communications

5 years agoPrevent ip_input() from panicing due to unprotected access to INADDR_HASH.
eugen [Sat, 27 Oct 2018 04:59:35 +0000 (04:59 +0000)]
Prevent ip_input() from panicing due to unprotected access to INADDR_HASH.

PR: 220078
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

5 years agoPrevent multicast code from panicing due to unprotected access to INADDR_HASH.
eugen [Sat, 27 Oct 2018 04:53:25 +0000 (04:53 +0000)]
Prevent multicast code from panicing due to unprotected access to INADDR_HASH.

PR: 220078
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

5 years agoPrevent stf(4) from panicing due to unprotected access to INADDR_HASH.
eugen [Sat, 27 Oct 2018 04:45:28 +0000 (04:45 +0000)]
Prevent stf(4) from panicing due to unprotected access to INADDR_HASH.

PR: 220078
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

5 years agolualoader: Always return a proper dictionary for blacklist
kevans [Sat, 27 Oct 2018 04:10:42 +0000 (04:10 +0000)]
lualoader: Always return a proper dictionary for blacklist

If module_blacklist isn't specified, we have an empty blacklist; effectively
the same as if module_blacklist="" were specified in loader.conf(5).

This was reported when switching to a BE that predated the module_blacklist
introduction, but the problem is valid all the same and likely to be tripped
over in other scenarios.

Reported by: bwidawsk
MFC after: 3 days

5 years agoRestore backward compatibility for "attach" verb.
delphij [Sat, 27 Oct 2018 03:37:14 +0000 (03:37 +0000)]
Restore backward compatibility for "attach" verb.

In r332361 and r333439, two new parameters were added to geli attach
verb using gctl_get_paraml, which requires the value to be present.
This would prevent old geli(8) binary from attaching geli(4) device
as they have no knowledge about the new parameters.

Restore backward compatibility by treating the absense of these two
values as seeing the default value supplied by userland.

PR: 232595
Reviewed by: oshogbo
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17680

5 years agoFix pointer arithmetic
imp [Fri, 26 Oct 2018 23:44:50 +0000 (23:44 +0000)]
Fix pointer arithmetic

Pointer math to find the size in bytes only works with char types.
Use correct pointer math to determine if we have enough of a header to
look at or not.

MFC After: 3 days
X-MFX-With: r339800
Noticed by: jhb@
Sponsored by: Netflix, Inc

5 years agoFix pointer arithmetic botch.
imp [Fri, 26 Oct 2018 23:44:39 +0000 (23:44 +0000)]
Fix pointer arithmetic botch.

Pointer subtraction to find size only works with char pointers.

Noticed by: jhb@
Sponsored by: Netflix, Inc

5 years agoEnsure we have a full EFI_DEVICE_PATH header before we try to look at
imp [Fri, 26 Oct 2018 23:08:22 +0000 (23:08 +0000)]
Ensure we have a full EFI_DEVICE_PATH header before we try to look at
its length. Some BIOSes pad the length of the device path to an even
amount. When we had a device path that was somehow an odd length, we'd
wind up having 1 byte left that we were bogusly interpreting as a full
device path. We'd then dereference 2 bytes into that to get a length
of the node, which had undefined (and quite undesired) effects.

Sponsored by: Netflix, Inc
MFC After: 3 days

5 years agoEnsure that the device path is sane before trying to decode and print
imp [Fri, 26 Oct 2018 22:49:36 +0000 (22:49 +0000)]
Ensure that the device path is sane before trying to decode and print
it.

Sponsored by: Netflix, Inc

5 years agoRequire that we have at least a device path header before
imp [Fri, 26 Oct 2018 22:49:25 +0000 (22:49 +0000)]
Require that we have at least a device path header before
trying to decode the next device path.

Sponsored by: Netflix, Inc

5 years agoImplenent --fromfile to read variable values when printing variables
imp [Fri, 26 Oct 2018 22:13:40 +0000 (22:13 +0000)]
Implenent --fromfile to read variable values when printing variables

So

./efivar --fromfile Boot0001.bin --print --load-option

will take the value from Boot0001.bin file and then decode it as if it
were a load-option. This is useful for debugging handling of such
variables that may be hanging the boot for some people.

Sponsored by: Netflix, Inc

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.