]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r326041:
asomers [Mon, 11 Dec 2017 20:36:01 +0000 (20:36 +0000)]
MFC r326041:

periodic: fix exit status for nonexistent arguments

When called with an absolute pathname, periodic should attempt to execute
every script in that directory. If the directory does not exist, it should
print an error and exit 1. Due to a copy/paste mistake in r231568, it exits
0 in that case.

Reported by: devel/hs-ShellCheck
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13070

6 years agoMFC r326039:
asomers [Mon, 11 Dec 2017 20:33:11 +0000 (20:33 +0000)]
MFC r326039:

Add ATF tests for head(1)

Submitted by: Fred Schlecter <https://github.com/fjs-github>
Reviewed by: asomers, jilles
Differential Revision: https://github.com/freebsd/freebsd/pull/127

6 years agoMFC r326036:
asomers [Mon, 11 Dec 2017 20:30:58 +0000 (20:30 +0000)]
MFC r326036:

da(4): Short-circuit unnecessary BIO_FLUSH commands

sys/cam/scsi/scsi_da.c
Complete BIO_FLUSH commands immediately if the da(4) device hasn't
been written to since the last flush. If we haven't written to the
device, there is no reason to send a flush.

Submitted by: gibbs
Reviewed by: imp
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13106

6 years agoMFC r326032:
asomers [Mon, 11 Dec 2017 20:24:29 +0000 (20:24 +0000)]
MFC r326032:

Print ZAC device type in "camcontrol identify" output

ZAC (Zoned-device ATA Command set) is the standard for addressing SMR
(shingled magnetic recording) devices over SATA.  Drives indicate their
support for ZAC in their IDENTIFY block. Print whether and how a drive
supports ZAC in the output of "camcontrol identify".

Reviewed by: ken, imp
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13171

6 years agoMFC r325959:
asomers [Mon, 11 Dec 2017 20:21:35 +0000 (20:21 +0000)]
MFC r325959:

Add assertion in probedone() that we're holding the device lock.

Submitted by: ken
Reviewed by: asomers
Sponsored by: Spectra Logic Corp

6 years agoMFC r326273: Make ctlstat -n option work reasonably for sparse LUN list.
mav [Mon, 11 Dec 2017 14:38:42 +0000 (14:38 +0000)]
MFC r326273: Make ctlstat -n option work reasonably for sparse LUN list.

6 years agoMFC r326510:
ae [Mon, 11 Dec 2017 12:38:50 +0000 (12:38 +0000)]
MFC r326510:
  Fix format string warning with enabled DEBUGGING.

6 years agoMFC r325723:
delphij [Mon, 11 Dec 2017 05:19:45 +0000 (05:19 +0000)]
MFC r325723:

find(1): Don't treat statfs() error as fatal in f_fstype, which can happen
when a directory is removed in the middle of find.

Instead of a full err(), allow find to continue, plus print a warning with
exitstatus set when appropriate.

Reported by: 100.chksetuid via gordon
Reviewed by: jilles

6 years agoMFC r326244:
delphij [Mon, 11 Dec 2017 05:06:28 +0000 (05:06 +0000)]
MFC r326244:

Don't assign rs as we will assign it later.

6 years agoMFC r326744:
bryanv [Sun, 10 Dec 2017 19:22:43 +0000 (19:22 +0000)]
MFC r326744:

Correctly report the vmxnet3 link down media status

6 years agoMFC r326670:
dim [Sun, 10 Dec 2017 14:49:06 +0000 (14:49 +0000)]
MFC r326670:

Remove an unused incude from lib/msun/bsdsrc/b_log.c.

Submitted by: Steve Kargl

6 years agoMFC r326669:
dim [Sun, 10 Dec 2017 13:58:37 +0000 (13:58 +0000)]
MFC r326669:

Remove the sentence in math(3) about some long double math functions not
being available.

Submitted by: Steve Kargl

6 years agoMFC r326655,326668: correct error handling for graid
eugen [Sun, 10 Dec 2017 13:44:58 +0000 (13:44 +0000)]
MFC r326655,326668: correct error handling for graid
SINGLE/CONCAT/RAID5 volumes.

Approved by:    mav (mentor)

6 years agoMFC r326228 and r326229:
ed [Sun, 10 Dec 2017 12:25:32 +0000 (12:25 +0000)]
MFC r326228 and r326229:

  Use TO_PTR() to convert integers to pointers.

  For FreeBSD/arm64's cloudabi32 support, I'm going to need a TO_PTR() in
  this place. Also use it for all of the other source files, so that the
  difference remains as minimal as possible.

6 years agoMFC r325044:
markj [Fri, 8 Dec 2017 20:04:10 +0000 (20:04 +0000)]
MFC r325044:
Fix a lock leak in g_mirror_destroy().

6 years agoAdd support for IPv6 based addresses as part of the TCP unify portspace feature
hselasky [Fri, 8 Dec 2017 19:19:47 +0000 (19:19 +0000)]
Add support for IPv6 based addresses as part of the TCP unify portspace feature
in ibcore. This resolves an interopability issue when using both iWarp(T6) and
RDMA(CX-4 and CX-5) devices at the same time.

The problem is IPv4 based sockets cannot be bound to an IPv6 based address
causing sobind() to fail preventing all use of IPv6 based addresses with RDMA
when an iWarp device is present.

