]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r315640
vangyzen [Tue, 28 Mar 2017 13:39:04 +0000 (13:39 +0000)]
MFC r315640

Port the getaddrinfo(1) utility from NetBSD.

PR: 183148
Submitted by: Lohith Bellad <lohithbsd@gmail.com>
Obtained from: NetBSD
Relnotes: yes
Sponsored by: Dell EMC

7 years agoMFC r315242: Fix late and noauto with geli swap
amdmi3 [Tue, 28 Mar 2017 10:43:19 +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

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

7 years agoMFC r315273: Remove tangled isp_mbox_continue() mechanism.
mav [Tue, 28 Mar 2017 10:24:41 +0000 (10:24 +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.

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

7 years agoMFC r315234: Improvements around attach, reset and detach.
mav [Tue, 28 Mar 2017 10:11:00 +0000 (10:11 +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.

7 years agoMFC r313436,r313437,r313438,r314587,r315687:
ngie [Tue, 28 Mar 2017 06:13:21 +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

7 years agoMFC r315281:
kib [Tue, 28 Mar 2017 06:07:59 +0000 (06:07 +0000)]
MFC r315281:
Use atop() instead of OFF_TO_IDX() for convertion of addresses or
addresses offsets, as intended.

MFC r315580 (by alc):
Simplify the logic for clipping the range returned by the pager to fit
within the map entry.
Use atop() rather than OFF_TO_IDX() on addresses.

7 years agoMFC r315686,r315688:
ngie [Tue, 28 Mar 2017 06:03:43 +0000 (06:03 +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].

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

7 years agoMFC r315639:
ngie [Mon, 27 Mar 2017 18:31:00 +0000 (18:31 +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.

7 years agoMFC r314245:
ngie [Mon, 27 Mar 2017 18:28:15 +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)

7 years agoMFC r315641,r315642:
ngie [Mon, 27 Mar 2017 18:26:19 +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(..).

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

Delete trailing whitespace (no functional change)

7 years agoMFC r315595,r315601,r315603,r315647:
ngie [Mon, 27 Mar 2017 18:22:33 +0000 (18:22 +0000)]
MFC r315595,r315601,r315603,r315647:

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

r315601:

kvm_open2(3): remove '*' when describing addr argument for `resolver`

As noted by vangyzen, with a similar issue in D10022, the pointer portion of
the .Fa macro call is unnecessary, so remove the '*'.

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

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.

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

7 years agoMFC r315878:
kevlo [Mon, 27 Mar 2017 01:06:25 +0000 (01:06 +0000)]
MFC r315878:
Don't initialize if_output to ether_output(), ether_ifattach() does it for
us already.  While here, remove NOTYET code since if_watchdog is no longer
used.

Reviewed by: royger

7 years agoMFC 315529
kp [Sun, 26 Mar 2017 18:11:40 +0000 (18:11 +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

7 years agoMFC r314942:
bapt [Sun, 26 Mar 2017 18:08:55 +0000 (18:08 +0000)]
MFC r314942:

Import the awk(1) manpage from OpenBSD

As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which
is has been rewritten in mdoc(7) format making it readable by default with
mandoc, it also has been extended by OpenBSD to cover all awk(1) options

Obtained from: OpenBSD
MFC: 1 week

7 years agoMFC r314903:
bapt [Sun, 26 Mar 2017 18:07:59 +0000 (18:07 +0000)]
MFC r314903:

Remove reference to GNU info hier(7)
we have removed texinfo in FreeBSD 11.0

7 years agoMFC r314520:
bapt [Sun, 26 Mar 2017 18:06:22 +0000 (18:06 +0000)]
MFC r314520:

Import dma snapshot from git 2017-02-10

The only change is:
use basename to select executable identity

PR: 216910
Submitted by: Andrej Ebert <andrej@ebert.su>

7 years agoMFC r314902:
bapt [Sun, 26 Mar 2017 18:04:05 +0000 (18:04 +0000)]
MFC r314902:

texinfo is gone in r276551 remove the related directories

Reported by: jbeich

7 years agoMFC r315053-r315054, r315056
bapt [Sun, 26 Mar 2017 18:01:53 +0000 (18:01 +0000)]
MFC r315053-r315054, r315056

r315053:
Add share/man if it exists to the MANPATH

localbase is not consistent with base for manpages:
/usr/local/man vs /usr/share/man adding share/man allows to fix that
inconsistency and would permit to remove tons of patches/modifications in the
ports tree

r315054:
Extend functionality MANPATH in man(1) to followup with apropos(1) from
mandoc.

If MANPATH begins with a colon, it is appended to the default list; if it ends
with a colon, it is prepended to the default list; or if it contains two
adjacent colons, the standard search path is inserted between the colons.  If
none of these conditions are met, it overrides the standard search path.

Import the MANPATH description from mandoc into the man(1) man page

Reported by: kargl
MFC after: 1 week

r315056:
Remove the warning when MANPATH is set in the environment

The MANPATH environment variable behaviour is documented properly in the manpage
and it now has extended to new feature that allows to make MANPATH env variable
extending the default search path rather than overwriting it making the warning
painful

Reported by: kargl
MFC after: 1 week

7 years agoMFC r315571:
bapt [Sun, 26 Mar 2017 17:46:42 +0000 (17:46 +0000)]
MFC r315571:

Canada adheres to ISO 8601, let's make the locale reflecting that fact

PR: 200079
MFC after: 1 week
Submitted by: Dan McGregor <dan.mcgregor@usask.ca>
Reported by: A.J. Kehoe IV (Nanoman) <freebsd-bugs@nanoman.ca>
Differential Revision: https://reviews.freebsd.org/D9925

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

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

7 years agoMFC r315163: Remove strange config_intrhook_establish() magic.
mav [Sun, 26 Mar 2017 08:50:50 +0000 (08:50 +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.

7 years agoMFC r315552:
kib [Sun, 26 Mar 2017 00:59:15 +0000 (00:59 +0000)]
MFC r315552:
Fix off-by-one in the vm_fault_populate() code.

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

7 years agoMFC r315586:
kib [Sun, 26 Mar 2017 00:53:34 +0000 (00:53 +0000)]
MFC r315586:
Style.

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

7 years agoMFC r315499:
dchagin [Sat, 25 Mar 2017 14:28:20 +0000 (14:28 +0000)]
MFC r315499:

Remove superflous break statment.

7 years agoMFC r315503:
dchagin [Sat, 25 Mar 2017 14:26:45 +0000 (14:26 +0000)]
MFC r315503:

As noted by Roel Bouwman Linux allows a large buffer size than the
struct ucred size. Fix this.

PR:           102956

7 years agoMFC r315278:
dchagin [Sat, 25 Mar 2017 14:25:20 +0000 (14:25 +0000)]
MFC r315278:

Fix usage of the same 'i' variable in the external and nested loops.

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

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

7 years agoMFC r315689:
dim [Sat, 25 Mar 2017 12:21:20 +0000 (12:21 +0000)]
MFC r315689:

Gcc has incompatible internal declarations for __divtc3 and __multc3 as
defined in compiler-rt, but it has no option to silence its warning, so
make gcc warnings for libcompiler_rt non-fatal.

Noticed by: lwhsu

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

7 years agoMFC r315084: Increase device openings to tagged maximum.
mav [Sat, 25 Mar 2017 11:44:34 +0000 (11:44 +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.

7 years agoMFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
mav [Sat, 25 Mar 2017 11:35:31 +0000 (11:35 +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.

7 years agoMFC r315716
grehan [Sat, 25 Mar 2017 05:41:34 +0000 (05:41 +0000)]
MFC r315716
  Bring the handling of the y axis in the ums driver in-line with the other
  axes.

  No functional change.

7 years agoMFC r315715 Fix a type in bhyve's USB mouse emulation.
grehan [Sat, 25 Mar 2017 05:21:49 +0000 (05:21 +0000)]
MFC r315715  Fix a type in bhyve's USB mouse emulation.

7 years agoMFC r315361 and r315364: Hide MONITORX/MWAITX from guests.
grehan [Sat, 25 Mar 2017 05:05:12 +0000 (05:05 +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).

7 years agoMFC r315694
vangyzen [Sat, 25 Mar 2017 00:52:33 +0000 (00:52 +0000)]
MFC r315694

clock_gettime.2: add some clock IDs

Add the CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clock_id
values to the clock_gettime(2) man page.  Reformat the excessively
long paragraph (sentence!) into a tag list.

Sponsored by: Dell EMC

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

PR: 216172

7 years agoMFH (r313974,r314596): open .netrc early in case we want to drop privs
des [Fri, 24 Mar 2017 14:19:52 +0000 (14:19 +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

7 years agoMFC r305383:
mjg [Fri, 24 Mar 2017 08:06:00 +0000 (08:06 +0000)]
MFC r305383:

fd: fix up fdeget_file

It was supposed to return NULL if a fp is not installed.

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

7 years agoMFC r315022: Request change of SIM target role only when it is different.
mav [Fri, 24 Mar 2017 07:02:51 +0000 (07:02 +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.

7 years agoMFC r315030: Abort all ATIOs and INOTs queued to SIM on LUN disable.
mav [Fri, 24 Mar 2017 07:01:31 +0000 (07:01 +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.

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

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

7 years agoMFC r314365
davidcs [Fri, 24 Mar 2017 02:58:20 +0000 (02:58 +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

7 years agoMFC r312932,r312933,r312949,r313141
mjg [Thu, 23 Mar 2017 22:22:24 +0000 (22:22 +0000)]
MFC r312932,r312933,r312949,r313141

(by cognet)

Use strexeq instead of needlessly branch.

==

(by cognet)

Remove useless labels.

==

(by cognet)

Correct the IT instruction in atomic_fcmpset_64().

==

(by andrew)

Only define atomic_fcmpset_long in the kernel. We may include
machine/atomic.h in userspace, however atomic_fcmpset_32 is unimplemented
there.

7 years agoMFC r314814 and r315325.
np [Thu, 23 Mar 2017 17:11:34 +0000 (17:11 +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.

7 years agoMFC r315423:
smh [Thu, 23 Mar 2017 10:43:29 +0000 (10:43 +0000)]
MFC r315423:

Fix libsysdecode vmprot flag decoding

Sponsored by: Multiplay

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

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

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

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

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

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

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

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

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

7 years agoMFC r315067: Partially fix target task management requests handling.
mav [Thu, 23 Mar 2017 06:53:31 +0000 (06:53 +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.

7 years agoMFC r315004: Add PIM_EXTLUNS support to mpt(4).
mav [Thu, 23 Mar 2017 06:51:53 +0000 (06:51 +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.

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

7 years agoMFC r315001: Fix panic on wildcard target LUN disable.
mav [Thu, 23 Mar 2017 06:49:36 +0000 (06:49 +0000)]
MFC r315001: Fix panic on wildcard target LUN disable.

7 years agoMFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.
mav [Thu, 23 Mar 2017 06:48:31 +0000 (06:48 +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.

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

7 years agoMFC r314968: Report some more data in XPT_PATH_INQ.
mav [Thu, 23 Mar 2017 06:45:11 +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.

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

7 years agoMFC r311305 (by asomers):
mav [Thu, 23 Mar 2017 06:40:20 +0000 (06:40 +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

7 years agoMFC r308423 (by scottl):
mav [Thu, 23 Mar 2017 06:36:55 +0000 (06:36 +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.

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

7 years agoMFC r314964: Decode modern PIM flags.
mav [Thu, 23 Mar 2017 06:31:03 +0000 (06:31 +0000)]
MFC r314964: Decode modern PIM flags.

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

7 years agoMFC r314892:
ngie [Thu, 23 Mar 2017 05:32:02 +0000 (05:32 +0000)]
MFC r314892:
r314892 (by cy):

Fix install due to incorrect placement of pwait dir in r314886.

7 years agoMFC r315360:
ngie [Thu, 23 Mar 2017 04:50:44 +0000 (04:50 +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.

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

r315362:

Capitalize .Dt macro argument

By convention, per mdoc(7), the document title should be all caps.

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.

7 years agoMFC r315654:
ngie [Thu, 23 Mar 2017 04:47:57 +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

7 years agoMFC r315720 (from cem@)
pfg [Wed, 22 Mar 2017 18:12:48 +0000 (18:12 +0000)]
MFC r315720 (from cem@)
scandir: Fix NULL dereference, uninitialized value use in error case

This bug was introduced in r315095. Given that it obviously is a bug and
we can't afford to have such creatures in libc, do an early merge,

Reported by: Coverity
CIDs: 13295661372625
Sponsored by: Dell EMC Isilon

7 years agoMFC r314709,r314790,r314794:
bdrewery [Wed, 22 Mar 2017 17:56:46 +0000 (17:56 +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

7 years agoMFC r314886,r314943,r314944:
bdrewery [Wed, 22 Mar 2017 17:53:25 +0000 (17:53 +0000)]
MFC r314886,r314943,r314944:

  r314886:
    pwait: Add a -t flag to specify a timeout before exiting, and tests.
  r314943:
    Remove unneeded -x from tests.
  r314944:
    Rename some tests to end in _test.

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

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

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

7 years agoMFC r314906: Add initial support for UNMAP granularity.
mav [Wed, 22 Mar 2017 07:52:25 +0000 (07:52 +0000)]
MFC r314906: Add initial support for UNMAP granularity.

Report UNMAP granularity as stripesize/-offset if we have no other values
to report there.

Add new quirk DA_Q_STRICT_UNMAP for cases when target is too critical to
misaligned UNMAP request, reporting errors instead of being suboptimal.
Setting this quirk makes da periph to forcefully align all UNMAP requests
to avoid those errors by the cost of some odd ranges not being UNMAP'ed.
This makes UNMAP usable within VMware 6.x VMs, just now 100% efficient.

7 years agoPull in r283944 from upstream libc++ trunk (by Eric Fiselier):
dim [Wed, 22 Mar 2017 07:09:30 +0000 (07:09 +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/11,
without further hacks.  Direct commit to stable/11, since head already
has libc++ 4.0, which includes this fix.

Reported by: cpm

7 years agoMFC r315320:
ngie [Wed, 22 Mar 2017 01:04:20 +0000 (01:04 +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.

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

xen: add support for canceled suspend

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

7 years agoMFC r314841:
royger [Tue, 21 Mar 2017 08:36:25 +0000 (08:36 +0000)]
MFC r314841:

xenstore: fix suspension when using the xenstore device

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

7 years agoMFC r314094:
royger [Tue, 21 Mar 2017 08:34:41 +0000 (08:34 +0000)]
MFC r314094:

xen/timer: mark the Xen PV timer as not safe for suspension

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

7 years agoMFC r314842:
royger [Tue, 21 Mar 2017 08:30:06 +0000 (08:30 +0000)]
MFC r314842:

xen/netfront: fix inbound packet flags for checksum offload

Reviewed by:          Wei Liu <wei.liu2@citrix.com>
Sponsored by:         Citrix Systems R&D

7 years agoMFC r314241,r315228:
ngie [Tue, 21 Mar 2017 05:13:14 +0000 (05:13 +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.

7 years agoMFC r314877:
pfg [Tue, 21 Mar 2017 03:42:28 +0000 (03:42 +0000)]
MFC r314877:
lpr(1): small bounds check with reallocarray(3).

While here plug a memory leak upon error and postpose the multiplication
until after reallocation has succeded.

Hinted partially by: OpenBSD
Reviewed by: gad

7 years agoMFC r315510
vangyzen [Tue, 21 Mar 2017 01:23:34 +0000 (01:23 +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

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

  PR: 213015

7 years agoMFC r315206:
ngie [Mon, 20 Mar 2017 03:13:00 +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

7 years agoMFC r315199,r315200,r315203:
ngie [Mon, 20 Mar 2017 03:06:37 +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

7 years agoMFC r315202:
ngie [Mon, 20 Mar 2017 03:01:21 +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