]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoOnly invoke 'ls' if the local modules directory exists.
John Baldwin [Tue, 30 Oct 2018 18:20:34 +0000 (18:20 +0000)]
Only invoke 'ls' if the local modules directory exists.

This avoids a spurious make warning if /usr/local/sys/modules doesn't
exist.

Submitted by: rgrimes
Reported by: markj

5 years agoFix some problems that manifest when NUMA domain 0 is empty.
Mark Johnston [Tue, 30 Oct 2018 17:57:40 +0000 (17:57 +0000)]
Fix some problems that manifest when NUMA domain 0 is empty.

- In uma_prealloc(), we need to check for an empty domain before the
  first allocation attempt, not after.  Fix this by switching
  uma_prealloc() to use a vm_domainset iterator, which addresses the
  secondary issue of using a signed domain identifier in round-robin
  iteration.
- Don't automatically create a page daemon for domain 0.
- In domainset_empty_vm(), recompute ds_cnt and ds_order after
  excluding empty domains; otherwise we may frequently specify an empty
  domain when calling in to the page allocator, wasting CPU time.
  Convert DOMAINSET_PREF() policies for empty domains to round-robin.
- When freeing bootstrap pages, don't count them towards the per-domain
  total page counts for now: some vm_phys segments are created before
  the SRAT is parsed and are thus always identified as being in domain 0
  even when they are not.  Then, when bootstrap pages are freed, they
  are added to a domain that we had previously thought was empty.  Until
  this is corrected, we simply exclude them from the per-domain page
  count.

Reported and tested by: Rajesh Kumar <rajfbsd@gmail.com>
Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17704

5 years agoImplement the dump_stack() function in the LinuxKPI.
Hans Petter Selasky [Tue, 30 Oct 2018 16:42:56 +0000 (16:42 +0000)]
Implement the dump_stack() function in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI.
Hans Petter Selasky [Tue, 30 Oct 2018 16:32:52 +0000 (16:32 +0000)]
Implement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoIntroduce an EXPERIMENTAL option for both src.conf(5) and the kernel.
Bjoern A. Zeeb [Tue, 30 Oct 2018 15:46:30 +0000 (15:46 +0000)]
Introduce an EXPERIMENTAL option for both src.conf(5) and the kernel.

In the last decade(s) we have seen both short term or long term projects
committed to the tree which were considered or even marked "experimental".
While out-of-tree development has become easier than it used to be in
CVS times, there still is a need to have the code shipping with HEAD but
not enabled by default.

While people may think about VIMAGE as one of the recent larger, long term
projects, early protocol implementations (before they are standardised)
are others.  (Free)BSD historically was one of the operating systems
which would have running code at early stages and help develop and
influence standardisation and the industry.

Give developers an opportunity to be more pro-active for early adoption
or running large scale code changes stumbling over each others but not
the user's feet.  I have not added the option to NOTES in order to avoid
breaking supported option builds, which require constant compile testing.

Discussed with: people in the corridor

5 years agoRemove no longer relevant comment, as suggested by imp@.
Edward Tomasz Napierala [Tue, 30 Oct 2018 15:44:16 +0000 (15:44 +0000)]
Remove no longer relevant comment, as suggested by imp@.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoRemove useless call to access(2) from tzcode. Quoting OpenBSD:
Edward Tomasz Napierala [Tue, 30 Oct 2018 15:43:06 +0000 (15:43 +0000)]
Remove useless call to access(2) from tzcode.  Quoting OpenBSD:

> Remove doaccess variable and access(2) call since this interfers with
> applications like zdump(8) because pledge(2) doesn't allow access(2) to
> /usr/share/zoneinfo.
>
> millert@ better described why this call can go away:
>
> "This looks like an attempt to do access checks based on the real uid instead
> of the effective uid.  Basically for setuid programs we don't want to allow a
> user to set TZ to a path they should not be able to otherwise access.
>
> However, we already have a check for issetugid() above so I think the doaccess
> bits can just be removed and we can rely on open()."
>
> After discussion with tb@, deraadt@ and millert@, this was also OK'ed by them