This is a direct commit.

Tested by: KrishnamRaju ErapaRaju <Krishna2@chelsio.com>
Sponsored by: Mellanox Technologies

6 years agoMFC r326134:
markj [Fri, 8 Dec 2017 18:04:43 +0000 (18:04 +0000)]
MFC r326134:
Duplicate helpers after disabling inherited tracepoints during a fork.

6 years agoMFC r326371:
markj [Fri, 8 Dec 2017 17:16:35 +0000 (17:16 +0000)]
MFC r326371:
Verify the object/vnode association after vget() in vm_pageout_clean().

6 years agoMFC r326286:
markj [Fri, 8 Dec 2017 16:25:05 +0000 (16:25 +0000)]
MFC r326286:
Don't use pcpu_find() to determine if a CPU ID is valid.

6 years agoMFC r302794, r306744, r307691, r307692, r316174, r316681, r316859,
markj [Fri, 8 Dec 2017 16:12:45 +0000 (16:12 +0000)]
MFC r302794, r306744, r307691, r307692, r316174, r316681, r316859,
    r316866, r316867, r316869:
Various gmirror fixes and cleanups.

6 years agoMFC r326362:
hselasky [Fri, 8 Dec 2017 15:23:17 +0000 (15:23 +0000)]
MFC r326362:
Disallow TUN and TAP character device IOCTLs to modify the network device
type to any value. This can cause page faults and panics due to accessing
uninitialized fields in the "struct ifnet" which are specific to the network
device type.

Found by: jau@iki.fi
PR: 223767
Sponsored by: Mellanox Technologies

6 years agoMFC r326633:
bapt [Fri, 8 Dec 2017 10:49:53 +0000 (10:49 +0000)]
MFC r326633:

Update to 2017-12-06

6 years agoMFC r326527:
bapt [Fri, 8 Dec 2017 10:47:24 +0000 (10:47 +0000)]
MFC r326527:

Only skip looking for manpages if both man directory and cat directory
are not existing.

This allows man(1) to read catpages when no man directories are available at all

PR: 223559
Reported by: wosch

6 years agoMFC r326526:
bapt [Fri, 8 Dec 2017 10:42:05 +0000 (10:42 +0000)]
MFC r326526:

In case man(1) found a catpage to display skip looking ".so" which is manpage
only.

In case we are trying to read a catpage, the manpage variable is not defined.
It results in the "cattool" having no arguments.

In case the catpage is compressed, the cattool used is "zcat" which dies if the
standard input is a terminal, meaning the function calling it is exiting as if
there were no ".so"
In case the catpage is uncompressed, the cattool used is "zcat -f" which waits
reading standard input, making the man(1) command hang.

PR: 223560
Reported by: wosch

6 years agoMFC r326429:
kib [Fri, 8 Dec 2017 10:31:02 +0000 (10:31 +0000)]
MFC r326429:
Destroy seltd st_mtx and st_wait in seltdfini().

6 years agoMFC r326422:
ae [Fri, 8 Dec 2017 08:16:36 +0000 (08:16 +0000)]
MFC r326422:
  Do better cleaning in key_destroy() for VIMAGE case.

  SPDB was cleaned using TAILQ_CONCAT() instead of calling key_unlink()
  for each SP, thus we need to properly clean lists in each bucket of
  V_sphashtbl to avoid panic in hashdestroy() when INVARIANTS is enabled.

  Do the same for V_acqaddrhashtbl and V_acqseqhashtbl.

  When we are called in DEFAULT_VNET, destroy also all global locks and
  drain key_timer callout.

  Reported by: kp
  Tested by: kp

6 years agoMFC r326420:
ed [Fri, 8 Dec 2017 05:57:18 +0000 (05:57 +0000)]
MFC r326420:

  Add an mlink for cloudabi32(4).

  We already provide this for cloudabi64(4), so not adding it for
  cloudabi32(4) is fairly inconsistent.

6 years agoMFC r325947:
asomers [Fri, 8 Dec 2017 05:32:17 +0000 (05:32 +0000)]
MFC r325947:

Fix potential NULL pointer dereference of device physical path

In scsi_dev_advinfo(), if the physical path is being stored and there is a
malloc failure (malloc(9) is called with M_NOWAIT), we could wind up in a
situation where the device's physpath_len is set to the length the user
provided, but the physpath itself is NULL.

If another context then comes in to fetch the physical path value, we would
wind up trying to memcpy a NULL pointer into the caller's buffer.

So, set the physpath_len to 0 when we free the physpath on entry into the
store case for the physical path.  Reset the length to a non-zero value only
after we've successfully malloced a buffer to hold it.

Submitted by: ken
Reviewed by: asomers
Sponsored by: Spectra Logic Corp

6 years agoMFC r325946:
asomers [Fri, 8 Dec 2017 05:26:10 +0000 (05:26 +0000)]
MFC r325946:

VOP_LOOKUP.9: update locking info

The old description has been inaccurate since at least 243271, if not
before.

Submitted by: will
Reviewed by: kib
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13108

6 years agoMFC r325857:
asomers [Fri, 8 Dec 2017 05:24:49 +0000 (05:24 +0000)]
MFC r325857:

Remove a double free(9) in xpt_bus_register

