Commit Graph

244737 Commits

Author SHA1 Message Date
Alan Somers
123d18b5c7 tftp: fix two minor Coverity CIDs
Reported by:	Coverity
CID 1394842: file descriptor leak in an error path
CID 1007603: single byte array overflow
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21695
2019-10-03 20:22:25 +00:00
Kyle Evans
fa0e0c0269 certctl(8): realpath the file before creating the symlink
Otherwise we end up creating broken relative symlinks in
/etc/ssl/blacklisted.
2019-10-03 20:05:46 +00:00
Konstantin Belousov
c5dac63c15 tmpfs_readdir(): unlock the locked node.
During readdir() we guarantee that the tn_dir.tn_parent does not go
away, but it might be replaced by a parallel rename.  Read tn_parent
only once, then use the cached value.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-10-03 19:55:05 +00:00
Konstantin Belousov
f7e69a6fa0 tmpfs_rename: style.
Reformat multi-line comments to follow style.
Also fix some typos.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-10-03 19:51:56 +00:00
Emmanuel Vadot
29ee738052 allwinner: Remove a10_ehci driver
We have generic-ehci since r353062 so use it.

MFC after:	1 month
X-MFC-With:	r353062
2019-10-03 18:58:15 +00:00
Emmanuel Vadot
7a58744fd0 Split out the attachment from the generic-ehci driver
Create an attachment file for the existing ACPI attachment, and create a
new FDT attachment for the generic-ehci driver.

Submitted by:	andrew (Original version)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D19389
2019-10-03 18:53:03 +00:00
Michael Tuexen
967e1a5333 Add missing input validation. This could result in reading from
uninitialized memory.
The issue was found by OSS-Fuzz for usrsctp  and reported in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17780

MFC after:		3 days
2019-10-03 18:36:54 +00:00
John Baldwin
fbf0f3106c Restore description of packets dropped due to full reassembly queue.
r265408 renamed tcps_rcvmemdrop to tcps_rcvreassfull and gave it a more
specific description.  r279122 (libxo-ification) reverted that change.
This commit brings it back, but with a small tweak to the description.

MFC after:	2 weeks
2019-10-03 18:24:41 +00:00
John Baldwin
214b76700c Fix a typo in a comment. 2019-10-03 18:12:34 +00:00
Kyle Evans
59997c3c46 if_tuntap: create /dev aliases when a tuntap device gets renamed
Currently, if you do:

$ ifconfig tun0 create
$ ifconfig tun0 name wg0
$ ls -l /dev | egrep 'wg|tun'

