]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r311103 (ian):
cy [Wed, 29 Mar 2017 01:32:34 +0000 (01:32 +0000)]
MFC r311103 (ian):

Update ntp.conf to use the ntpd pool feature.

Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org
using 3 separate 'server' config lines.  That is now replaced with a single
'pool' line which causes ntpd to add multiple servers from the pool.

More than just making the config smaller, the pool feature in ntpd has one
major advantage over configuring 3 separate servers from a pool: if a server
that was added using a 'pool' statement provides bad time (initially or at
some later date), ntpd automatically discards it and configures a new
different server from the pool without needing to be restarted.

These changes also add a 'tos' line to control how many pool servers get
added, a 'restrict source' line that is required to allow ntpd to add new
peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does
nothing and should never have been there (127.127.1.0 is not a valid IP
address, it's a refclock identifier).

Reviewed by: cy
MFC requested by: ache
Differential Revision:  https://reviews.freebsd.org/D9011

git-svn-id: svn://svn.freebsd.org/base/stable/10@316121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315242: Fix late and noauto with geli swap
amdmi3 [Tue, 28 Mar 2017 10:43:20 +0000 (10:43 +0000)]
MFC r315242: Fix late and noauto with geli swap

With the following in /etc/fstab:

/dev/gpt/swap.eli none swap sw,late 0 0

swap will not be enabled, with `swapon -aL' complaining:

swapon: Invalid option: late

This happens because swap_on_geli_args() which parses geli arguments
out of all mount options does not expect late or noauto among them.
Fix this by explicitly allowing these arguments.

Reviewed by: jilles
Approved by: jilles
Differential Revision: D9835

git-svn-id: svn://svn.freebsd.org/base/stable/10@316097 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315279: Remove some dead/broken code paths around async handling
mav [Tue, 28 Mar 2017 10:26:27 +0000 (10:26 +0000)]
MFC r315279: Remove some dead/broken code paths around async handling

git-svn-id: svn://svn.freebsd.org/base/stable/10@316093 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315273: Remove tangled isp_mbox_continue() mechanism.
mav [Tue, 28 Mar 2017 10:25:10 +0000 (10:25 +0000)]
MFC r315273: Remove tangled isp_mbox_continue() mechanism.

It was implemented to reduce context switches when uploading firmware to
card's RAM.  But this mechanism is not used last 10 years since all mbox
operations are now polled, and it was never used for cards produced in
last 15 years.  Newer cards can use DMA to upload firmware.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316091 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call.
mav [Tue, 28 Mar 2017 10:24:01 +0000 (10:24 +0000)]
MFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316089 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315234: Improvements around attach, reset and detach.
mav [Tue, 28 Mar 2017 10:22:55 +0000 (10:22 +0000)]
MFC r315234: Improvements around attach, reset and detach.

This change fixes DMA resource leak on driver unload.  Also it removes
DMA resources allocation for hardcoded number of requests before fetching
the real number from firmware.  Also it prepares ground for more flexible
IRQs allocation according to firmware capabilities.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316087 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313568 (by ken):
mav [Tue, 28 Mar 2017 10:19:52 +0000 (10:19 +0000)]
MFC r313568 (by ken):
Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.

The isp(4) driver was changing the tag type for REQUEST SENSE
commands to Head of Queue, when the CAM CCB flag
CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
and when the target has tagged queueing turned on.

In most cases when CAM_TAG_ACTION_VALID is not set, it is because
the target is not doing tagged queueing.  In those cases, trying to
send a Head of Queue tag may cause problems.  Instead, default to
sending a simple tag.

IBM tape drives claim to support tagged queueing in their standard
Inquiry data, but have the DQue bit set in the control mode page
(mode page 10).  CAM correctly detects that these drives do not
support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
on CCBs sent down to the drives.

This caused the isp(4) driver to go down the path of setting the
tag action to a default value, and for Request Sense commands only,
set the tag action to Head of Queue.

If an IBM tape drive does get a Head of Queue tag, it rejects it with
Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
to a Transport Error, which the driver translates to an Unrecoverable
HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
to get a good response from a REQUEST SENSE to an FC-attached IBM
tape drive with the isp(4) driver.

IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
with 4470 firmware) also have a bug in that sending a command with a
non-simple tag attribute breaks the tape drive's Command Reference
Number (CRN) accounting and causes it to ignore all subsequent
commands because it and the initiator disagree about the next
expected CRN.  The drives do reject the initial command with a head
of queue tag with an Invalid Message Error (0x49,0x00), but after that
they ignore any subsequent commands.  IBM confirmed that it is a bug,
and sent me test firmware that fixes the bug.  However tape drives in
the field will still exhibit the bug until they are upgraded.

Request Sense is not often sent to targets because most errors are
reported automatically through autosense in Fibre Channel and other
modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
an error that would crop up frequently.  But Request Sense is useful on
tape devices to report status information, aside from error reporting.

This problem is less serious without FC-Tape features turned on,
specifically precise delivery of commands (which enables Command
Reference Numbers), enabled on the target and initiator.  Without
FC-Tape features turned on, the target would return an error and
things would continue on.

And it also does not cause problems for targets that do tagged
queueing, because in those cases the isp(4) driver just uses the
tag type that is specified in the CCB, assuming the
CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
tag action if it isn't an ordered or head of queue tag.

sys/dev/isp/isp.c:
        In isp_start(), don't try to send Request Sense commands
        with the Head of Queue tag attribute if the CCB doesn't
        have a valid tag action.  The tag action likely isn't valid
        because the target doesn't support tagged queueing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316086 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299849 (by trasz):
mav [Tue, 28 Mar 2017 10:15:30 +0000 (10:15 +0000)]
MFC r299849 (by trasz):
Remove NULL checks after M_WAITOK allocations from isp(4).

git-svn-id: svn://svn.freebsd.org/base/stable/10@316085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313436,r313437,r313438,r314587,r315687:
ngie [Tue, 28 Mar 2017 06:13:16 +0000 (06:13 +0000)]
MFC r313436,r313437,r313438,r314587,r315687:

r313436:

Clarify #includes for hexdump(3) vs sbuf_hexdump(9)

hexdump(3) only requires libutil.h, whereas sbuf_hexdump(9) requires
sys/types.h (for ssize_t) and sys/sbuf.h

r313437:

Create link from hexdump(3) to sbuf_hexdump(9) as the manpage describes
sbuf_hexdump(9)'s behavior

r313438:

Clean up trailing and leading whitespace for variables to make it
consistent with the rest of the file and style.Makefile(9) a bit
more

r314587:

Correct MLINKS for sbuf_hexdump(9)

sbuf_hexdump(9) should be linked to sbuf(9), not hexdump(3). Another
review will be posted to deduplicate the sbuf_hexdump reference in
in hexdump(3) or at the very least make the information less duplicative.

r315687:

Document sbuf_hexdump(9) in just sbuf(9)

- Remove duplicate references to sbuf_hexdump(9) from hexdump(3).
  sbuf_hexdump(9) already pointed back to hexdump(3) for implementation
  details.
- Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness

git-svn-id: svn://svn.freebsd.org/base/stable/10@316074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315686,r315688:
ngie [Tue, 28 Mar 2017 06:05:26 +0000 (06:05 +0000)]
MFC r315686,r315688:

r315686:

kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner

Return a NUL string instead of just working by accident with kvm_geterr(3)
when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION
being enabled path).

Document the new explicit return behavior for kvm_geterr(3), as well
as the previous implicit behavior, i.e., the buffer attached to
returned via kvm_geterr(3) would be empty if a previous error hadn't been
stored in `kd`.

r315688:

kvm_write: fix -Wcast-qual warning in pointer arithmetic argument

Cast buf to `const char *` when doing arithmetic operation to match
`cp`'s type [1].

git-svn-id: svn://svn.freebsd.org/base/stable/10@316072 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315647:
ngie [Tue, 28 Mar 2017 05:57:20 +0000 (05:57 +0000)]
MFC r315647:

Handle kd == NULL gracefully with kvm_close(3)

Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return
-1 and set errno to EINVAL.

Document this new behavior explicitly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315871: MFV r315791: ntp 4.2.8p10.
delphij [Tue, 28 Mar 2017 04:48:55 +0000 (04:48 +0000)]
MFC r315871: MFV r315791: ntp 4.2.8p10.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316069 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315639:
ngie [Mon, 27 Mar 2017 18:29:30 +0000 (18:29 +0000)]
MFC r315639:

libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers

This is being done to avoid potential double frees with the values.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316047 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314245:
ngie [Mon, 27 Mar 2017 18:28:17 +0000 (18:28 +0000)]
MFC r314245:

Fill MK_LIBTHR as far as lib/libthr is concerned

There are other areas of the tree that will need to be evaluated for sanity
if they're supposed to be conditionally compiled out of the build/install,
like libzpool

Relnotes: yes (this might break someone's system if have the knob set)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316046 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315641,r315642:
ngie [Mon, 27 Mar 2017 18:26:22 +0000 (18:26 +0000)]
MFC r315641,r315642:

r315641:

bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure

r315642:

bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..)

open_client_* returns -1 on failure; 0 on success. Ensure that the return value is
0 -- otherwise exit snmp_open(..).

git-svn-id: svn://svn.freebsd.org/base/stable/10@316044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315690:
ngie [Mon, 27 Mar 2017 18:24:27 +0000 (18:24 +0000)]
MFC r315690:

Delete trailing whitespace (no functional change)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316042 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315595,r315603:
ngie [Mon, 27 Mar 2017 18:23:45 +0000 (18:23 +0000)]
MFC r315595,r315603:

r315595:

Remove a commented out line before kvm_getprocs(3)

The commented out return value for kvm_getprocs(3) was misleading -- the
uncommented line is correct.

No content change

r315603:

kvm_close(3): return `error` instead of blindly returning `0`

`error` is the accumulated error from previous close(2) calls.

This bug has been present since the libcall's import from 4.4BSD
Lite (r1573).

Noticed by: vangyzen (D10022)
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@316040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 315229: Remove remnant of r315163.
mav [Mon, 27 Mar 2017 08:29:46 +0000 (08:29 +0000)]
MFC 315229: Remove remnant of r315163.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 315529
kp [Sun, 26 Mar 2017 18:12:50 +0000 (18:12 +0000)]
MFC 315529

pf: Fix rule evaluation after inet6 route-to

In pf_route6() we re-run the ruleset with PF_FWD if the packet goes out
of a different interface. pf_test6() needs to know that the packet was
forwarded (in case it needs to refragment so it knows whether to call
ip6_output() or ip6_forward()).

This lead pf_test6() to try to evaluate rules against the PF_FWD
direction, which isn't supported, so it needs to treat PF_FWD as PF_OUT.
Once fwdir is set correctly the correct output/forward function will be
called.

PR:             217883
Submitted by:   Kajetan Staszkiewicz
Sponsored by:   InnoGames GmbH

git-svn-id: svn://svn.freebsd.org/base/stable/10@316000 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315161: Try to slight untangle I/O and loop status handling.
mav [Sun, 26 Mar 2017 08:54:08 +0000 (08:54 +0000)]
MFC r315161: Try to slight untangle I/O and loop status handling.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315980 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315160: Remove code for unsupported FreeBSD versions.
mav [Sun, 26 Mar 2017 08:52:44 +0000 (08:52 +0000)]
MFC r315160: Remove code for unsupported FreeBSD versions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315978 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315163: Remove strange config_intrhook_establish() magic.
mav [Sun, 26 Mar 2017 08:51:22 +0000 (08:51 +0000)]
MFC r315163: Remove strange config_intrhook_establish() magic.

Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315976 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315588:
kib [Sun, 26 Mar 2017 01:10:59 +0000 (01:10 +0000)]
MFC r315588:
Update the list of cpudev ioctls which require write access.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315972 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoSynchronize libcxxrt in stable/10 with stable/11.
dim [Sat, 25 Mar 2017 21:46:02 +0000 (21:46 +0000)]
Synchronize libcxxrt in stable/10 with stable/11.

MFC r284553 (by emaste):

Update libcxxrt upgrade instructions

The typeinfo file no longer exists upstream.

MFC r297299:

Compile libcxxrt as C++11, since it is only really used in combination
with libc++, which is also C++11.  Also change one _Static_assert (which
is really C11) back into static_assert, like upstream.

This should help when compiling libcxxrt with newer versions of gcc,
which refuse to recognize any form of static assertions, if not
compiling for C++11 or higher.

While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
headers outside the source tree.

MFC r299144:

Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef.

Interesting fixes:
3adaa2e Fix _Unwind_Exception cleanup functions
286776c Check exception cleanup function ptr before calling
edda626 Correct exception specifications on new and delete operators

MFC r303157 (by emaste):

libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7271

MFC r305396:

Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header.  This
value is used in newer versions of compiler-rt.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315412, r314852:
badger [Sat, 25 Mar 2017 20:14:08 +0000 (20:14 +0000)]
MFC r315412, r314852:

r315412:
    Don't clear p_ptevents on normal SIGKILL delivery

    The ptrace() user has the option of discarding the signal. In such a
    case, p_ptevents should not be modified. If the ptrace() user decides to
    send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events
    do not have the capability to discard the signal, so continue to clear
    the mask in that case.

r314852:
    don't stop in issignal() if P_SINGLE_EXIT is set

    Suppose a traced process is stopped in ptracestop() due to receipt of a
    SIGSTOP signal, and is awaiting orders from the tracing process on how
    to handle the signal. Before sending any such orders, the tracing
    process exits. This should kill the traced process. But suppose a second
    thread handles the SIGKILL and proceeds to exit1(), calling
    thread_single(). The first thread will now awaken and will have a chance
    to check once more if it should go to sleep due to the SIGSTOP.  It must
    not sleep after P_SINGLE_EXIT has been set; this would prevent the
    SIGKILL from taking effect, leaving a stopped orphan behind after the
    tracing process dies.

    Also add new tests for this condition.

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315963 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313992, r314075, r314118, r315484:
badger [Sat, 25 Mar 2017 13:33:23 +0000 (13:33 +0000)]
MFC r313992, r314075, r314118, r315484:

r315484:
    ptrace_test: eliminate assumption about thread scheduling

    A couple of the ptrace tests make assumptions about which thread in a
    multithreaded process will run after a halt. This makes the tests less
    portable across branches, and susceptible to future breakage. Instead,
    twiddle thread scheduling and priorities to match the tests'
    expectation.

r314118:
    Actually fix buildworlds other than i386/amd64/sparc64 after r313992

    Disable offending test for platforms without a userspace visible
    breakpoint().

r314075:
    Fix world build for archs where __builtin_debugtrap() does not work.

    The offending code was introduced in r313992.

r313992:
    Defer ptracestop() signals that cannot be delivered immediately

    When a thread is stopped in ptracestop(), the ptrace(2) user may request
    a signal be delivered upon resumption of the thread. Heretofore, those signals
    were discarded unless ptracestop()'s caller was issignal(). Fix this by
    modifying ptracestop() to queue up signals requested by the ptrace user that
    will be delivered when possible. Take special care when the signal is SIGKILL
    (usually generated from a PT_KILL request); no new stop events should be
    triggered after a PT_KILL.

    Add a number of tests for the new functionality. Several tests were authored
    by jhb.

PR: 212607
Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315745:
dim [Sat, 25 Mar 2017 12:29:15 +0000 (12:29 +0000)]
MFC r315745:

Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:

Author: David Chisnall <theraven@FreeBSD.org>
Date:   Wed Mar 22 12:27:08 2017 +0000

    Simplify some code.

    realloc() with a null pointer is equivalent to malloc, so we don't need
    to handle the two cases independently.

    Fixes #46

This should help with lang/beignet and other programs, which expect
__cxa_demangle(name, NULL, NULL, &status) to return zero in status.

PR: 213732

git-svn-id: svn://svn.freebsd.org/base/stable/10@315943 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315087, r315146:
mav [Sat, 25 Mar 2017 11:48:12 +0000 (11:48 +0000)]
MFC r315087, r315146:
Improve ctl(4) description, including frontends and backends.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315084: Increase device openings to tagged maximum.
mav [Sat, 25 Mar 2017 11:45:19 +0000 (11:45 +0000)]
MFC r315084: Increase device openings to tagged maximum.

Some SIMs report much less untagged device openings then tagged ones.
Target mode devices are not handled by regular probing routines, and so
there is nothing to increase queue size for them to the SIM's maximum.
To fix that resize the queue explicitly on ctl periph registration.
This radically improves performance of mpt(4) in target mode.

Also fetch and report device queue statistics in `ctladm dumpstructs`,
since regular way of `camcontrol tags` is not usable in target mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315939 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
mav [Sat, 25 Mar 2017 11:36:06 +0000 (11:36 +0000)]
MFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.

Queue statistics has nothing to do with presence or absence of INQUIRY
data, etc.  Target mode devices are never configured, but have queues.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315361 and r315364: Hide MONITORX/MWAITX from guests.
grehan [Sat, 25 Mar 2017 05:09:03 +0000 (05:09 +0000)]
MFC  r315361 and  r315364: Hide MONITORX/MWAITX from guests.

r315361
  Add the AMD MONITORX/MWAITX feature definition introduced in
  Bulldozer/Ryzen CPUs.

r315364
  Hide the AMD MONITORX/MWAITX capability.
  Otherwise, recent Linux guests will use these instructions, resulting
  in #UD exceptions since bhyve doesn't implement MONITOR/MWAIT exits.

  This fixes boot-time hangs in recent Linux guests on Ryzen CPUs
  (and probably Bulldozer aka AMD FX as well).

git-svn-id: svn://svn.freebsd.org/base/stable/10@315928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Re-add mutex lock call that was dropped in a previous commit.
erj [Fri, 24 Mar 2017 18:28:48 +0000 (18:28 +0000)]
ixgbe(4): Re-add mutex lock call that was dropped in a previous commit.

PR: 218062
Reported by: Terry Kennedy <terry-freebsd@glaver.org>
Sponsored by: Intel Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/10@315916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoPull in r283944 from upstream libc++ trunk (by Eric Fiselier):
dim [Fri, 24 Mar 2017 18:28:13 +0000 (18:28 +0000)]
Pull in r283944 from upstream libc++ trunk (by Eric Fiselier):

  Fix std::pair on FreeBSD

  Summary:
  FreeBSD ships an old ABI for std::pair which requires that it have
  non-trivial copy/move constructors. Currently the non-trivial
  copy/move is achieved by providing explicit definitions of the
  constructors. This is problematic because it means the constructors
  don't SFINAE properly. In order to SFINAE copy/move constructors they
  have to be explicitly defaulted and hense non-trivial.

  This patch attempts to provide SFINAE'ing copy/move constructors for
  std::pair while still making them non-trivial. It does this by adding
  a base class with a non-trivial copy constructor and then allowing
  pair's constructors to be generated by the compiler. This also allows
  the constructors to be constexpr.

  Reviewers: emaste, theraven, rsmith, dim

  Subscribers: cfe-commits

  Differential Revision: https://reviews.llvm.org/D25389

This should fix building www/chromium 57.0.2987.110 on stable/10 and
stable/9 without having to use -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 (which
changes the ABI).  Direct commit to stable/10 and stable/9, since head
already has libc++ 4.0, which includes this fix.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoSubset of upstream r902 which fixes custom prompts.
des [Fri, 24 Mar 2017 14:40:53 +0000 (14:40 +0000)]
Subset of upstream r902 which fixes custom prompts.

PR: 216172

git-svn-id: svn://svn.freebsd.org/base/stable/10@315907 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r313974,r314596): open .netrc early in case we want to drop privs
des [Fri, 24 Mar 2017 14:26:01 +0000 (14:26 +0000)]
MFH (r313974,r314596): open .netrc early in case we want to drop privs
MFH (r314396,r315143): fix a crash caused by an incorrect format string
MFH (r314701): fix handling of 416 errors when requesting a range
MFH (r315455): fix parsing of IP literals (square brackets)

PR: 212065, 217723

git-svn-id: svn://svn.freebsd.org/base/stable/10@315904 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315453:
kib [Fri, 24 Mar 2017 07:22:32 +0000 (07:22 +0000)]
MFC r315453:
When clearing altsigstack settings on exec, do it to the right thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315022: Request change of SIM target role only when it is different.
mav [Fri, 24 Mar 2017 07:03:26 +0000 (07:03 +0000)]
MFC r315022: Request change of SIM target role only when it is different.

Separate WWNs change into separate request to know what actually failed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315891 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315030: Abort all ATIOs and INOTs queued to SIM on LUN disable.
mav [Fri, 24 Mar 2017 07:02:03 +0000 (07:02 +0000)]
MFC r315030: Abort all ATIOs and INOTs queued to SIM on LUN disable.

Some SIMs may not abort them implicitly, that either fail the LUN disable
request or just make us wait for those CCBs forever.  With this change
I can successfully disable LUNs on mpt(4).  For isp(4), which aborts them
implicitly, this change should be irrelevant.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315889 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315025: Switch work_queue from TAILQ to STAILQ.
mav [Fri, 24 Mar 2017 07:00:16 +0000 (07:00 +0000)]
MFC r315025: Switch work_queue from TAILQ to STAILQ.

It is mostly FIFO and we don't need random removal there.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314365
davidcs [Fri, 24 Mar 2017 03:11:11 +0000 (03:11 +0000)]
MFC r314365
  1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to
     sync threads during interface down or detach.
  2. add sysctl to set pause frame parameters
  3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32)
  4. add debug messages for PHY
  5. HW LRO support restricted to FreeBSD versions 8.x and above.

Submitted by: Vaishali.Kulkarni@cavium.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@315882 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314814 and r315325.
np [Thu, 23 Mar 2017 20:23:00 +0000 (20:23 +0000)]
MFC r314814 and r315325.

r314814:
cxgbe/iw_cxgbe: Abort connection if there is an error during c4iw_modify_qp.

r315325:
cxgbe/iw_cxgbe: Use the socket and not the toepcb to reach for the
inpcb.  t4_tom detaches the inpcb from the toepcb as soon as the
hardware is done with the connection (in final_cpl_received) but the
socket is around as long as the cm_id and the rest of iWARP state is.

This fixes an intermittent NULL dereference during abort.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315868 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agorevert r315841, MFC of r315083: not applicable to this branch
avg [Thu, 23 Mar 2017 10:22:06 +0000 (10:22 +0000)]
revert r315841, MFC of r315083: not applicable to this branch

And it broke the build too.

Reported by: lwhsu

git-svn-id: svn://svn.freebsd.org/base/stable/10@315854 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315076: zfs: provide a special vptocnp method for the .zfs vnode
avg [Thu, 23 Mar 2017 08:22:11 +0000 (08:22 +0000)]
MFC r315076: zfs: provide a special vptocnp method for the .zfs vnode

git-svn-id: svn://svn.freebsd.org/base/stable/10@315848 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoadd UPDATING entry for r315844, MFC of re-worked .zfs code
avg [Thu, 23 Mar 2017 08:19:51 +0000 (08:19 +0000)]
add UPDATING entry for r315844, MFC of re-worked .zfs code

git-svn-id: svn://svn.freebsd.org/base/stable/10@315847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314048,r314194: reimplement zfsctl (.zfs) support
avg [Thu, 23 Mar 2017 08:16:29 +0000 (08:16 +0000)]
MFC r314048,r314194: reimplement zfsctl (.zfs) support

git-svn-id: svn://svn.freebsd.org/base/stable/10@315844 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315083: aacraid: fix build with AACRAID_DEBUG=2
avg [Thu, 23 Mar 2017 08:10:42 +0000 (08:10 +0000)]
MFC r315083: aacraid: fix build with AACRAID_DEBUG=2

git-svn-id: svn://svn.freebsd.org/base/stable/10@315841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315075: trace thread running state when a thread is run for the first time
avg [Thu, 23 Mar 2017 08:08:39 +0000 (08:08 +0000)]
MFC r315075: trace thread running state when a thread is run for the first time

git-svn-id: svn://svn.freebsd.org/base/stable/10@315839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315074: actually implement proc:::lwp-exit probe
avg [Thu, 23 Mar 2017 08:02:29 +0000 (08:02 +0000)]
MFC r315074: actually implement proc:::lwp-exit probe

git-svn-id: svn://svn.freebsd.org/base/stable/10@315837 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314913: MFV r314911: 7867 ARC space accounting leak
avg [Thu, 23 Mar 2017 08:00:45 +0000 (08:00 +0000)]
MFC r314913: MFV r314911: 7867 ARC space accounting leak

git-svn-id: svn://svn.freebsd.org/base/stable/10@315835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314912: MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones
avg [Thu, 23 Mar 2017 07:57:42 +0000 (07:57 +0000)]
MFC r314912: MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones

git-svn-id: svn://svn.freebsd.org/base/stable/10@315833 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314864: firewire/sbp: try to improve locking, plus a few style nits
avg [Thu, 23 Mar 2017 07:56:13 +0000 (07:56 +0000)]
MFC r314864: firewire/sbp: try to improve locking, plus a few style nits

git-svn-id: svn://svn.freebsd.org/base/stable/10@315831 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315067: Partially fix target task management requests handling.
mav [Thu, 23 Mar 2017 06:55:32 +0000 (06:55 +0000)]
MFC r315067: Partially fix target task management requests handling.

 - XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests.
 - XPT_ABORT was not even trying to abort active ATIOs/INOTs.
 - Initiator's tag was not stored and not used where needed.
 - List of TM request types needed update.
 - mpt_scsi_tgt_status() missed some useful debugging.

After this change global TM requests, such as reset, should work properly.
ABORT TASK (ABTS) requests are still not passes to CTL, that is not good
and should be fixed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315828 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315004: Add PIM_EXTLUNS support to mpt(4).
mav [Thu, 23 Mar 2017 06:52:29 +0000 (06:52 +0000)]
MFC r315004: Add PIM_EXTLUNS support to mpt(4).

Target mode is still limited to 256 LUNs due to the way driver is written,
but initiator can now use full 8 byte LUN space.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315002: Improve residuals reporting in target mode.
mav [Thu, 23 Mar 2017 06:50:46 +0000 (06:50 +0000)]
MFC r315002: Improve residuals reporting in target mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315824 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.
mav [Thu, 23 Mar 2017 06:49:01 +0000 (06:49 +0000)]
MFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.

 - Not set BufferLength caused receive of empty ATIOs.
 - CDB length guessing was broken at least for RC16.
 - mpt_req_untimeout() was called with wrong req parameter.
 - Sense data reporting was broken in several ways.

With this change my LSI7204EP-LC can pass at least basic tests as target.
The code is still far from perfect, but finally I found second hw/driver
after isp(4) that really can work in CAM target mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315821 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode.
mav [Thu, 23 Mar 2017 06:47:48 +0000 (06:47 +0000)]
MFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315819 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314968: Report some more data in XPT_PATH_INQ.
mav [Thu, 23 Mar 2017 06:45:57 +0000 (06:45 +0000)]
MFC r314968: Report some more data in XPT_PATH_INQ.

I am not sure they are used anywhere, but why not.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315817 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314966: Report FC link speed.
mav [Thu, 23 Mar 2017 06:42:27 +0000 (06:42 +0000)]
MFC r314966: Report FC link speed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315815 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311305 (by asomers):
mav [Thu, 23 Mar 2017 06:41:13 +0000 (06:41 +0000)]
MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:             215474
Reported by:    Coverity
CID:            1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:            1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:            1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:            1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:            1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:            1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:            1010035 1010036 1010042 1010041 1010040 1010039

git-svn-id: svn://svn.freebsd.org/base/stable/10@315813 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r308423 (by scottl):
mav [Thu, 23 Mar 2017 06:37:23 +0000 (06:37 +0000)]
MFC r308423 (by scottl):
Fix the fallout from r308268 (mpt driver causes endless witness warnings in
VMWare and elsewhere) with the precision of a dull, rusty butter knife.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315811 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303874 (by trasz):
mav [Thu, 23 Mar 2017 06:34:45 +0000 (06:34 +0000)]
MFC r303874 (by trasz):
Remove NULL check after M_WAITOK allocation from mpt(4).

git-svn-id: svn://svn.freebsd.org/base/stable/10@315809 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314952: Fix unused variable when built without INVARIANT_SUPPORT.
mav [Thu, 23 Mar 2017 06:29:47 +0000 (06:29 +0000)]
MFC r314952: Fix unused variable when built without INVARIANT_SUPPORT.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315806 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315360:
ngie [Thu, 23 Mar 2017 04:54:31 +0000 (04:54 +0000)]
MFC r315360:

Return NULL instead of 0 on failure in _kvm_open, kvm_open{,2,files}

This is being done for the following reasons:
- kvm_open(3), etc says they will return NULL.
- NULL by definition is (void*)0 per POSIX, but can be redefined,
  depending on the compiler, etc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315363,r315365:
ngie [Thu, 23 Mar 2017 04:50:50 +0000 (04:50 +0000)]
MFC r315363,r315365:

r315363:

Fix manlint errors

- Add missing comma after kvm_dpcpu_setcpu .Nm macro use (multiple
  .Nm entries should be separated by commas)
- Add missing section for kvm_dpcpu_setcpu Xr.

r315365:

Tweak r315363 slightly

I noticed after commit that kvm_dpcpu_setcpu was defined in the manpage.
Thus, the correct macro for the function reference is .Fn, not .Xr.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315786 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315654:
ngie [Thu, 23 Mar 2017 04:47:43 +0000 (04:47 +0000)]
MFC r315654:

Fix linking /rescue/rescue to multiple programs in usr.bin after r315113

I meant for the line that conditionally added in /usr/bin/nc support to
be `+=', not `=`. This restores hardlinks for all programs in usr.bin
specified before nc(1), e.g., bunzip2 and tar.

Pointyhat to: ngie

git-svn-id: svn://svn.freebsd.org/base/stable/10@315781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314709,r314790,r314794:
bdrewery [Wed, 22 Mar 2017 18:35:48 +0000 (18:35 +0000)]
MFC r314709,r314790,r314794:

  r314709:
    Fix bootstrapping mtree after r313404 for older systems.
  r314790:
    Added comments for why nmtree/libmd are bootstrapped.
  r314794:
    Fix bootstrapping libmd on older systems after r314709.

PR: 217673

git-svn-id: svn://svn.freebsd.org/base/stable/10@315731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoBump __FreeBSD_version for libmd changes in r314143.
bdrewery [Wed, 22 Mar 2017 18:33:50 +0000 (18:33 +0000)]
Bump __FreeBSD_version for libmd changes in r314143.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314714:
bdrewery [Wed, 22 Mar 2017 17:49:56 +0000 (17:49 +0000)]
MFC r314714:

  Don't kill pid -1 on overflow from strtol(3).

git-svn-id: svn://svn.freebsd.org/base/stable/10@315722 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314908: When chunking large DIOCGDELETE, do it on stripe edge.
mav [Wed, 22 Mar 2017 07:54:29 +0000 (07:54 +0000)]
MFC r314908: When chunking large DIOCGDELETE, do it on stripe edge.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315705 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315320:
ngie [Wed, 22 Mar 2017 01:11:13 +0000 (01:11 +0000)]
MFC r315320:

Start adding basic tests for cam(3)

This change contains several negative and positive tests for:
- cam_open_device
- cam_close_device
- cam_getccb
- cam_freeccb

This also contains a test for the failure case noted in bug 217649,
i.e., O_RDWR must be specified because pass(4) requires it.

This test unfortunately cannot assume that cam-capable devices are
present, so the user must explicitly provide a device via
`test_suites.FreeBSD.cam_test_device`. In the future, a test kernel
module might be shipped, or ctl(4) might be used, as a test device
when testing out libcam, which will allow the tests to do away with
having to specify an explicit test device.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315696 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314840:
royger [Tue, 21 Mar 2017 09:38:59 +0000 (09:38 +0000)]
MFC r314840:

xen: add support for canceled suspend

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger

git-svn-id: svn://svn.freebsd.org/base/stable/10@315676 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314841:
royger [Tue, 21 Mar 2017 09:27:24 +0000 (09:27 +0000)]
MFC r314841:

xenstore: fix suspension when using the xenstore device

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger

git-svn-id: svn://svn.freebsd.org/base/stable/10@315675 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314241,r315228:
ngie [Tue, 21 Mar 2017 05:15:10 +0000 (05:15 +0000)]
MFC r314241,r315228:

r314241:

Fill in MK_RESCUE by finding paths in ${DESTDIR}/rescue and adding
them to OLD_FILES/OLD_DIRS, as necessary.

r315228:

Redirect standard error from find /rescue to /dev/null

This mutes noise from find when /rescue doesn't exist.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315510
vangyzen [Tue, 21 Mar 2017 01:24:56 +0000 (01:24 +0000)]
MFC r315510

nanosleep: plug a kernel memory disclosure

nanosleep() updates rmtp on EINVAL.  In that case, kern_nanosleep()
has not updated rmt, so sys_nanosleep() updates the user-space rmtp
by copying garbage from its stack frame.  This is not only a kernel
memory disclosure, it's also not POSIX-compliant.  Fix it to update
rmtp only on EINTR.

Security: possibly
Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315192:
ae [Mon, 20 Mar 2017 08:16:05 +0000 (08:16 +0000)]
MFC r315192:
  Ignore ifnet renaming in the bpf ifnet departure handler.

  PR: 213015

git-svn-id: svn://svn.freebsd.org/base/stable/10@315625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315206:
ngie [Mon, 20 Mar 2017 03:13:03 +0000 (03:13 +0000)]
MFC r315206:

bsnmpd: fix segfault when trans_insert_port(..) is called with multiple
out of order addresses

Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.

PR: 217760

git-svn-id: svn://svn.freebsd.org/base/stable/10@315612 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315199,r315200,r315203:
ngie [Mon, 20 Mar 2017 03:06:41 +0000 (03:06 +0000)]
MFC r315199,r315200,r315203:

r315199:

sbin/dhclient: fix a memory leak in parse_client_lease_statement(..)

The memory stored by `lease` would have previously been leaked if an
unterminated lease declaration was found in an early-return code path.

CID: 1007114

r315200:

Fix -Wunused-but-set-warning with `ret`

While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

Tested with: clang, gcc 4.2.1, gcc 6.3.0

r315203:

sbin/dhclient: fix `vendor` storage leak in parse_option_decl(..)

This ensures the storage isn't leaked when non-NULL and the function
returns early, prior to the `free(vendor)` later on in the function.

CID: 1007111-1007113

git-svn-id: svn://svn.freebsd.org/base/stable/10@315610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315202:
ngie [Mon, 20 Mar 2017 03:01:23 +0000 (03:01 +0000)]
MFC r315202:

lib/libcam/cam_cdbparse.3: fix manpage warnings

- Add comma before and after 'e.g.'; remove surrounding parentheses
  that were unnecessary after this change [1].
- Add .Mt when referencing ken and Peter Dufault's email addresses
  [2].
- Sprinkle around .An use where proper [2].

Bump .Dd for the change

git-svn-id: svn://svn.freebsd.org/base/stable/10@315608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315132,r315133,r315186:
ngie [Mon, 20 Mar 2017 03:00:22 +0000 (03:00 +0000)]
MFC r315132,r315133,r315186:

r315132:

Use .Dv when referencing NULL

This is the correct markup macro, as opposed to .Va (variable names)

While here, annotate several bare references to `NULL` with .Dv.

r315133:

lib/libcam/cam.3: fix manpage warnings

- spelling: "mis-named" should be "misnamed".
- delete spaces interspersed in literal representation of
  `struct cam_device` as hard-tabs separate the types and fields.
- Add commas after `e.g.`.

r315186:

lib/libcam/cam.3: note that cam_freeccb(3) with ccb == NULL is a no-op

This allows me to accurately test this scenario, and for others to rely
on the behavior, instead of relying on knowledge obtained via code
inspection.

Wording borrowed from free(3).

Requested by: ken (D9928)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315212, r315213, r315214, r315215:
pfg [Mon, 20 Mar 2017 00:55:24 +0000 (00:55 +0000)]
MFC r315212, r315213, r315214, r315215:
mkimg(1): let calloc(3) do the multiplication.
nscd(8): let calloc(3) do the multiplying.
mpsutil(8): let calloc(3) do the multiplying.
ypbind(8): let calloc(3) do the multiplying.

MFC after: 1 week

git-svn-id: svn://svn.freebsd.org/base/stable/10@315600 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311601:
ngie [Sun, 19 Mar 2017 22:14:22 +0000 (22:14 +0000)]
MFC r311601:

Move the mibII module up so uncommenting the bridge module works

Add a note about how module ordering and dependent modules

git-svn-id: svn://svn.freebsd.org/base/stable/10@315593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315426, MFV r315425:
pfg [Sun, 19 Mar 2017 20:04:57 +0000 (20:04 +0000)]
MFC r315426, MFV r315425:
one-true-awk: have calloc(3) do the multiplication.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315155:
kib [Sun, 19 Mar 2017 15:56:06 +0000 (15:56 +0000)]
MFC r315155:
Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

PR: 217435

git-svn-id: svn://svn.freebsd.org/base/stable/10@315562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314996:
mmokhi [Sat, 18 Mar 2017 12:39:24 +0000 (12:39 +0000)]
MFC r314996:
Fix NULL pointer dereference and panic with shm file pread/pwrite.

PR: 217429
Approved by: dchagin

git-svn-id: svn://svn.freebsd.org/base/stable/10@315481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Fix build breakage when only compiling ix(4)
erj [Fri, 17 Mar 2017 21:24:09 +0000 (21:24 +0000)]
ixgbe(4): Fix build breakage when only compiling ix(4)

PR: 217862
Reported by: lampa
Sponsored by: Intel Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/10@315463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 314382,314483-314485
sephe [Fri, 17 Mar 2017 03:03:58 +0000 (03:03 +0000)]
MFC 314382,314483-314485

314382
    hyperv/hn: Simplify RNDIS packet data offset calculation.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9699

314483
    hyperv/hn: Simplify RNDIS packet total length calculation.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9712

314484
    hyperv/hn: Make sure that RNDIS packet message is at least 4B aligned.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9713

314485
    hyperv/hn: Misaligned chimney sending buffers should not be used

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9714

git-svn-id: svn://svn.freebsd.org/base/stable/10@315437 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Fix VF build failure on i386 caused by r315333
erj [Thu, 16 Mar 2017 23:18:57 +0000 (23:18 +0000)]
ixgbe(4): Fix VF build failure on i386 caused by r315333

SYSCTL_ADD_UQUAD on i386 expects a uint64_t pointer, and not an
unsigned long pointer. So change the data type of the original variable to
u64 (uint64_t) from unsigned long, since the statistics are intended to be
64 bits, anyway.

Reported by: Peter Jeremy (peter@rulingia.com)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315434 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314571:
mm [Thu, 16 Mar 2017 23:08:18 +0000 (23:08 +0000)]
MFC r314571:
Update libarchive to version 3.3.1 (and sync with latest vendor dist)

Notable vendor changes:
  PR #501: improvements in ACL path handling
  PR #724: fix hang when reading malformed cpio files
  PR #864: fix out of bounds read with malformed GNU tar archives
  Documentation, style, test suite improvements and typo fixes.

New options to bsdtar that enable or disable reading and/or writing of:
  Access Control Lists (--acls, --no-acls)
  Extended file flags (--fflags, --no-fflags)
  Extended attributes (--xattrs, --no-xattrs)
  Mac OS X metadata (Mac OS X only) (--mac-metadata, --no-mac-metadata)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315433 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314918, r314919:
ian [Thu, 16 Mar 2017 15:43:32 +0000 (15:43 +0000)]
MFC r314918, r314919:

  Add the pnp id for a Wacom 'WACF00e' tablet.

  Update the comment for the Wacom WACF00e to make it clear it's not an
  accidental duplicate of WACF004.

PR:           217306

git-svn-id: svn://svn.freebsd.org/base/stable/10@315417 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315187:
pfg [Thu, 16 Mar 2017 15:10:04 +0000 (15:10 +0000)]
MFC r315187:
libc: mall cleanup.

Let calloc(3) do the multiplication.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315415 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314549: Execute last ZIO of log commit synchronously.
mav [Thu, 16 Mar 2017 07:11:35 +0000 (07:11 +0000)]
MFC r314549: Execute last ZIO of log commit synchronously.

For short transactions overhead of context switch can be too large.
Skipping it gives significant latency reduction.  For large ones,
including multiple ZIOs, latency is less critical, while throughput
there may become limited by checksumming speed of single CPU core.
To get best of both cases, execute last ZIO directly from calling
thread context to save latency, while all others (if there are any)
enqueue to taskqueues in traditional way.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315388 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314548: Completely skip cache flushing for not supporting log devices.
mav [Thu, 16 Mar 2017 07:09:47 +0000 (07:09 +0000)]
MFC r314548: Completely skip cache flushing for not supporting log devices.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314954:
ngie [Thu, 16 Mar 2017 02:04:16 +0000 (02:04 +0000)]
MFC r314954:

style(9): sort the #includes

git-svn-id: svn://svn.freebsd.org/base/stable/10@315358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315113:
ngie [Thu, 16 Mar 2017 02:02:33 +0000 (02:02 +0000)]
MFC r315113:

Conditionally compile [additional] programs into rescue(8) if requested

Trivial oversight missed in r314240 cleanup because I enable these knobs on
my test machines.

MK_INET6_SUPPORT - rtsol
MK_NETCAT - nc

git-svn-id: svn://svn.freebsd.org/base/stable/10@315356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314924:
ngie [Thu, 16 Mar 2017 01:59:43 +0000 (01:59 +0000)]
MFC r314924:

sbin/devfs: clarify usage

- Note existence of -m option.
- Note that -s applies to rule keyword, only, by adding usage text
  specifically for the `rule` and `ruleset` keywords.

Don't go into any further detail in usage(..) -- it's best that one
reads the manpage to get a better idea of how things work as there are
a number of different option-specific keywords and arguments, as well
as some rule grammar.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315355 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315111:
ngie [Thu, 16 Mar 2017 01:58:09 +0000 (01:58 +0000)]
MFC r315111:

Remove /rescue/iscsictl and /rescue/iscsid if MK_ISCSI == no

git-svn-id: svn://svn.freebsd.org/base/stable/10@315353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315114:
ngie [Thu, 16 Mar 2017 01:56:19 +0000 (01:56 +0000)]
MFC r315114:

Remove /rescue/zdb if MK_ZFS == no

Missed in r202452.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314895:
ngie [Thu, 16 Mar 2017 01:50:11 +0000 (01:50 +0000)]
MFC r314895:

Only install 900.tcpwrap if MK_INETD != "no" and MK_TCP_WRAPPERS != "no"

It relies on output from inetd that is triggered by MK_TCP_WRAPPERS=yes.

We need to check for both knobs being set -- otherwise the script doesn't
have much value.

PR: 217577

git-svn-id: svn://svn.freebsd.org/base/stable/10@315348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r274130:
ngie [Thu, 16 Mar 2017 01:47:26 +0000 (01:47 +0000)]
MFC r274130:
r274130 (by bapt):

Avoid installing security.functions with executable bits, periodic(8) will
try to execute all files with an executable bit in /etc/periodic/*/ while
this file is supposed only to be sourced by others

git-svn-id: svn://svn.freebsd.org/base/stable/10@315346 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313733:
badger [Thu, 16 Mar 2017 01:41:36 +0000 (01:41 +0000)]
MFC r313733:

sleepq_catch_signals: do thread suspension before signal check

Since locks are dropped when a thread suspends, it's possible for another
thread to deliver a signal to the suspended thread. If the thread awakens from
suspension without checking for signals, it may go to sleep despite having
a pending signal that should wake it up. Therefore the suspension check is
done first, so any signals sent while suspended will be caught in the
subsequent signal check.

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315345 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f