Reviewed by: imp
Obtained from: OpenBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17701

5 years agoMake "nscd -t" work.
Edward Tomasz Napierala [Tue, 30 Oct 2018 15:39:33 +0000 (15:39 +0000)]
Make "nscd -t" work.

Reviewed by: des@
MFC after: 2 weeks
Sponsored by: Chalmers University of Technology
Differential Revision: https://reviews.freebsd.org/D17563

5 years agoAlways stop the scheduler when entering kdb
Eric van Gyzen [Tue, 30 Oct 2018 14:54:15 +0000 (14:54 +0000)]
Always stop the scheduler when entering kdb

Set curthread->td_stopsched when entering kdb via any vector.
Previously, it was only set when entering via panic, so when
entering kdb another way, mutexes and such were still "live",
and an attempt to lock an already locked mutex would panic.

Reviewed by: kib, cem
Discussed with: jhb
Tested by: pho
MFC after: 2 months
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17687

5 years agoBuild the csu tests on all architectures.
Andrew Turner [Tue, 30 Oct 2018 14:44:12 +0000 (14:44 +0000)]
Build the csu tests on all architectures.

The tests haven't been run them, but this is enough to build them so I can
get feedback on if the various crt.h headers are correct.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoBump the number of fans supported from 8 to 12.
Michael Tuexen [Tue, 30 Oct 2018 11:51:09 +0000 (11:51 +0000)]
Bump the number of fans supported from 8 to 12.
The number of fans on a PowerMac7,3 with liquid cooling is 9.

Reviewed by: andreast@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17754

5 years agoDisable the .preinit_array test in DSOs, ld.bfd fails to link objects with
Andrew Turner [Tue, 30 Oct 2018 11:19:47 +0000 (11:19 +0000)]
Disable the .preinit_array test in DSOs, ld.bfd fails to link objects with
the section.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoFix the location of the static keyword.
Andrew Turner [Tue, 30 Oct 2018 10:16:21 +0000 (10:16 +0000)]
Fix the location of the static keyword.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoEmulate machine check related MSR_EXTFEATURES to allow guest OSes to
Marcelo Araujo [Tue, 30 Oct 2018 10:02:23 +0000 (10:02 +0000)]
Emulate machine check related MSR_EXTFEATURES to allow guest OSes to
boot on AMD FX Series.

PR: 224476
Submitted by: Keita Uchida <m@jgz.jp>
Reviewed by: rgrimes
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D17713

5 years agoAllow changing lagg(4) MTU.
Marcelo Araujo [Tue, 30 Oct 2018 09:53:57 +0000 (09:53 +0000)]
Allow changing lagg(4) MTU.

Previously, changing the MTU would require destroying the lagg and
creating a new one. Now it is allowed to change the MTU of
the lagg interface and the MTU of the ports will be set to match.

If any port cannot set the new MTU, all ports are reverted to the original
MTU of the lagg. Additionally, when adding ports, the MTU of a port will be
automatically set to the MTU of the lagg. As always, the MTU of the lagg is
initially determined by the MTU of the first port added. If adding an
interface as a port for some reason fails, that interface is reverted to its
original MTU.

Submitted by: Ryan Moeller <ryan@freqlabs.com>
Reviewed by: mav
Relnotes: Yes
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D17576

5 years agoRun the csu tests on a DSO. This builds the tests into a shared library,
Andrew Turner [Tue, 30 Oct 2018 09:43:26 +0000 (09:43 +0000)]
Run the csu tests on a DSO. This builds the tests into a shared library,
then runs these from the base test programs. With this we can check
crtbeginS.o and crtendS.o are working as expected.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoThe jcr argument to _Jv_RegisterClasses is used, stop marking it otherwise.
Andrew Turner [Tue, 30 Oct 2018 09:36:31 +0000 (09:36 +0000)]
The jcr argument to _Jv_RegisterClasses is used, stop marking it otherwise.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoConnect libc/tests/time to the build, adding test cases for strptime()
Yuri Pankov [Tue, 30 Oct 2018 02:37:23 +0000 (02:37 +0000)]
Connect libc/tests/time to the build, adding test cases for strptime()
issues fixed recently, and disabling the failing ones (mostly due to TZ
parsing differences with NetBSD).