In xpt_bus_register(), remove superfluous call to free().  This was mostly
benign since free(9) checks for NULL before doing anything, and
xpt_create_path() is nice enough to NULL out the pointer on failure.
However, it could've segfaulted if malloc(9) failed during
xpt_create_path().

Submitted by: gibbs
Sponsored by: Spectra Logic Corp

6 years agoMFC r325817, r325827
asomers [Fri, 8 Dec 2017 05:20:54 +0000 (05:20 +0000)]
MFC r325817, r325827

r325817:
AIO tests: increase limits

tests/sys/aio/aio_kqueue_test.c
Instead of using a hard-coded queue depth, use
vfs.aio.max_aio_queue_per_proc

tests/sys/aio/lio_kqueue_test.c
The old, small limit on lio_listio's operation count was lifted by
change 324941.  Raise the operation count as high as possible without
exceeding the process's operation limit.

Sponsored by: Spectra Logic Corp

r325827:
Fix build on arm after r325817

Reported by: rpokala
X-MFC-With: 325817
Sponsored by: Spectra Logic Corp

6 years agoMFC r325812:
asomers [Fri, 8 Dec 2017 04:21:31 +0000 (04:21 +0000)]
MFC r325812:

devd.conf: add mps and mpr to the scsi controllers regex

Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12744

6 years agoMFC: r326662
jkim [Thu, 7 Dec 2017 18:04:48 +0000 (18:04 +0000)]
MFC: r326662

Merge OpenSSL 1.0.2n.

6 years agoMFC r326094: Fix indentation in bsdinstall-created wpa_supplicant.conf
emaste [Thu, 7 Dec 2017 03:57:11 +0000 (03:57 +0000)]
MFC r326094: Fix indentation in bsdinstall-created wpa_supplicant.conf

r311690 (MFC of r309934) cleaned up some cases in bsdinstall to use
heredocs but broke the indentation of the generated output, because <<-
heredocs strip leading tabs.

PR: 221982

6 years agoMFC: r309361, r322710, r323286, r326378, r326383, r326407
jkim [Wed, 6 Dec 2017 21:39:01 +0000 (21:39 +0000)]
MFC: r309361, r322710, r323286, r326378, r326383, r326407

Sync. hwpstate with head.

r309361 (danfe):

- Mention mismatching numbers in MSR vs. ACPI _PSS count warning.
- Rephrase unsupported AMD CPUs message and wrap as an overly long line.
- Improve readability when reporting resulted P-state transition (debug).

r322710, r323286 (cem):

- Add support for family 17h pstate info from MSRs.
- Yield CPU awaiting frequency change.

r326378, r326383, r326407:

- Fix some style(9) nits.
- Add a tunable "debug.hwpstate_verify" to check P-state after changing it
and turn it off by default.

6 years agoMFC r326518, r326522
bapt [Wed, 6 Dec 2017 10:06:00 +0000 (10:06 +0000)]
MFC r326518, r326522

r326518:
Add Posix 2013 référence for manpages

PR: 223930
Reported by: Mateusz Piotrowski <mpp302@gmail.com>

r326522:
Properly name the 2013 edition

Reported by: ed

6 years agoMFC r325851:
bapt [Wed, 6 Dec 2017 10:01:02 +0000 (10:01 +0000)]
MFC r325851:

remove the poor emulation of the IllumOS needfree global variable to prevent
the ARC reclaim thread running longer than needed.

Update the arc::needfree dtrace probe triggered in arc_lowmem() to also report
the value we may want to free.

Submitted by: Nikita Kozlov <nikita.kozlov at blade-group.com>
Reviewed by: avg
Approved by: avg
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12163

6 years agoMFC r326343:
cy [Wed, 6 Dec 2017 00:00:37 +0000 (00:00 +0000)]
MFC r326343:

Fix fetching ntp leapfile after 325256

Submitted by: Ronald Klop <ronald-lists@klop.ws>
Original commit by:    asomers
MFC PR: 224126

6 years agoMFC r326052: Support SIGINFO.
delphij [Tue, 5 Dec 2017 06:43:58 +0000 (06:43 +0000)]
MFC r326052: Support SIGINFO.

Obtained from: NetBSD

6 years agoMFC r326288: Fix integer overflow in SLOG test.
mav [Tue, 5 Dec 2017 01:54:52 +0000 (01:54 +0000)]
MFC r326288: Fix integer overflow in SLOG test.

6 years agoMFC r326074: filter all passwords (not only changed) from periodic passwd backup
emaste [Tue, 5 Dec 2017 01:35:04 +0000 (01:35 +0000)]
MFC r326074: filter all passwords (not only changed) from periodic passwd backup

The periodic 200.backup-passwd script outputs any differences it finds
in master.passwd, relative to the previous backup.  It intends to elide
the encrypted password field, but previously did so only for changed
lines (i.e., those beginning with - or + in the diff).

Apply the sed expression also to unchanged lines to also elide their
passwords.

PR: 223461
Reported by: Andre Albsmeier
Sponsored by: The FreeBSD Foundation

6 years agoMFC r325295:
wulf [Mon, 4 Dec 2017 21:12:05 +0000 (21:12 +0000)]
MFC r325295:

evdev: Lock Giant around keyboard ioctls
This fixes turning ukbd(4) LEDs on/off with evdev interface as well

MFC r325296:

evdev: Take driver's lock in cdev write handler if necessary

MFC r325297:

sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol

- Do not report T-axis wheel events as button presses
- Reverse T-axis to match Linux
- Remove wrong comment. T-axis buttons state should be checked by level not
    by edge to allow continuous wheel tilt reporting

MFC r325298:

evdev: Disable value normalization and state filtering for SND events.

Some events can take sound pitch as a value so can not be represented
as binary on/off events. Tracking for on/off state is left in place
as it is a part of the evdev API.

MFC r325299:

evdev: Do not start/stop softrepeat callout if no clients attached

Approved by: gonzo (mentor)

6 years agoMFC r325269:
wulf [Mon, 4 Dec 2017 20:22:26 +0000 (20:22 +0000)]
MFC r325269:

evdev: Translate KEY_102ND in evdev_scancode2key()

MFC r326020:

Fix evdev codes for slash and asterisk numpad keys of AT-keyboards

MFC r326021:

evdev: change USB scancode 0x54 from KEY_SLASH to KEY_KPSLASH

Submitted by: dumbbell (r325269, r326021)
Approved by: gonzo (mentor)

6 years agoMFC r325294:
wulf [Mon, 4 Dec 2017 20:09:38 +0000 (20:09 +0000)]
MFC r325294:

evdev: Hide "kern.evdev.rcpt_mask" sysctl if kernel is compiled
w/o EVDEV_SUPPORT as it's value has no meaning in this case.

MFC r326019:

evdev: Export EVDEV_SUPPORT kernel option through feature facility

Approved by: gonzo (mentor)

6 years agoMFC r326150: zdb: use a heap allocation instead of a huge array on stack
avg [Mon, 4 Dec 2017 16:47:19 +0000 (16:47 +0000)]
MFC r326150: zdb: use a heap allocation instead of a huge array on stack

6 years agoMFC r326315, r326330, r326331, r326412:
gjb [Mon, 4 Dec 2017 15:28:07 +0000 (15:28 +0000)]
MFC r326315, r326330, r326331, r326412:

 r326315:
  Set DISTDIR and WRKDIRPREFIX when building ports within the
  chroot(8) to avoid mtime changes within the ports checkout,
  which can cause checksum differences.

 r326330:
  Add a comment to release/release.conf.sample documenting
  EMBEDDEDPORTS. [1]

  Remove and update stale documentation from release(7) while here.

 r326331:
  Correct a comment.

 r326412:
  Fix port build flags passed to make(1) after r326315, where
  it was missed for embedded image builds.

PR: 206344 [1]
Sponsored by: The FreeBSD Foundation

6 years agoMFC r326175, r326176:
markj [Mon, 4 Dec 2017 15:22:06 +0000 (15:22 +0000)]
MFC r326175, r326176:
Lockstat fixes for sx locks.

6 years agoMFC r326177:
markj [Mon, 4 Dec 2017 15:20:39 +0000 (15:20 +0000)]
MFC r326177:
Fix the type signature for sx(9) DTrace subroutines.

6 years agoMFC r326178:
markj [Mon, 4 Dec 2017 15:19:50 +0000 (15:19 +0000)]
MFC r326178:
Don't redefine _KERNEL.

6 years agoMFC r326132:
markj [Mon, 4 Dec 2017 15:19:09 +0000 (15:19 +0000)]
MFC r326132:
Allow kern.geom.mirror.debug to be negative.

6 years agoMFC r326234, r326235, r326284:
markj [Mon, 4 Dec 2017 15:18:08 +0000 (15:18 +0000)]
MFC r326234, r326235, r326284:
vm_page_array initialization improvements.

6 years agoMFC r325897:
hselasky [Mon, 4 Dec 2017 09:53:03 +0000 (09:53 +0000)]
MFC r325897:
Improve the library dependencies helper script in src/tools.

Implement double pass of the relevant Makefiles. First make a list of
library names and directories and then scan for all the dependencies.
Spaces in directories in the source tree are not supported.

This avoids using hardcoded mappings between the library name
and the directory containing the library Makefile.

Add support for scanning contrib/ofed .

Bail out on any errors.

Sponsored by: Mellanox Technologies

6 years agoMFC r326058:
hselasky [Mon, 4 Dec 2017 09:51:08 +0000 (09:51 +0000)]
MFC r326058:
Make sure all initialized mutexes are destroyed in the iser module,
else WITNESS will panic. Prefix all mutex names with "iser_" to
prevent future WITNESS issues.

Sponsored by: Mellanox Technologies

6 years agoMFC r326424:
kib [Mon, 4 Dec 2017 09:47:42 +0000 (09:47 +0000)]
MFC r326424:
Add comment for vm_map_find_min().

6 years agoMFC r326161:
hselasky [Mon, 4 Dec 2017 09:41:57 +0000 (09:41 +0000)]
MFC r326161:
Implement atomic_fetchadd_64() for i386. This function is needed by the
atomic64 header file in the LinuxKPI for i386.

Reviewed by: kib
Sponsored by: Mellanox Technologies

6 years agoMFC r326392:
hselasky [Mon, 4 Dec 2017 09:26:12 +0000 (09:26 +0000)]
MFC r326392:
Properly define the VLAN_XXX() function macros to avoid miscompilation when
used inside "if" statements comparing with another value.