You will see tun0, but no wg0. In fact, it's slightly more annoying to make
the association between the new name and the old name in order to open the
device (if it hadn't been opened during the rename).

Register an eventhandler for ifnet_arrival_events and catch interface
renames. We can determine if the ifnet is a tun easily enough from the
if_dname, which matches the cevsw.d_name from the associated tuntap_driver.

Some locking dance is required because renames don't require the device to
be opened, so it could go away in the middle of handling the ioctl, but as
soon as we've verified this isn't the case we can attempt to busy the tun
and either bail out if the tun device is dying, or we can proceed with the
rename.

We only create these aliases on a best-effort basis. Renaming a tun device
to "usbctl", which doesn't exist as an ifnet but does as a /dev, is clearly
not that disastrous, but we can't and won't create a /dev for that.
2019-10-03 17:54:00 +00:00
Kyle Evans
c4cad1549e if_tuntap: add a busy/unbusy mechanism, replace destroy OPEN check
A future commit will create device aliases when a tuntap device is renamed
so that it's still easily found in /dev after the rename.  Said mechanism
will want to keep the tun alive long enough to either realize that it's
about to go away or complete the alias creation, even if the alias is about
to get destroyed.

While we're introducing it, using it to prevent open devices from going away
makes plenty of sense and keeps the logic on waking up tun_destroy clean, so
we don't have multiple places trying to cv_broadcast unless it's still in
use elsewhere.
2019-10-03 17:46:27 +00:00
Edward Tomasz Napierala
ee0ee18c9c Add rcvar back to the linux rc script. Without it it was enabled
unconditionally.

Reported by:	Michael Butler <imb at protected-networks dot net>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-10-03 16:38:44 +00:00
Jens Schweikhardt
0602025219 Remove white-space at EOL. 2019-10-03 14:52:25 +00:00
Ed Maste
9923b64177 Remove host binary object drivers from GENERIC
Four drivers (hpt27xx, hptmv, hptnr, hptrr, hpt27xx) include precompiled
binary objects; have users load them as modules if they are needed.

Additional work (i.e., integrating devmatch) required before MFC.

Reviewed by:	markj
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21865
2019-10-03 12:51:57 +00:00
Andriy Gapon
5fda0d60c1 add ability to set watchdog timeout for a shutdown
This change allows to specify a watchdog(9) timeout for a system
shutdown.  The timeout is activated when the watchdogd daemon is
stopped.  The idea is to a prevent any indefinite hang during late
stages of the shutdown.  The feature is implemented in rc.d/watchdogd,
it builds upon watchdogd -x option.

Note that the shutdown timeout is not actiavted when the watchdogd
service is individually stopped by an operator.  It is also not
activated for the 'shutdown' to the single-user mode.  In those cases it
is assumed that the operator knows what they are doing and they have
means to recover the system should it hang.

Significant subchanges and implementation details:
- the argument to rc.shutdown, completely unused before, is assigned to
  rc_shutdown variable that can be inspected by rc scripts
- init(8) passes "single" or "reboot" as the argument, this is not
  changed
- the argument is not mandatory and if it is not set then rc_shutdown is
  set to "unspecified"
- however, the default jail management scripts and jail configuration
  examples have been updated to pass "jail" to rc.shutdown, just in case
- the new timeout can be set via watchdogd_shutdown_timeout rc option
- for consistency, the regular timeout can now be set via
  watchdogd_timeout rc option
- watchdogd_shutdown_timeout and watchdogd_timeout override timeout
  specifications in watchdogd_flags
- existing configurations, where the new rc options are not set, should
  keep working as before

I am not particularly wed to any of the implementation specifics.
I am open to changing or removing any of them as long as the provided
functionality is the same (or very close) to the proposed one.
For example, I think it can be implemented without using watchdogd -x,
by means of watchdog(1) alone.  In that case there would be a small
window between stopping watchdogd and running watchdog, but I think that
that is acceptable.

Reviewed by:	bcr (man page changes)
MFC after:	5 weeks
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D21221
2019-10-03 11:23:10 +00:00
Andriy Gapon
912c3fe715 ZFS: add bookmark renaming
The feature is implemented as an extension of the existing
ZFS_IOC_RENAME ioctl.  Both the userland and the DSL interfaces support
renaming only a single bookmark at a time.  As of now, there is no ZCP
interface to the new functionality.  I am going to add it once the DSL
interface passes a test of time.

This change picks up support for zfs_ioc_namecheck_t::ENTITY_NAME that
was added to ZoL as part of Redacted Send/Receive feature by Paul
Dagnelie <pcd@delphix.com>.  This is needed to allow a bookmark name in
zc_name.

Discussed with:	mahrens
Reviewed by:	bcr (man page)
Sponsored by:	CyberSecure
Differential Revision: https://reviews.freebsd.org/D21795
2019-10-03 11:08:45 +00:00
Konstantin Belousov
d60ac9d561 Remove unnecessary vm/vm_page.h and vm/vm_pager.h includes from
tmpfs/tmpfs_vnodes.c.

Submitted by:	ota@j.email.ne.jp
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21881
2019-10-03 08:25:09 +00:00
Gleb Smirnoff
0b951c55a1 Fix build failure from r353026. Somehow module build allowed this.
Pointy hat to:	glebius
2019-10-03 04:41:57 +00:00
Gleb Smirnoff
30b7addf5a Protect access to seq->xwin[] with the seq mutex.
MFC after:	5 weeks
2019-10-03 02:34:51 +00:00
Gleb Smirnoff
631cabba47 - Remove the compile time limit for number of links a ng_bridge node
can handle.  Instead using an array on node private data, use per-hook
  private data.
- Use NG_NODE_FOREACH_HOOK() to traverse through hooks instead of array.

PR:		240787
Submitted by:	Lutz Donnerhacke <lutz donnerhacke.de>
Differential Revision:	  https://reviews.freebsd.org/D21803
2019-10-03 02:32:55 +00:00
Ian Lepore
b6fa976de2 Bump .Dd for earlier update (should have been part of r353024). 2019-10-02 23:19:34 +00:00
Ian Lepore
0ec0f10d66 Clarify how the -f option for daemon(8) interacts with other options
related to redirecting stdout and stderr.
2019-10-02 23:06:17 +00:00
John Baldwin
5c7a45bb14 Fix the EMBEDFS_FORMAT helper variable for riscv64.
It was defined with the wrong MACHINE_ARCH previously.  This permits
using an MFS image without defining MD_ROOT_SIZE which has various
benefits (one being that the build is able to treat the MFS image as
a dependency and properly re-link the kernel with the new image when
building with NO_CLEAN).

MFC after:	2 weeks
Sponsored by:	DARPA
2019-10-02 21:49:39 +00:00
Colin Percival
4faa50e5c2 Switch EC2 AMIs from using the dual-dhclient script to using the new
dual-dhclient-daemon daemon.  This makes it possible to stop/restart
the dhclients.

MFC after:	1 month
2019-10-02 21:35:39 +00:00
Ed Maste
f91dd6091b simplify path handling in sysctl_try_reclaim_vnode
MAXPATHLEN / PATH_MAX includes space for the terminating NUL, and namei
verifies the presence of the NUL.  Thus there is no need to increase the
buffer size here.

The sysctl passes the string excluding the NUL, so req->newlen equal to
PATH_MAX is too long.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21876
2019-10-02 21:01:23 +00:00
Conrad Meyer
31f1c8fc84 nvdimm: Fix error path mis-free
Regression introduced in r343629 when malloc result was renamed from spa to
spa_mapping and the 'spa' name was instead used to iterate a table, but the
free() target was not updated.

Reviewed by:	kib, scottph
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21871
2019-10-02 19:13:35 +00:00
Kyle Evans
982f1fc2d8 Override the TLS model when building mips64 binaries and static libraries
GCC uses "dynamic" TLS models when -fpic or -fPIC is explicitly
specified on the command line (which is only true for shared libraries).
It uses "static" (or "exec") TLS models otherwise.  In particular, GCC
does _not_ use dynamic TLS models when PIC is implicitly enabled (which
it is on MIPS), only if a PIC flag is explicitly provided.

llvm uses "dynamic" TLS models if PIC is enabled either via a PIC flag
or if it is implicily enabled (as on MIPS64).  This means that llvm on
MIPS64 always uses "dynamic" TLS models.  However, dynamic TLS models
do not work for static binaries and libraries as the __tls_get_addr
function they invoke is only defined in rtld.

Written by:	jhb
Reviewed by:	arichardson
Differential Revision:	https://reviews.freebsd.org/D21699
2019-10-02 17:18:18 +00:00
Kyle Evans
4f68b172e1 clang: use -mxgot for 32-bit mips
Various bits in usr.bin/clang/* will fail to compile without -mxgot due to
truncated relocations. -mxgot entails a speed penalty, but I suspect we
don't care as much about compiler performance in 32-bit mips land.

Reviewed by:	arichardson
Differential Revision:	https://reviews.freebsd.org/D21698
2019-10-02 17:15:38 +00:00
Kyle Evans
55c4535d81 sparc64: use generic sub-word atomic *cmpset
Most of this diff is refactoring to reduce duplication between the different
acq_ and rel_ variants.

Differential Revision:	https://reviews.freebsd.org/D21822
2019-10-02 17:08:20 +00:00
Kyle Evans
281ec62c97 mips: use generic sub-word atomic *cmpset
Most of this diff is refactoring to reduce duplication between the different
acq_ and rel_ variants.

Differential Revision:	https://reviews.freebsd.org/D21822
2019-10-02 17:07:59 +00:00
Kyle Evans
b6c5d1ef76 Provide generic sub-word atomic *cmpset
Provide *cmpset_{8,16} as wrappers around atomic_fcmpset_32. Initial users
will be mips and sparc64, and perhaps parts of powerpc.

This are not for general consumption; machine/atomic.h should include this
header as needed to provide atomic_{,f}cmpset_{8,16} and machine/atomic.h
should provide acq_ and rel_ variants.

Reviewed by:	jhibbits, kib
Differential Revision:	https://reviews.freebsd.org/D21822
2019-10-02 17:06:28 +00:00
Mark Johnston
5131cba6d6 Use OBJT_PHYS VM objects for kernel modules.
OBJT_DEFAULT incurs some unnecessary overhead given that kernel module
pages cannot be paged out.

Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21862
2019-10-02 16:34:42 +00:00
Mark Johnston
551caa8741 Harmonize the hptmv blob's build rule with that of other hpt* drivers.
No functional change intended.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21866
2019-10-02 16:18:50 +00:00
Glen Barber
e7a71e6d1b Add a comment explaining why the opensolaris_load line in loader.conf
is explicitly added.

Requested by:	rgrimes
MFC after:	3 days
MFC with:	r353004
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-10-02 16:09:28 +00:00
Alexander Kabaev
bcd34af473 Revert r352953: Convert pnmatch to single element array in regexec calls
Requested by: cem
2019-10-02 16:08:01 +00:00
Mark Johnston
4a7b33ecf4 Disallow fcntl(F_READAHEAD) when the vnode is not a regular file.
The mountpoint may not have defined an iosize parameter, so an attempt
to configure readahead on a device file can lead to a divide-by-zero
crash.

The sequential heuristic is not applied to I/O to or from device files,
and posix_fadvise(2) returns an error when v_type != VREG, so perform
the same check here.

Reported by:	syzbot+e4b682208761aa5bc53a@syzkaller.appspotmail.com
Reviewed by:	kib
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21864
2019-10-02 15:45:49 +00:00
Kyle Evans
8495fa081b libusb: LIBUSB_DEBUG environment variable override of libusb_set_debug
The debug level generally just controls verbosity of libusb for debugging
libusb devices/usage. We allow the environment to set the debug level
independent of the application, but the application will always override
this if it explicitly sets the debug level.

Changing the environment is easy, but patching the software to change the
debug level isn't necessarily easy or possible. Further, there's this
write-only debug_fixed variable that would seem to imply that the debug
level should be fixed, but it isn't currently used. Change the logic to use
strtol() so we can detect real 0 vs. conversion failure, then honor
debug_fixed in libusb_set_debug.

Reviewed by:	hselasky
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D21877
2019-10-02 15:19:39 +00:00
Kyle Evans
22c2c971a6 mips: fcmpset: do not spin on sc failure
For ll/sc architectures, atomic(9) allows failure modes where *old == val
due to write failure and callers should compensate for this. Do not retry on
failure, just leave 0 in ret and fail the operation if we couldn't sc it.
This lets the caller determine if it should retry or not.

Reviewed by:	kib
Looks ok:	imp
Differential Revision:	https://reviews.freebsd.org/D21836
2019-10-02 15:13:40 +00:00
Glen Barber
8cdae52ef6 Explicitly add opensolaris_load="YES" to loader.conf through the
installer when installing the system on a ZFS root filesystem.

For arm64, zfs_load="YES" does not add opensolaris.ko as a kld
dependency, so add it explicitly to prevent boot-time failures
out-of-box.

PR:		240478
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-10-02 13:30:17 +00:00
Kyle Evans
0da4b4089c Unbreak etcupdate(8) and mergemaster(8) after r352950
r352950 introduced improper case fall-through for shell scripts. Fix it with
a pipe.

Reported by:	lwhsu, David Wolfskill
2019-10-02 12:46:28 +00:00
Hans Petter Selasky
bb2d815739 Fix build failure for gcc after r352983, due to
not using static variable declared by net/sff8472.h .

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 12:45:39 +00:00
Hans Petter Selasky
67a254a074 Fix build failure for 32-bit platforms after r352991, due to
incorrect printf() formatter string.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 12:02:14 +00:00
Edward Tomasz Napierala
028af4ae67 Rename etc/rc.d/abi to etc/rc.d/linux; after moving out the SysV IPC stuff
it's entirely linux-specific.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21830
2019-10-02 11:40:40 +00:00
Hans Petter Selasky
d3d47408fc Bump driver version for mlx5core, mlx5en(4) and mlx5ib(4).
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:15:35 +00:00
Hans Petter Selasky
fedc7bd218 Print numeric error_type and module_status in mlx5core
in case the strings are not available.

Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:06:01 +00:00
Hans Petter Selasky
02fd8723c2 Add print to show user a reason for rejecting buffer size change in mlx5en(4).
Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:05:05 +00:00
Hans Petter Selasky
e525a7f0eb Only update lossy buffers config when manual PFC configuration was done
in mlx5en(4).

Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:02:54 +00:00
Hans Petter Selasky
63dd1be931 Improve mlx5_fwdump_prep logging in mlx5core.
Submitted by:	slavash@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:01:05 +00:00
Hans Petter Selasky
7bf46a63ce Randomize the delay when waiting for VSC flag in mlx5core.
The PRM suggests random 0 - 10ms to prevent multiple waiters on the same
interval in order to avoid starvation.

Submitted by:	slavash@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 10:59:44 +00:00
Hans Petter Selasky
eff4361d88 Use size_t for byte_to_write variable when comparing to eeprom_info_out_len
which is also size_t in mlx5tool(8).

Submitted by:	slavash@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 10:58:27 +00:00