Reviewed by: ngie
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17546

5 years agopowerpc/mpc85xx: Reset the PCIe bus on attach
Justin Hibbits [Tue, 30 Oct 2018 00:47:40 +0000 (00:47 +0000)]
powerpc/mpc85xx: Reset the PCIe bus on attach

It seems if a Radeon card is already initialized by u-boot, it won't be
reinitialized by the kernel, and the DRM module will fail to attach.  This
steals the reset code from mips/octopci.c to blindly reset the bus on attach.
This was tested on a AmigaOne X5000/20, such that it can be booted from the
local video console, and get a video console in FreeBSD.

5 years agoPermit local kernel modules to be built as part of a kernel build.
John Baldwin [Tue, 30 Oct 2018 00:23:37 +0000 (00:23 +0000)]
Permit local kernel modules to be built as part of a kernel build.

Add support for "local" modules.  By default, these modules are
located in LOCALBASE/sys/modules (where LOCALBASE defaults to
/usr/local).  Individual modules can be built along with a kernel by
defining LOCAL_MODULES to the list of modules.  Each is assumed to be
a subdirectory containing a valid Makefile.  If LOCAL_MODULES is not
specified, all of the modules present in LOCALBASE/sys/modules are
built and installed along with the kernel.

This means that a port that installs a kernel module can choose to
install its source along with a suitable Makefile to
/usr/local/sys/modules/<foo>.  Future kernel builds will then include
that kernel module using the kernel configuration's opt_*.h headers
and install it into /boot/kernel along with other kernel-specific
modules.

This is not trying to solve the issue of folks running GENERIC release
kernels, but is instead aimed at folks who build their own kernels.
For those folks this ensures that kernel modules from ports will
always be using the right KBI, etc.  This includes folks running any
KBI-breaking kernel configs (such as PAE).

There are still some kinks to be worked out with cross-building (we
probably shouldn't include local modules in cross-built kernels by
default), but this is a sufficient starting point.

Reviewed by: imp
MFC after: 3 months
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16966

5 years agoHave gconcat advertise delete support if one of its disks does.
Mark Johnston [Tue, 30 Oct 2018 00:22:14 +0000 (00:22 +0000)]
Have gconcat advertise delete support if one of its disks does.

This follows the example set by other multi-disk GEOM classes.

PR: 232676
Tested by: noah.bergbauer@tum.de
MFC after: 1 month

5 years agoMake battery emptying rate available as sysctl variable.
John Baldwin [Tue, 30 Oct 2018 00:19:44 +0000 (00:19 +0000)]
Make battery emptying rate available as sysctl variable.

Curiously, the in-kernel routines always use the design voltage to
convert from mA to mW, but acpiconf in userland uses the current
voltage.  As a result, this can report a different mW rate than
acpiconf.

Submitted by: Manuel Stühn <freebsdnewbie@freenet.de>
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D17077

5 years agoConvert amd64_get/set_fs/gsbase to ifunc.
Konstantin Belousov [Tue, 30 Oct 2018 00:11:30 +0000 (00:11 +0000)]
Convert amd64_get/set_fs/gsbase to ifunc.

Note that this is the first use of ifuncs in our userspace.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

5 years agoRemove rtld use of libc amd64_set_fsbase().
Konstantin Belousov [Mon, 29 Oct 2018 23:59:26 +0000 (23:59 +0000)]
Remove rtld use of libc amd64_set_fsbase().