Detailed explanation:
"if (a ? b : c != 0)" is not the same like "if ((a ? b : c) != 0)"
which is the expected behaviour of a function macro.

Affects:
toecore, linuxkpi and ibcore.

Reviewed by: kib
Sponsored by: Mellanox Technologies

6 years agoMFC r324369
marcel [Sat, 2 Dec 2017 18:41:01 +0000 (18:41 +0000)]
MFC r324369
Fix alignment of 'last' in autofill.

6 years agoMFC r312450 (by emaste):
dim [Sat, 2 Dec 2017 18:00:01 +0000 (18:00 +0000)]
MFC r312450 (by emaste):

  Remove obsolete /usr/lib/debug/usr/lib/private dir

  Missed in r282420

  Reported by: dim

6 years agoMFC r324703: loader.mk: clean md.o even if MD_IMAGE_SIZE not defined
emaste [Fri, 1 Dec 2017 17:15:13 +0000 (17:15 +0000)]
MFC r324703: loader.mk: clean md.o even if MD_IMAGE_SIZE not defined

We don't normally provide special handling for optionally-included src
files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}.
Previously if one built with MD_IMAGE_SIZE, executed "make clean", and
then built with a different MD_IMAGE_SIZE md.o would not be rebuilt.

Reported by: Zakary Nafziger
Sponsored by: The FreeBSD Foundation

6 years agoMFC r326070: zfs_write: fix problem with writes appearing to succeed when over quota
avg [Fri, 1 Dec 2017 11:13:58 +0000 (11:13 +0000)]
MFC r326070: zfs_write: fix problem with writes appearing to succeed when over quota

The problem happens when the writes have offsets and sizes aligned with
a filesystem's recordsize (maximum block size).  In this scenario
dmu_tx_assign() would fail because of being over the quota, but the uio
would already be modified in the code path where we copy data from the
uio into a borrowed ARC buffer.  That makes an appearance of a partial
write, so zfs_write() would return success and the uio would be modified
consistently with writing a single block.

That bug can result in a data loss because the writes over the quota
would appear to succeed while the actual data is being discarded.

This commit fixes the bug by ensuring that the uio is not changed until
after all error checks are done.  To achieve that the code now uses
uiocopy() + uioskip() as in the original illumos design.  We can do that
now that uiocopy() has been updated in r326067 to use
vn_io_fault_uiomove().

6 years agoMFC r326067: make illumos uiocopy use vn_io_fault_uiomove
avg [Fri, 1 Dec 2017 11:06:51 +0000 (11:06 +0000)]
MFC r326067: make illumos uiocopy use vn_io_fault_uiomove

6 years agoMFC r320696: Allow ipsec to run in vnet jails
kp [Thu, 30 Nov 2017 21:38:09 +0000 (21:38 +0000)]
MFC r320696: Allow ipsec to run in vnet jails

ipsec is usable in vnet jails, so allow it to run there.

PR: 211364
Submitted by: Matthias Meyser <meyser xenet.de>

6 years agoMFC r325850: pfctl: teach route-to to deal with interfaces with multiple addresses
kp [Thu, 30 Nov 2017 21:21:22 +0000 (21:21 +0000)]
MFC r325850: pfctl: teach route-to to deal with interfaces with multiple addresses

The route_host parsing code set the interface name, but only for the first
node_host in the list. If that one happened to be the inet6 address and the
rule wanted an inet address it'd get removed by remove_invalid_hosts() later
on, and we'd have no interface name.

We must set the interface name for all node_host entries in the list, not just
the first one.

PR: 223208

6 years agoCorrect a mismerge of r325861, committed as r326017, to fix the
gjb [Thu, 30 Nov 2017 15:54:14 +0000 (15:54 +0000)]
Correct a mismerge of r325861, committed as r326017, to fix the
RPI2 SoC image build.

This is a direct commit to stable/11.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r326122:
kib [Thu, 30 Nov 2017 14:19:47 +0000 (14:19 +0000)]
MFC r326122:
Kill all descendants of the reaper, even if they are descendants of a
subordinate reaper.  Also, mark reapers when listing pids.

PR: 223745

6 years agoMFC r326086:
ae [Thu, 30 Nov 2017 07:42:56 +0000 (07:42 +0000)]
MFC r326086:
  Add ipfw_add_protected_rule() function that creates rule with 65535
  number in the reserved set 31. Use this function to create default rule.

MFC r326115:
  Rework rule ranges matching. Use comparison rule id with UINT32_MAX to
  match all rules with the same rule number.

MFC r326116:
  Move ipfw_send_pkt() from ip_fw_dynamic.c into ip_fw2.c.
  It is not specific for dynamic states function and called also from
  generic code.

MFC r326117:
  Check that address family of state matches address family of packet.
  If it is not matched avoid comparing other state fields.

MFC r326118:
  Modify ipfw's dynamic states KPI.

  Hide the locking logic used in the dynamic states implementation from
  generic code. Rename ipfw_install_state() and ipfw_lookup_dyn_rule()
  function to have similar names: ipfw_dyn_install_state() and
  ipfw_dyn_lookup_state(). Move dynamic rule counters updating to the
  ipfw_dyn_lookup_state() function. Now this function return NULL when
  there is no state and pointer to the parent rule when state is found.
  Thus now there is no need to return pointer to dynamic rule, and no need
  to hold bucket lock for this state. Remove ipfw_dyn_unlock() function.

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

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