One less non-trivial dependency of rtld on libc.  Also,
amd64_set_fsbase() is to be converted to ifunc, which I do not want to
support inside rtld.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoInitialize ifunc calling machinery earlier.
Konstantin Belousov [Mon, 29 Oct 2018 23:56:39 +0000 (23:56 +0000)]
Initialize ifunc calling machinery earlier.

In particular, do it before the first call to allocate_initial_tls(),
which contains MD parts to set the initial thread' TLS pointer.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoamd64: Use ifuncs to select suitable implementation of set_pcb_flags().
Konstantin Belousov [Mon, 29 Oct 2018 23:52:31 +0000 (23:52 +0000)]
amd64: Use ifuncs to select suitable implementation of set_pcb_flags().

There is no reason to check for PCB_FULL_IRET if FSGSBASE instructions
are not supported.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoTeach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector.
John Baldwin [Mon, 29 Oct 2018 23:48:20 +0000 (23:48 +0000)]
Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector.

Submitted by: Shawn Webb <lattera@gmail.com>
Reviewed by: brooks
Obtained from: HardenedBSD (bb71e9889d1362df01c2e5162e84cd7a4fc029c8)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D17067

5 years agoStyle.
Konstantin Belousov [Mon, 29 Oct 2018 23:45:17 +0000 (23:45 +0000)]
Style.

Wrap long lines, use +4 spaces for continuation indent.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoClarify explanation of VFCF_SBDRY.
Konstantin Belousov [Mon, 29 Oct 2018 23:43:17 +0000 (23:43 +0000)]
Clarify explanation of VFCF_SBDRY.

Requested by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agocxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to
Navdeep Parhar [Mon, 29 Oct 2018 22:35:46 +0000 (22:35 +0000)]
cxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to
ensure that it always runs when soisconnected does.

Submitted by: Krishnamraju Eraparaju @ Chelsio
MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agoAdd support for "plain" (non-HMAC) SHA digests.
John Baldwin [Mon, 29 Oct 2018 22:24:31 +0000 (22:24 +0000)]
Add support for "plain" (non-HMAC) SHA digests.

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoAdd a note that epoch(9) may change, to untie our hands for any future MFCs.
Gleb Smirnoff [Mon, 29 Oct 2018 22:10:52 +0000 (22:10 +0000)]
Add a note that epoch(9) may change, to untie our hands for any future MFCs.

5 years agorping(1): Make sure the socket address defaults to something reasonable
Navdeep Parhar [Mon, 29 Oct 2018 21:46:05 +0000 (21:46 +0000)]
rping(1): Make sure the socket address defaults to something reasonable
when running as the server.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: hselasky@, np@
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D17707

5 years agoExpose some netdump configuration parameters through sysctl.
Mark Johnston [Mon, 29 Oct 2018 21:16:26 +0000 (21:16 +0000)]
Expose some netdump configuration parameters through sysctl.

Reviewed by: cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17755

5 years agoFix get_maxfds() in jevents
Alex Richardson [Mon, 29 Oct 2018 21:08:34 +0000 (21:08 +0000)]
Fix get_maxfds() in jevents

If RLIM_INFINITY == -1ULL (such as on macOS) the min() call will result
in a value of less than 1 being returned. This causes nftw() to fail
with EINVAL.

While touching this file also fix includes to work on Linux/macOS and don't
declare snprintf since it may have different attributes in the system
headers there.

Reviewed By: mmacy
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17682

5 years agortld-elf: fix more warnings to allow compiling with WARNS=6
Alex Richardson [Mon, 29 Oct 2018 21:08:28 +0000 (21:08 +0000)]
rtld-elf: fix more warnings to allow compiling with WARNS=6

Reviewed By: kib
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17154

5 years agortld-elf: compile with WANRS=4 warnings other than -Wcast-align
Alex Richardson [Mon, 29 Oct 2018 21:08:19 +0000 (21:08 +0000)]
rtld-elf: compile with WANRS=4 warnings other than -Wcast-align

Reviewed By: kib
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17153

5 years agortld-elf: make it compile with WARNS=3
Alex Richardson [Mon, 29 Oct 2018 21:08:11 +0000 (21:08 +0000)]
rtld-elf: make it compile with WARNS=3

Reviewed By: kib
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17150

5 years agortld: set obj->textsize correctly
Alex Richardson [Mon, 29 Oct 2018 21:08:02 +0000 (21:08 +0000)]
rtld: set obj->textsize correctly

With lld-generated binaries the first PT_LOAD will usually be a read-only
segment unless you pass --no-rosegment. For those binaries the textsize is
determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to
be parsed correctly use the end of the last PT_LOAD that is marked as
executable instead.

I noticed that the value was wrong while adding some debug prints for some rtld
changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the
effect is untested. However, the value before was definitely wrong and the new
result matches the phdrs.

Reviewed By: kib
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17117

5 years agoPass _BRANCH in the reldoc target to ensure the correct
Glen Barber [Mon, 29 Oct 2018 21:03:43 +0000 (21:03 +0000)]
Pass _BRANCH in the reldoc target to ensure the correct
src branch is used when generating the hardware.html page.

MFC after: 3 days
MFC before: 12.0-BETA3
MFC with: r339873
Sponsored by: The FreeBSD Foundation

5 years agoSet OPTIONS_UNSET in the argument list to env(1), and add
Glen Barber [Mon, 29 Oct 2018 20:53:05 +0000 (20:53 +0000)]
Set OPTIONS_UNSET in the argument list to env(1), and add
AVAHI to the list.  This fixes the textproc/docproj build
seemingly following FLAVORS being added.

Specifically, the problem with the dependency chain here is:
- textproc/docproj depends on print/cups, which sets AVAHI=on
  by default;
- net/avahi-app depends on devel/gobject-introspection, which
  requires python3+;
- graphics/netpbm depends on graphics/mesa-libs, which can
  only be built with python2.7;
- textproc/docproj depends on a number of graphics ports for
  font rendering, etc.

MFC after: 3 days
MFC before: 12.0-BETA3
Sponsored by: The FreeBSD Foundation

5 years agoInsert a .El line accidently committed in r339869.
Michael Tuexen [Mon, 29 Oct 2018 19:25:30 +0000 (19:25 +0000)]
Insert a .El line accidently committed in r339869.

Reported by: gjb@
MFC after: 3 days

5 years agoFix a nit
Michael Tuexen [Mon, 29 Oct 2018 19:14:56 +0000 (19:14 +0000)]
Fix a nit

Reported by: gjb@
MFC after: 3 days

5 years agoImplement dma_pool_zalloc() in the LinuxKPI.
Hans Petter Selasky [Mon, 29 Oct 2018 19:02:36 +0000 (19:02 +0000)]
Implement dma_pool_zalloc() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake the .ctors, .dtors, and .jcr markers as static. They shouldn't be
Andrew Turner [Mon, 29 Oct 2018 17:55:26 +0000 (17:55 +0000)]
Make the .ctors, .dtors, and .jcr markers as static. They shouldn't be
accessible from out of the files they are defined in.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoInclude the csu test directories in BSD.tests.dist
Andrew Turner [Mon, 29 Oct 2018 17:13:12 +0000 (17:13 +0000)]
Include the csu test directories in BSD.tests.dist

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoCheck __dso_handle is NULL in non-DSO objects. It should only be non-NULL
Andrew Turner [Mon, 29 Oct 2018 17:03:20 +0000 (17:03 +0000)]
Check __dso_handle is NULL in non-DSO objects. It should only be non-NULL
when accessed from a shared object.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agoDrain grouptaskqueue of the gtask before detaching it.
Stephen Hurd [Mon, 29 Oct 2018 14:36:03 +0000 (14:36 +0000)]
Drain grouptaskqueue of the gtask before detaching it.

taskqgroup_detach() would remove the task even if it was running or
enqueued, which could lead to panics (see D17404). With this change,
taskqgroup_detach() drains the task and sets a new flag which prevents the
task from being scheduled again.