6 years agoMFC r326135: bfd: fix segfault in the ihex parser on malformed ihex file
emaste [Thu, 30 Nov 2017 00:26:45 +0000 (00:26 +0000)]
MFC r326135: bfd: fix segfault in the ihex parser on malformed ihex file

From binutils commit 0102ea8cec5fc509bba6c91df61b7ce23a799d32, made
available under GPLv2 by Nick Clifton.

PR: 198824
Security: CVE-2014-8503

6 years agoMFC r326136: bfd: avoid crash on corrupt binaries
emaste [Thu, 30 Nov 2017 00:24:28 +0000 (00:24 +0000)]
MFC r326136: bfd: avoid crash on corrupt binaries

From binutils commits 5a4b0ccc20ba30caef53b01bee2c0aaa5b855339 and
7e1e19887abd24aeb15066b141cdff5541e0ec8e, made available under GPLv2
by Nick Clifton.

PR: 198824
Security: CVE-2014-8501
Security: CVE-2014-8502

6 years agoMFC r326082: freebsd-update: do not duplicate patchlist entries
emaste [Wed, 29 Nov 2017 20:38:21 +0000 (20:38 +0000)]
MFC r326082: freebsd-update: do not duplicate patchlist entries

PR: 221079
Submitted by: Masachika ISHIZUKA
Submitted by: ota@j.email.ne.jp
Reviewed by: cperciva

6 years agoDocument SA-17:06 through SA-17:11 and EN-17:07 through EN:17-10.
gjb [Wed, 29 Nov 2017 14:45:28 +0000 (14:45 +0000)]
Document SA-17:06 through SA-17:11 and EN-17:07 through EN:17-10.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r326096:
markj [Wed, 29 Nov 2017 14:25:17 +0000 (14:25 +0000)]
MFC r326096:
Annotate pragma/err.invalidlibdep.ksh as EXFAIL.

6 years agoMFC r326093:
markj [Wed, 29 Nov 2017 14:24:04 +0000 (14:24 +0000)]
MFC r326093:
Use the right variable for the IP header parameter to tcp:::send.

6 years agoRevert r326103, as it appeared to be incorrect.
glebius [Tue, 28 Nov 2017 19:09:05 +0000 (19:09 +0000)]
Revert r326103, as it appeared to be incorrect.

6 years agoMFC r325363:
asomers [Tue, 28 Nov 2017 17:07:21 +0000 (17:07 +0000)]
MFC r325363:

Fix mpr(4) panics caused by bad drive mapping tables