I've added grouptask_block() and grouptask_unblock() to allow control
over the flag from other locations as well.

Reviewed by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17674

5 years agolualoader: Fix try_include error handling
Kyle Evans [Mon, 29 Oct 2018 02:58:30 +0000 (02:58 +0000)]
lualoader: Fix try_include error handling

The previous iteration of try_include attempted to be 'friendly' and error()
out if we hit an error that wasn't ENOENT. This was semi-OK, but fragile as
it relied on pattern matching the error message.

Move the responsibility for handling failure to the caller. Following
a common lua pattern, we'll return the return value of the underlying
require() on success, or false and an error message.

Reported by: bcran
MFC after: 3 days

5 years agoImport tzdata 2018g
Philip Paeps [Sun, 28 Oct 2018 23:54:05 +0000 (23:54 +0000)]
Import tzdata 2018g

Changes: https://github.com/eggert/tz/blob/2018g/NEWS

MFC after: 3 days

5 years agoImport tzdata 2018g
Philip Paeps [Sun, 28 Oct 2018 23:50:24 +0000 (23:50 +0000)]
Import tzdata 2018g

5 years agoSort i18n messages in bsdinstall zfsboot
Devin Teske [Sun, 28 Oct 2018 22:09:18 +0000 (22:09 +0000)]
Sort i18n messages in bsdinstall zfsboot

No functional change.

Sponsored by: Smule, Inc.

5 years agoFix dialog autosizing to accomodate for hline
Devin Teske [Sun, 28 Oct 2018 19:29:07 +0000 (19:29 +0000)]
Fix dialog autosizing to accomodate for hline

dialog will conditionally ignore the --hline option if not enough space
was available to accomodate for the text width. Traditionally the width
of the widget had to be 10 wider than the text. Recent updates to dialog
have changed the requirement to be at least 12 wider than the hline text
else the hline text is not rendered at the bottom of the widget.

Sponsored by: Smule, Inc.

5 years agoFix jail examples in jib, jng, README
Devin Teske [Sun, 28 Oct 2018 18:32:47 +0000 (18:32 +0000)]
Fix jail examples in jib, jng, README

The provided example jail configs do not work for multiple interfaces.
Multiple interfaces need to be specified as a comma separated list or
using multiple += lines in jail.conf. In the given example, a space-
separated string is used, which doesn't work with multiple interfaces.

Also added a note to the README about VIMAGE being built-in by default
on amd64 in FreeBSD 12, with appropriate instructions for loading the
necessary netgraph ether module (ng_ether) since it is neither built-
in nor autoloads.

Submitted by: Ryan Moeller <ryan@freqlabs.com>
Reported by: Ryan Moeller <ryan@freqlabs.com>
MFC after: 3 days
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D17697

5 years agotruss: Fix display of shm_open(SHM_ANON, ...).
Thomas Munro [Sun, 28 Oct 2018 10:59:49 +0000 (10:59 +0000)]
truss: Fix display of shm_open(SHM_ANON, ...).

Currently truss(1) shows shm_open(SHM_ANON, ...) as shm_open("(null)", ...).
Detect the special value and display it by name.

Reviewed by:    jhb, allanjude, tuexen
Approved by:    mjg (mentor)
MFC with:       r339224
Differential Revision:  https://reviews.freebsd.org/D17461

5 years agopfctl test: Add a test for macro names with a space in it
Kristof Provost [Sun, 28 Oct 2018 05:50:04 +0000 (05:50 +0000)]
pfctl test: Add a test for macro names with a space in it

5 years agopfctl: Do not allow whitespace in macro names
Kristof Provost [Sun, 28 Oct 2018 05:41:13 +0000 (05:41 +0000)]
pfctl: Do not allow whitespace in macro names

i.e. "this is" = "a variable" is not valid. It was accepted by the
parser, but the variable could not be used afterwards.

Obtained from: OpenBSD

5 years agopf tests: Test ':0' ignoring link-local addresses
Kristof Provost [Sun, 28 Oct 2018 05:37:15 +0000 (05:37 +0000)]
pf tests: Test ':0' ignoring link-local addresses

PR: 201695

5 years agopf: Make ':0' ignore link-local v6 addresses too
Kristof Provost [Sun, 28 Oct 2018 05:32:50 +0000 (05:32 +0000)]
pf: Make ':0' ignore link-local v6 addresses too

When users mark an interface to not use aliases they likely also don't
want to use the link-local v6 address there.

PR: 201695
Submitted by: Russell Yount <Russell.Yount AT gmail.com>
Differential Revision: https://reviews.freebsd.org/D17633

5 years agoBump .Dd forgotten in last commit.
Warner Losh [Sun, 28 Oct 2018 03:02:09 +0000 (03:02 +0000)]
Bump .Dd forgotten in last commit.

5 years agoNote that the kenrel doesn't keep track daylight savings time, nor
Warner Losh [Sun, 28 Oct 2018 02:58:22 +0000 (02:58 +0000)]
Note that the kenrel doesn't keep track daylight savings time, nor
timezone offset. These values are generally zero.

While one still theoreticall could set these values, that's almost
never done. Users wishing to have an offset between the time of day
clock hardware and UTC use adjkerntz(8) instead.

localtime(3) should be used to find these values for the current
timezone.

5 years agoftime appeared in 7th Edition Unix to replace gtime.
Warner Losh [Sun, 28 Oct 2018 02:58:15 +0000 (02:58 +0000)]
ftime appeared in 7th Edition Unix to replace gtime.
Note that the timezone and dst entries are always returned as 0.

5 years agoMove LUA_ROOT to /boot/lua
Warner Losh [Sun, 28 Oct 2018 02:57:50 +0000 (02:57 +0000)]
Move LUA_ROOT to /boot/lua

While this is mostly unused today, this is a better place than
/usr/local/lua.

5 years agoAdjust for 80-columns.
Devin Teske [Sun, 28 Oct 2018 00:58:39 +0000 (00:58 +0000)]
Adjust for 80-columns.

No functional change.

Sponsored by: Smule, Inc.

5 years agolocaledef: define characters in "space" class also as "print", except
Yuri Pankov [Sat, 27 Oct 2018 23:31:42 +0000 (23:31 +0000)]
localedef: define characters in "space" class also as "print", except
for the known conflicts ("control" characters can't be "print"able).
POSIX doesn't explicitly forbid this, and actually includes <space>
character in "print".

PR: 225692
Reviewed by: bapt, cem (previous version), pfg (previous version)
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17467

5 years agoProvide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
Yuri Pankov [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
Vladimir Kondratyev [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.
Vladimir Kondratyev [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 Tjoelker [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().
Mark Johnston [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-
Alan Cox [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"
Eugene Grosbein [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
Eugene Grosbein [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
Eugene Grosbein [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
Eugene Grosbein [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
Conrad Meyer [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.
Dag-Erling Smørgrav [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.
Eugene Grosbein [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.
Eugene Grosbein [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"
Navdeep Parhar [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.
Eugene Grosbein [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.
Eugene Grosbein [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.
Eugene Grosbein [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
Kyle Evans [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.
Xin LI [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
Warner Losh [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.
Warner Losh [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
Warner Losh [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
Warner Losh [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
Warner Losh [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
Warner Losh [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()
Rebecca Cran [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.
Mark Johnston [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:
Martin Matuska [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.
Mark Johnston [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 agoUpdate vendor/libarchive/dist to git d661131393def793a9919d1e3fd54c9992888bd6
Martin Matuska [Fri, 26 Oct 2018 21:15:36 +0000 (21:15 +0000)]
Update vendor/libarchive/dist to git d661131393def793a9919d1e3fd54c9992888bd6

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

5 years agoAdd initial descriptions for SCTP related MIB variable.
Michael 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
Conrad Meyer [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
Conrad Meyer [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)
Conrad Meyer [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