sys/dev/mpr/mpr_mapping.c
If _mapping_process_dpm_pg0 detects inconsistencies in the drive
mapping table (stored in the HBA's NVRAM), abort reading it and
continue to boot as if the mapping table were blank.  I observed
such inconsistencies in several HBAs after upgrading firmware from
14.0.0.0 to 15.0.0.0.

Reviewed by: slm
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12901

6 years agoMFC r322258, r324941, r324956, r325018
asomers [Tue, 28 Nov 2017 17:04:22 +0000 (17:04 +0000)]
MFC r322258, r324941, r324956, r325018

r322258:
Make p1003_1b.aio_listio_max a tunable

p1003_1b.aio_listio_max is now a tunable. Its value is reflected in the
sysctl of the same name, and the sysconf(3) variable _SC_AIO_LISTIO_MAX.
Its value will be bounded from below by the compile-time constant
AIO_LISTIO_MAX and from above by the compile-time constant
MAX_AIO_QUEUE_PER_PROC and the tunable vfs.aio.max_aio_queue.

Reviewed by: jhb, kib
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11601

r324941:
Remove artificial restriction on lio_listio's operation count

In r322258 I made p1003_1b.aio_listio_max a tunable. However, further
investigation shows that there was never any good reason for that limit to
exist in the first place. It's used in two completely different ways:

* To size a UMA zone, which globally limits the number of concurrent
  aio_suspend calls.

* To artifically limit the number of operations in a single lio_listio call.
  There doesn't seem to be any memory allocation associated with this limit.

This change does two things:

* Properly names aio_suspend's UMA zone, and sizes it based on a new constant.

* Eliminates the artifical restriction on lio_listio. Instead, lio_listio
  calls will now be limited by the more generous max_aio_queue_per_proc. The
  old p1003_1b.aio_listio_max is now an alias for
  vfs.aio.max_aio_queue_per_proc, so sysconf(3) will still work with
  _SC_AIO_LISTIO_MAX.

Reported by: bde
Reviewed by: jhb
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12120

r324956:
Bump man page revision dates for r324941

Reported by: jhb
X-MFC-with: 324941
Sponsored by: Spectra Logic Corp

r325018:
Fix aio_suspend in 32-bit emulation

An off-by-one error has been present since the system call was first present
in 185878.  It additionally became a memory corruption bug after change
324941.  The failure is actually revealed by our existing AIO tests.
However, apparently nobody's been running those in 32-bit emulation mode.

Reported by: Coverity, cem
CID: 1382114
X-MFC-With: 324941
Sponsored by: Spectra Logic Corp

6 years agoMFC r325011, r325016
asomers [Tue, 28 Nov 2017 16:52:38 +0000 (16:52 +0000)]
MFC r325011, r325016

r325011:
zfsd should be able to online an L2ARC that disappears and returns

Previously, this didn't work because L2ARC devices' labels don't contain
pool GUIDs.  Modify zfsd so that the pool GUID won't be required:

lib/libdevdctl/guid.h
Change INVALID_GUID from a uint64_t constant to a function that
returns an invalid Guid object.  Remove the void constructor.
Nothing uses it, and it violates RAII.

cddl/usr.sbin/zfsd/case_file.h
cddl/usr.sbin/zfsd/case_file.cc
Allow CaseFile::Find to match a CaseFile based on Vdev GUID alone.
In CaseFile::ReEvaluate, attempt to online devices even if the newly
arrived device has no pool GUID.

cddl/usr.sbin/zfsd/vdev_iterator.cc
Iterate through a pool's cache devices as well as its regular
devices.

Reported by: avg
Reviewed by: avg
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12791

r325016:
Partially revert r325011: restore Guid's default constructor

Reported by: ohartmann
X-MFC-With: 325011
Sponsored by: Spectra Logic Corp

6 years agoMFC r326307:
brooks [Tue, 28 Nov 2017 16:49:16 +0000 (16:49 +0000)]
MFC r326307:

Update vis(3) the latest from NetBSD.

This adds VIS_DQ for compatiblity with OpenBSD.

Correct by an off-by-one error and a read buffer overflow detected using
asan.

6 years agoMFC r324940:
asomers [Tue, 28 Nov 2017 16:34:55 +0000 (16:34 +0000)]
MFC r324940:

Fix the error message when creating a zpool on a too-small device

Don't check for SPA_MINDEVSIZE in vdev_geom_attach when opening by path.
It's redundant with the check in vdev_open, and failing to attach here
results in the wrong error message being printed.  However, still check for
it in some other situations:

* When opening by guids, so we don't get bogged down reading from slow
  devices like floppy drives.
* In vdev_geom_read_pool_label for the same reason, because we iterate over
  all providers.
* If the caller requests that we verify the guid, because then we'll have to
  read from the device before vdev_open verifies the size.

PR: 222227
Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by: avg, mav
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12531

6 years agoMFC r324457:
asomers [Tue, 28 Nov 2017 16:09:02 +0000 (16:09 +0000)]
MFC r324457:

Remove embedded newlines from sysctl variable descriptions

PR: 112556
Submitted by: Willem Jan Withagen <wjw@digiware.nl> (earlier version)
Reported by: Willem Jan Withagen, ighighi@gmail.com
Sponsored by: Spectra Logic Corp

6 years agoMFC r326137:
andrew [Tue, 28 Nov 2017 11:06:17 +0000 (11:06 +0000)]
MFC r326137:

Ensure we check the program state set in the trap frame on arm and arm64.
This value may be set by userspace so we need to check it before using it.
If this is not done correctly on exception return the kernel may continue
in kernel mode with all registers set to a userspace controlled value. Fix
this by moving the check into set_mcontext, and also add the missing
sanitisation from the arm64 set_regs.

Discussed with: security-officer@
Sponsored by: DARPA, AFRL

6 years agoMFC r326061, r326063:
markj [Tue, 28 Nov 2017 01:16:41 +0000 (01:16 +0000)]
MFC r326061, r326063:
DTrace test fixups.

6 years agoMFC r326060:
markj [Tue, 28 Nov 2017 01:15:53 +0000 (01:15 +0000)]
MFC r326060:
Clean up the SYSINIT_FLAGS definitions for rwlock(9) and rmlock(9).

6 years agoMFC r326055:
markj [Tue, 28 Nov 2017 01:15:10 +0000 (01:15 +0000)]
MFC r326055:
Allow for fictitious physical pages in vm_page_scan_contig().

6 years agoMFC r326046: dt_modtext: return error on archs lacking an implementation
emaste [Tue, 28 Nov 2017 00:56:20 +0000 (00:56 +0000)]
MFC r326046: dt_modtext: return error on archs lacking an implementation

Reported by: mmel
Reviewed by: markj
Sponsored by: The FreeBSD Foundation

6 years agoMFC r325042: libdtrace: replace "DOODAD" with more descriptive string
emaste [Tue, 28 Nov 2017 00:55:30 +0000 (00:55 +0000)]
MFC r325042: libdtrace: replace "DOODAD" with more descriptive string

Previously some unimplemented libdtrace routines printed the function,
file and line number, followed by "DOODAD." That is not particularly
informative, so replace it with a message reporting the actual issue.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r324805:
asomers [Tue, 28 Nov 2017 00:41:17 +0000 (00:41 +0000)]
MFC r324805:

Fix the mps(4) HISTORY section.

Looks like a copy/paste error from r302673.

Sponsored by: Spectra Logic Corp

6 years agoMFC r323275, r324112
asomers [Tue, 28 Nov 2017 00:39:58 +0000 (00:39 +0000)]
MFC r323275, r324112

r323275:
Add basic tests for chflags, mkdir, rcp, and rmdir

Add basic command line parsing test coverage for these utilities.  The tests
were automatically generated based on their man pages.  These tests can be
expanded by hand for more thorough coverage.  The aim is to generate very
basic amount of test coverage for all the utilities in the base system.

Submitted by: shivansh
Reviewed by: asomers, brooks
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D12036

r324112:
Fix Makefile entries from r323275

Reported by: Vladimir Zakharov <zakharov.vv@gmail.com>
Reviewed by: ngie
X-MFC-With: 323275

6 years agoMFC r322854, r323995, r324568, r324991
asomers [Tue, 28 Nov 2017 00:19:04 +0000 (00:19 +0000)]
MFC r322854, r323995, r324568, r324991

r322854:
zfsd(8): Close a race condition when onlining a disk paritition

When inserting a partitioned disk, devfs and geom will announce the whole
disk before they announce the partition. If the partition containing ZFS
extends to one of the disk's extents, then zfsd will see a ZFS label on the
whole disk and attempt to online it. ZFS is smart enough to activate the
partition instead of the whole disk, but only if GEOM has already created
the partition's provider.

cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
Add a zpool_read_all_labels method. It's similar to
zpool_read_label, but it will return the number of labels found.

cddl/usr.sbin/zfsd/zfsd_event.cc
When processing a DevFS CREATE event, only online a VDEV if we can
read all four ZFS labels.

Reviewed by: mav
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11920

r323995:
Close a memory leak when using zpool_read_all_labels

X-MFC-With: 322854
Sponsored by: Spectra Logic Corp

r324568:
Optimize zpool_read_all_labels with AIO

Read all labels in parallel instead of sequentially

X-MFC-With: 322854
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12495

r324991:
Fix zpool_read_all_labels when vfs.aio.enable_unsafe=0

Previously, zpool_read_all_labels was trying to do 256KB reads, which are
greater than the default MAXPHYS and therefore must go through the slow,
unsafe AIO path.  Shrink these reads to 112KB so they can use the safe, fast
AIO path instead.

X-MFC-With: 324568
Sponsored by: Spectra Logic Corp

6 years agoMFC r326068:
gjb [Mon, 27 Nov 2017 15:12:14 +0000 (15:12 +0000)]
MFC r326068:
 Remove /etc/resolv.conf from virtual machine images, which is
 copied from the build host.  It is renamed to /etc/resolv.conf.bak
 on boot, so never used anyway.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r325755: Be more careful when doing calculation with request from
delphij [Mon, 27 Nov 2017 03:47:12 +0000 (03:47 +0000)]
MFC r325755: Be more careful when doing calculation with request from
userland.

6 years agoMFC r326028:
pfg [Mon, 27 Nov 2017 02:43:27 +0000 (02:43 +0000)]
MFC r326028:
iconv: Fix a pointer mismatch.

Catch NULL pointer earlier, check for empty string later.
Apparently this fixes a GCC8 warning.

Obtained from: NetBSD (CVS Rev. 1.21, 1.22) through DragonFlyBSD

6 years agoMFC r319824 (by sevan), r320624, r326173:
markj [Mon, 27 Nov 2017 00:26:33 +0000 (00:26 +0000)]
MFC r319824 (by sevan), r320624, r326173:
Fixups for the lockstat provider man page.

6 years agoMFC r326098:
kib [Sat, 25 Nov 2017 14:47:24 +0000 (14:47 +0000)]
MFC r326098:
Return different error code for the guard page layout violation.

PR: 223732

6 years agoMFC r325960:
ae [Fri, 24 Nov 2017 04:42:21 +0000 (04:42 +0000)]
MFC r325960:
  Unconditionally enable support for O_IPSEC opcode.

  IPsec support can be loaded as kernel module, thus do not depend from
  kernel option IPSEC and always build O_IPSEC opcode implementation as
  enabled.

MFC r325962:
  Do not invoke IPv4 NAT handler for non IPv4 packets. Libalias expects
  a packet is IPv4. And in case when it is IPv6, it just translates them
  as IPv4. This leads to corruption and in some cases to panics.
  In particular a panic can happen when value of ip6_plen modified to
  something that leads to IP fragmentation, but actual packet length does
  not match the IP length.

  Packets that are not IPv4 will be dropped by NAT rule.

6 years agoMFC r325528:
markj [Thu, 23 Nov 2017 14:03:10 +0000 (14:03 +0000)]
MFC r325528:
Correct the type of foff.

6 years agoMFC r325561:
markj [Thu, 23 Nov 2017 14:02:35 +0000 (14:02 +0000)]
MFC r325561:
Allow various page daemon parameters to be set from loader.conf.

6 years agoMFC r325887:
markj [Thu, 23 Nov 2017 14:01:52 +0000 (14:01 +0000)]
MFC r325887:
Avoid holding the process in uread() and uwrite().

6 years agoMFC r324864, r324865:
markj [Thu, 23 Nov 2017 13:59:34 +0000 (13:59 +0000)]
MFC r324864, r324865:
Cleanups for ctf.5.

6 years agoMFC r325571: Add some PCI IDs found on AMD Epyc system.
mav [Thu, 23 Nov 2017 10:09:49 +0000 (10:09 +0000)]
MFC r325571: Add some PCI IDs found on AMD Epyc system.

6 years agoMFC r325888:
bapt [Thu, 23 Nov 2017 09:35:01 +0000 (09:35 +0000)]
MFC r325888:

Add some 4k quirks for Samsung pm863a SSDs

Submitted by: Nikita Kozlov <nikita.kozlov at blade-group.com>
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D13093