]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r302857:
jamie [Sun, 17 Jul 2016 14:16:21 +0000 (14:16 +0000)]
MFC r302857:

  Start jails non-parallel if jail_parallel_start is NO.  This was true
  for an explicitly specified jail list; now it's also true for all jails.

PR: 209112

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

7 years agoMFC r302856:
jamie [Sun, 17 Jul 2016 14:15:08 +0000 (14:15 +0000)]
MFC r302856:

    Fix up the order in which jail creation processes are run, to preserve
    the config file's order in the non-parallel-start case.

PR: 209112

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

7 years agoMFC r302855:
jamie [Sun, 17 Jul 2016 14:12:34 +0000 (14:12 +0000)]
MFC r302855:

    Wait for jails to complete startup if jail_parallel_start is YES,
    instead of assuming they'll take less than one second.

PR: 203172
Submitted by: dmitry2004@yandex.ru

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

7 years agoMFH r301732, r302288
cperciva [Sat, 16 Jul 2016 08:17:14 +0000 (08:17 +0000)]
MFH r301732, r302288

Updates to EC2 loader.conf:
* Use console=comconsole (r301732) since EC2 now has a "VGA" console;
* Enable blkif indirect segment I/O (r302288) since EC2 now consistently
  gets better disk performance with this option enabled.

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

7 years agoMFC r301877:
markj [Sat, 16 Jul 2016 02:57:37 +0000 (02:57 +0000)]
MFC r301877:
Add a missing error check for a malloc() call in idr_get().

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

7 years agoMFC r302346:
markj [Sat, 16 Jul 2016 02:55:02 +0000 (02:55 +0000)]
MFC r302346:
Ensure that spinlock sections are balanced even after a panic.

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

7 years agoMFC r301090:
markj [Sat, 16 Jul 2016 02:53:52 +0000 (02:53 +0000)]
MFC r301090:
mkimg: Indicate that input file pages are unlikely to be reused.

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

7 years agoMFC r301212:
markj [Sat, 16 Jul 2016 02:49:02 +0000 (02:49 +0000)]
MFC r301212:
Reset the page busy lock state after failing to insert into the object.

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

7 years agoMFC r301210:
markj [Sat, 16 Jul 2016 02:47:56 +0000 (02:47 +0000)]
MFC r301210:
Don't preserve the page's object linkage in vm_page_insert_after().

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

7 years agoMFC r302507:
markj [Fri, 15 Jul 2016 19:10:32 +0000 (19:10 +0000)]
MFC r302507:
Avoid truncating the return value of DTrace predicates.

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

7 years agoMFC r297187
sbruno [Fri, 15 Jul 2016 15:30:09 +0000 (15:30 +0000)]
MFC r297187

Support checksum offloading for TCP/IPV6 and UDP/IPV6.
Support SCTP checksum offloading for SCTP/IPV6.
Support SCTP checksum offloading on all controllers except 82575.

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

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

7 years agoMFC 302541,302605
sephe [Fri, 15 Jul 2016 02:29:10 +0000 (02:29 +0000)]
MFC 302541,302605

302541
    hyperv/stor: Fix the INQUIRY checks

    Don't check the area that the host has not filled.

    PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209443
    PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210425
    Submitted by:       Hongjiang Zhang <honzhan microsoft com>
    Reviewed by:        sephe, Dexuan Cui <decui microsoft com>
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6955

302605
    hyperv/stor: Save the response status and xfer length properly.

    The current command response handling discards status and xfer
    length unconditionally, so that all of the commands would be
    considered successful, even if errors happened.  When errors
    really happens, this causes all kinds of wiredness, since the
    buffer will not be filled on the host side and sense data will
    be ignored.

    Most of the time, errors do not happen, however, error does
    happen for the request sent immediately after the disk resizing.
    Discarding the SCSI status (SCSI_STATUS_CHECK_COND) and sense
    data (capacity changes) prevents the disk resizing from working
    properly.

    This commit saves the response status and xfer length properly
    for later use.

    Submitted by:       Dexuan Cui <decui microsoft com>
    Noticed by: sephe
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D7181

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

7 years agoMFC changes relating to warnings in opensolaris-derived libraries
asomers [Thu, 14 Jul 2016 15:39:31 +0000 (15:39 +0000)]
MFC changes relating to warnings in opensolaris-derived libraries

MFC r257592
MFC r257657
MFC r257638
MFC r257647
MFC r302141

r257592 | sbruno | 2013-11-03 14:05:44 -0700 (Sun, 03 Nov 2013) | 8 lines

This library uses macros to define fprintf behvavior for several object
types The compiler will see the non-string literal arguments to the fprintf
calls and omit warnings for them. Quiese these warnings in contrib code:

cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format
  string is not a string literal (potentially insecure) [-Wformat-security]
  ARENDER(pctl, nvlist_array, nvl, name, val, nelem);

r257657 | sbruno | 2013-11-04 14:32:07 -0700 (Mon, 04 Nov 2013) | 5 lines

Quiesce warning assigning to void * from const ctf_header_t * by explicity
casting to void * before assignment.

Submitted as Illumos issue 4287

r257638 | sbruno | 2013-11-04 09:15:43 -0700 (Mon, 04 Nov 2013) | 6 lines

Quiesce warning regarding %llf which has no effect.

Submitted as illumos issue #4284

Reviewed by:    delphij

r257647 | sbruno | 2013-11-04 12:32:35 -0700 (Mon, 04 Nov 2013) | 4 lines

spelling in comments fixup

Submitted by:           Joerg Sonnenberger <joerg@britannica.bec.de>

r302141 | asomers | 2016-06-23 09:02:57 -0600 (Thu, 23 Jun 2016) | 14 lines

Raise the WARNS level in cddl/lib

cddl/lib/libavl/Makefile
cddl/lib/libctf/Makefile
cddl/lib/libnvpair/Makefile
cddl/lib/libumem/Makefile
cddl/lib/libuutil/Makefile
        Increase WARNS to the highest working level for each of these
        libraries

Sponsored by:   Spectra Logic Corp

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

7 years agoMFH: r297023
julian [Thu, 14 Jul 2016 04:30:42 +0000 (04:30 +0000)]
MFH: r297023

 Add the ability to print out the module specific information in likely formats.
Among other things this gives us the ability to find out the syscall number of a dynamically loaded syscall that has a dynamicly allocated vector number.

Sponsored by: Panzura inc.

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

7 years agoMFC r302402: Fix ahci(4) driver attach to controller with 32 ports.
mav [Thu, 14 Jul 2016 00:26:57 +0000 (00:26 +0000)]
MFC r302402: Fix ahci(4) driver attach to controller with 32 ports.

Incorrect sign expansion in variables that supposed to be a bit fields
caused infinite loop.  Fixing this allows system properly detect maximal
possible 32 devices configured on AHCI HBA of BHyVe.  That case did not
happen in a wild before due to lack of hardware AHCI HBAs with 32 ports.

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

7 years agoMFC r302476:
pfg [Wed, 13 Jul 2016 16:20:18 +0000 (16:20 +0000)]
MFC r302476:
ng_mppc(4): basic readability cleanups.

No functional change.

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

7 years agoMFC r300134: move zfsctl_freebsd_root_lookup right next to
avg [Wed, 13 Jul 2016 11:14:11 +0000 (11:14 +0000)]
MFC r300134: move zfsctl_freebsd_root_lookup right next to
zfsctl_root_lookup

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

7 years agoMFC r300130: zfsctl_freebsd_root_lookup: gfs_vop_lookup may return a
avg [Wed, 13 Jul 2016 11:06:37 +0000 (11:06 +0000)]
MFC r300130: zfsctl_freebsd_root_lookup: gfs_vop_lookup may return a
doomed vnode

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

7 years agoMFC r299951: do not destroy 'snapdir' when it becomes inactive
avg [Wed, 13 Jul 2016 11:04:02 +0000 (11:04 +0000)]
MFC r299951: do not destroy 'snapdir' when it becomes  inactive

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

7 years agoMFC r299949: try to recycle "snap" vnodes as soon as possible
avg [Wed, 13 Jul 2016 10:32:24 +0000 (10:32 +0000)]
MFC r299949: try to recycle "snap" vnodes as soon as possible

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

7 years agoMFC r299947: fix locking in zfsctl_root_lookup
avg [Wed, 13 Jul 2016 10:16:45 +0000 (10:16 +0000)]
MFC r299947: fix locking in zfsctl_root_lookup

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

7 years agoMFC r299946: gfs_lookup_dot() does not have to acquire any locks
avg [Wed, 13 Jul 2016 10:13:28 +0000 (10:13 +0000)]
MFC r299946: gfs_lookup_dot() does not have to acquire any locks

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

7 years agoMFC r299945: avoid deadlock between zfsctl_snapdir_lookup and
avg [Wed, 13 Jul 2016 10:11:48 +0000 (10:11 +0000)]
MFC r299945: avoid deadlock between zfsctl_snapdir_lookup and
zfsctl_snapshot_reclaim

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

7 years agoMFC r299940: fix a vnode reference leak caused by illumos compat traverse()
avg [Wed, 13 Jul 2016 10:10:05 +0000 (10:10 +0000)]
MFC r299940: fix a vnode reference leak caused by illumos compat traverse()

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

7 years agoMFC r299914: zfsctl_ops_snapshot: remove methods should never be called
avg [Wed, 13 Jul 2016 10:02:39 +0000 (10:02 +0000)]
MFC r299914: zfsctl_ops_snapshot: remove methods should never be called

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

7 years agoMFC r301273: zfs_root: fix a potential root vnode reference leak
avg [Wed, 13 Jul 2016 09:50:07 +0000 (09:50 +0000)]
MFC r301273: zfs_root: fix a potential root vnode reference leak

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

7 years agoMFC r299908,300131,301275: zfs: set VROOT / VV_ROOT consistently and in
avg [Wed, 13 Jul 2016 09:47:54 +0000 (09:47 +0000)]
MFC r299908,300131,301275: zfs: set VROOT / VV_ROOT consistently and in
a single place

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

7 years agoMFC r299902,299938: mount_snapshot: consolidate all error handling
avg [Wed, 13 Jul 2016 09:40:53 +0000 (09:40 +0000)]
MFC r299902,299938: mount_snapshot: consolidate all error handling

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

7 years agoMFC r299906,301870: add zfs_vptocnp with special handling for snapshots
avg [Wed, 13 Jul 2016 09:35:43 +0000 (09:35 +0000)]
MFC r299906,301870: add zfs_vptocnp with special handling for snapshots
under .zfs

Note that the changed is adjusted for the lack of LK_VNHELD in this
branch.

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

7 years agoMFC r300145: add vop_print methods to vnode operatios of various zfsctl
avg [Wed, 13 Jul 2016 09:26:33 +0000 (09:26 +0000)]
MFC r300145: add vop_print methods to vnode operatios of various zfsctl
node types

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

7 years agoMFC r301873: l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr
avg [Wed, 13 Jul 2016 09:23:02 +0000 (09:23 +0000)]
MFC r301873: l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr

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

7 years agoMFC r302123: fix deadlock-prone code in getzfsvfs()
avg [Wed, 13 Jul 2016 09:21:28 +0000 (09:21 +0000)]
MFC r302123: fix deadlock-prone code in getzfsvfs()

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

7 years agoMFC r299900: zfsctl: fix several problems with reference counts
avg [Wed, 13 Jul 2016 09:14:45 +0000 (09:14 +0000)]
MFC r299900: zfsctl: fix several problems with reference counts

PR: 207464

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

7 years agoMFC r298105: zfs: enable vn_io_fault support
avg [Wed, 13 Jul 2016 09:09:21 +0000 (09:09 +0000)]
MFC r298105: zfs: enable vn_io_fault support

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

7 years agoMFC r300133: zfsctl_common_fid: remove redundant assignment
avg [Wed, 13 Jul 2016 09:06:58 +0000 (09:06 +0000)]
MFC r300133: zfsctl_common_fid: remove redundant assignment

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

7 years agoMFC r300132: zfsctl: tighten assertion and remove unused definition
avg [Wed, 13 Jul 2016 09:05:14 +0000 (09:05 +0000)]
MFC r300132: zfsctl: tighten assertion and remove unused definition

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

7 years agoMFC r299913: dounmount: do not call mountcheckdirs() for mounts with MNT_IGNORE
avg [Wed, 13 Jul 2016 09:03:01 +0000 (09:03 +0000)]
MFC r299913: dounmount: do not call mountcheckdirs() for mounts with MNT_IGNORE

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

7 years agoMFC r302265, r302382
smh [Wed, 13 Jul 2016 08:33:57 +0000 (08:33 +0000)]
MFC r302265, r302382

Allow ZFS ARC min / max to be tuned at runtime

Relnotes: YES
Sponsored by: Multiplay

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

7 years agoMFC r302362,r302363,r302364,r302365,r302373:
ngie [Wed, 13 Jul 2016 06:09:34 +0000 (06:09 +0000)]
MFC r302362,r302363,r302364,r302365,r302373:

r302362:

Fix gcc warnings

- Remove -Wunused-but-set-variable (newcpu)
- Always return VMEXIT_CONTINUE as the code always set retval to that value.

r302363:

Fix gcc warnings

Put cfl/prdt under AHCI_DEBUG #defines as they are only used in
those cases.

r302364:

Fix gcc warnings

Add `WRAPPED_CTASSERT` macro by annotating CTASSERTs with __unused
to deal with -Wunused-local-typedefs warnings from gcc 4.8+.
All other compilers (clang, etc) use CTASSERT as-is. A more generic
solution for this issue will be proposed after ^/stable/11 is forked.

Consolidate all CTASSERTs under one block instead of inlining them in
functions.

r302365:

Fix gcc warnings

Remove -Wunused-but-set-variable (`error`). Cast calls with
`(void)` to note that the return value is explicitly ignored.

r302373:

Fix CTASSERT issue in a more clean way

- Replace all CTASSERT macro instances with static_assert's.
- Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation.
- Localize all static_assert's to the structures being tested.
- Sort some headers per-style(9).

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

7 years agoMFC r302206
asomers [Tue, 12 Jul 2016 22:53:11 +0000 (22:53 +0000)]
MFC r302206

Skip lastcomm and sa tests on unsupported architectures

usr.bin/lastcom/tests/Makefile
usr.sbin/sa/tests/Makefile
Set allow_architectures appropriately.  These tests depend on
golden files that must be generated for each architecture, and
haven't yet been generated for all of them.

PR: 204154

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

7 years agoMFC r302174
asomers [Tue, 12 Jul 2016 22:19:25 +0000 (22:19 +0000)]
MFC r302174

Fix "sysctl vm.vmtotal" output on machines with > 2TB virtual memory

sbin/sysctl/sysctl.c
        Fix integer overflows in printf format strings

PR: 199673

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

7 years agoMFC r302036
asomers [Tue, 12 Jul 2016 22:09:05 +0000 (22:09 +0000)]
MFC r302036

Skip sys/acl tests on systems lacking perl

tests/sys/acl/Makefile
        add perl to the required_programs for all tests in this directory

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

7 years agoMFC r301967
asomers [Tue, 12 Jul 2016 21:49:08 +0000 (21:49 +0000)]
MFC r301967

Fix usr.sbin/rpcbind ATF tests on 32-bit platforms

usr.sbin/rpcbind/tests/addrmerge_test.c
Fix some sizeof calculations that work only by luck on 64-bit
platforms.

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

7 years agoMFC r301874
asomers [Tue, 12 Jul 2016 21:41:27 +0000 (21:41 +0000)]
MFC r301874

Fix usr.sbin/extattr testcases on tmpfs

Skip the usr.sbin/extattr testscases if $TMPDIR is tmpfs, which doesn't
support extended attributes

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

7 years agoMFC r300356
asomers [Mon, 11 Jul 2016 23:15:54 +0000 (23:15 +0000)]
MFC r300356

Better document security_show_{success,info,badconfig} in /etc/periodic.conf

periodic(8) already handles the security_show_{success,info,badconfig}
variables correctly. However, those variables aren't explicitly set in
/etc/defaults/periodic.conf or anywhere else, which suggests to the user
that they shouldn't be used.

etc/defaults/periodic.conf
        Explicitly set defaults for security_show_{success,info,badconfig}

usr.sbin/periodic/periodic.sh
        Update usage string

usr.sbin/periodic/periodic.8
        Minor man page updates

One thing I'm _not_ doing is recommending setting security_output to
/var/log/security.log or adding that file to /etc/newsyslog.conf, because
periodic(8) would create it with default permissions, usually 644, and
that's probably a bad idea.

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

7 years agoMFC r302327:
ngie [Mon, 11 Jul 2016 17:31:30 +0000 (17:31 +0000)]
MFC r302327:

Fix .../usr.bin/lastcomm/legacy_test:main on i386

The time in the output files was ahead by 3 hours on i386. Fix the incorrect
offset.

PR: 210329

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

7 years agoMFC r302326:
ngie [Mon, 11 Jul 2016 17:30:20 +0000 (17:30 +0000)]
MFC r302326:

Output the diffs to standard error when comparing the expected vs the
obtained output from lastcomm instead of just printing out a summary, e.g.
"they differed".

This will make failures with results more apparent when running kyua debug,
kyua report-html, etc.

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

7 years agoMFC r302336:
hselasky [Mon, 11 Jul 2016 13:01:42 +0000 (13:01 +0000)]
MFC r302336:
Fix interrupt loop when switching from USB device to USB host mode by
clearing all endpoint interrupt bits.

PR: 210736

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

7 years agoMFC r302306:
hselasky [Mon, 11 Jul 2016 12:59:23 +0000 (12:59 +0000)]
MFC r302306:
Fix detection of USB device disconnects in USB host mode when the USB
device is connected directly to the USB port of the DWC OTG, in this
case a RPI-zero.

PR: 210695

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

7 years agoMFC r302221,302222:
delphij [Mon, 11 Jul 2016 07:35:58 +0000 (07:35 +0000)]
MFC r302221,302222:

MFV r302218: file 5.28.

Relnotes: yes

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

7 years agoMFC r302534:
delphij [Mon, 11 Jul 2016 04:11:33 +0000 (04:11 +0000)]
MFC r302534:

Allow - in distribution names.  This is needed for freebsd-update to work
with 11.0+, where the debugging symbols use a new naming scheme for release
distribution files.

Errata candidate.

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

7 years agoMFC r302236:
kib [Sun, 10 Jul 2016 04:33:16 +0000 (04:33 +0000)]
MFC r302236:
Handle the vm_fault() handler race with the vm_object_collapse()
sleepable scan.

MFC r302317:
Change type of the 'dead' variable to boolean.

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

7 years agoMFC r301871:
ngie [Fri, 8 Jul 2016 20:50:44 +0000 (20:50 +0000)]
MFC r301871:

Add missing break in lock_partialfilelock(..) with NFS_RESERR

This will help ensure that the right error is trickled up when the
function is called if the lock status is NFS_RESERR

Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php
CID: 10081611304956

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

7 years agoMFC r301605:
ngie [Fri, 8 Jul 2016 20:39:37 +0000 (20:39 +0000)]
MFC r301605:

Bounds check rpcbs_rmtcall(..) to ensure rtype is less than RPCBVERS_STAT

Not returning if rtype == RPCBVERS_STAT will cause us to overrun the inf array, as
it's defined to be exactly RPCBVERS_STAT elements in rpcb_prot.x:

> include/rpc/rpcb_prot.x:typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];

The proposed change also matches the rest of the rtype upper bound checks in the
file, so the original change was likely a typo.

CID: 1007567

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

7 years agoMFC r301800:
ngie [Fri, 8 Jul 2016 20:30:20 +0000 (20:30 +0000)]
MFC r301800:

Deobfuscate cleanup path in clnt_bck_create(..)

Similar to r300836, cl and ct will always be non-NULL as they're allocated
using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`.

Deobfuscating the cleanup path fixes a leak where if cl was NULL and
ct was not, ct would not be free'd, and also removes a duplicate test for
cl not being NULL.

CID: 1229999

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

7 years agoMFC r301749:
ngie [Fri, 8 Jul 2016 19:19:30 +0000 (19:19 +0000)]
MFC r301749:

Add debug output to aid in determining why `goodResult` != `result`

PR: 210619 (for diagnosis)

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

7 years agoMFC r301708:
ngie [Fri, 8 Jul 2016 19:13:18 +0000 (19:13 +0000)]
MFC r301708:

Revert r301707

getnetent_p doesn't return NULL like getnetent does. coccinelle got confused and
I didn't verify that it worked before committing the change

Pointyhat to: ngie

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

7 years agoMFC r301707:
ngie [Fri, 8 Jul 2016 19:04:51 +0000 (19:04 +0000)]
MFC r301707:

Use NULL instead of `0` in _ht_getnetbyname(..)

- getnetent returns NULL on completion/error.
- .h_aliases is NULL terminated.

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

7 years agoMFC r302294:
mm [Fri, 8 Jul 2016 10:06:02 +0000 (10:06 +0000)]
MFC r302294:

Sync libarchive with vendor, bugfixes for tests:
- fix tests on filesystems without birthtime support, e.g. UFS1 (1)
- vendor issue #729: avoid use of C99 for-scope declarations in
  test_write_format_gnutar_filenames.c

PR: 204157 (1)

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

7 years agoMFC r302338
truckman [Fri, 8 Jul 2016 02:52:39 +0000 (02:52 +0000)]
MFC r302338

Fix a race condition between the main thread in aqm_pie_cleanup() and the
callout thread that can cause a kernel panic.  Always do the final cleanup
in the callout thread by passing a separate callout function for that task
to callout_reset_sbt().

Protect the ref_count decrement in the callout with DN_BH_WLOCK().  All
other ref_count manipulation is protected with this lock.

There is still a tiny window between ref_count reaching zero and the end
of the callout function where it is unsafe to unload the module.  Fixing
this would require the use of callout_drain(), but this can't be done
because dummynet holds a mutex and callout_drain() might sleep.

Remove the callout_pending(), callout_active(), and callout_deactivate()
calls from calculate_drop_prob().  They are not needed because this callout
uses callout_init_mtx().

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
Differential Revision: https://reviews.freebsd.org/D6928

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

7 years agoMFC r302196
kib [Fri, 8 Jul 2016 02:34:04 +0000 (02:34 +0000)]
MFC r302196
Since VOP_INACTIVE() is not guaranteed to be called, all cleanups
executed by inactive methods, must be repeated on reclaim.

MFC r302210:
Clean other flags in ncl_inactive, only.

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

7 years agoMFC r302305: MFV r302260: expat 2.2.0.
delphij [Thu, 7 Jul 2016 04:59:58 +0000 (04:59 +0000)]
MFC r302305: MFV r302260: expat 2.2.0.

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

7 years agoMFC r302296:
cy [Thu, 7 Jul 2016 02:23:52 +0000 (02:23 +0000)]
MFC r302296:

Remove dead code.

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

7 years agoMFC r300547
truckman [Wed, 6 Jul 2016 17:45:38 +0000 (17:45 +0000)]
MFC r300547

Fix multiple Coverity Out-of-bounds access false postive issues in CAM

The currently used idiom for clearing the part of a ccb after its
header generates one or two Coverity errors for each time it is
used.  All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON)
error because of the treatment of the header as a two element array,
with a pointer to the non-existent second element being passed as
the starting address to bzero().  Some instances also alsp generate
Out-of-bounds access (OVERRUN) errors, probably because the space
being cleared is larger than the sizeofstruct ccb_hdr).

In addition, this idiom is difficult for humans to understand and
it is error prone.  The user has to chose the proper struct ccb_*
type (which does not appear in the surrounding code) for the sizeof()
in the length calculation.  I found several instances where the
length was incorrect, which could cause either an actual out of
bounds write, or incompletely clear the ccb.

A better way is to write the code to clear the ccb itself starting
at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate
the length based on the specific type of struct ccb_* being cleared
as specified by the union ccb member being used.  The latter can
normally be seen in the nearby code.  This is friendlier for Coverity
and other static analysis tools because they will see that the
intent is to clear the trailing part of the ccb.

Wrap all of the boilerplate code in a convenient macro that only
requires a pointer to the desired union ccb member (or a pointer
to the union ccb itself) as an argument.

Reported by: Coverity
CID: 100757810086841009724100977310113041011306
CID: 101130710113081011309101131010113111011312
CID: 101131310113141011315101131610113171011318
CID: 101131910113201011321101132210113241011325
CID: 101132610113271011328101132910113301011374
CID: 101139010113911011392101139310113941011395
CID: 101139610113971011398101139910114001011401
CID: 101140210114031011404101140510114061011408
CID: 101140910114101011411101141210114131011414
CID: 101746110183871086860108687411942571229897
CID: 122996813062291306234133128213312831331294
CID: 133129513315351331536133153913315401341623
CID: 13416241341637134163813552641355324
Reviewed by: scottl, ken, delphij, imp
MFH: 1 month
Differential Revision: https://reviews.freebsd.org/D6496

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

7 years agoMFC r299371 (by trasz)
truckman [Wed, 6 Jul 2016 17:42:09 +0000 (17:42 +0000)]
MFC r299371 (by trasz)

Add "camcontrol reprobe" subcommand, and implement it for da(4).
This makes it possible to manually force updating capacity data
after the disk got resized. Without it it might be neccessary to
reboot before FreeBSD notices updated disk size under eg VMWare.

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

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

7 years agoMFC r301007:
wblock [Mon, 4 Jul 2016 14:23:36 +0000 (14:23 +0000)]
MFC r301007:

Clarify the explanations for the hostname and FQDN entries.

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

7 years agoMFC r302151: posixshm: Fix lock leak when mac_posixshm_check_read rejects
jilles [Sun, 3 Jul 2016 11:45:54 +0000 (11:45 +0000)]
MFC r302151: posixshm: Fix lock leak when mac_posixshm_check_read rejects
read.

While reading the code, I noticed that shm_read() returns without unlocking
foffset and rangelock if mac_posixshm_check_read() rejects the read.

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

7 years agoLimit VOLUME_LABEL (first argument to the mkisoimages scripts)
gjb [Sun, 3 Jul 2016 00:31:33 +0000 (00:31 +0000)]
Limit VOLUME_LABEL (first argument to the mkisoimages scripts)
to 32 characters.

This is a direct commit to stable/10, as UEFI support natively
exists for 11.0-CURRENT and unsupported in 9-STABLE.

Submitted by: Rick Miller
PR: 210463
Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r302075:
mm [Thu, 30 Jun 2016 12:44:15 +0000 (12:44 +0000)]
MFC r302075:

Update libarchive to 3.2.1 (bugfix and security fix release)

List of vendor fixes:
- fix exploitable heap overflow vulnerability in Rar decompression
  (vendor issue 719, CVE-2016-4302, TALOS-2016-0154)
- fix exploitable stack based buffer overflow vulnebarility in mtree
  parse_device functionality (vendor PR 715, CVE-2016-4301, TALOS-2016-0153)
- fix exploitable heap overflow vulnerability in 7-zip read_SubStreamsInfo
  (vendor issue 718, CVE-2016-4300, TALOS-2016-152)
- fix integer overflow when computing location of volume descriptor
  (vendor issue 717)
- fix buffer overflow when reading a crafred rar archive (vendor issue 521)
- fix possible buffer overflow when reading ISO9660 archives on machines
  where sizeof(int) < sizeof(size_t) (vendor issue 711)
- tar and cpio should fail if an input file named on the command line is
  missing (vendor issue 708)
- fix incorrect writing of gnutar filenames that are exactly 512 bytes
  long (vendor issue 682)
- allow tests to be run from paths that are equal or longer than 128
  characters (vendor issue 657)
- add memory allocation errors in archive_entry_xattr.c (vendor PR 603)
- remove dead code in archive_entry_xattr_add_entry() (vendor PR 716)
- fix broken decryption of ZIP files (vendor issue 553)
- manpage style, typo and description fixes

Post-3.2.1 vendor fixes:
- fix typo in cpio version reporting (Vendor PR 725, 726)
- fix argument range of ctype functions in libarchive_fe/passphrase.c
- fix ctype use and avoid empty loop bodies in WARC reader

Security: CVE-2016-4300, CVE-2016-4301, CVE-2016-4302

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

7 years agoMFC r301956, r301957, r301964, r301966, r301968, r301969, r302080,
hselasky [Wed, 29 Jun 2016 10:58:36 +0000 (10:58 +0000)]
MFC r301956, r301957, r301964, r301966, r301968, r301969, r302080,
    r302125 and r302171:

Added multiple new LibUSB v1.0 API functions.
Refer to the individual commits for more details.

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

7 years agoMFC r301842:
hselasky [Wed, 29 Jun 2016 10:43:31 +0000 (10:43 +0000)]
MFC r301842:
Implement code to stop all USB endpoints before executing a USB device
reset command, alternate setting command or set configuration
command. Else LibUSB v1.0 will not re-open the endpoints which the
kernel closes and the USB application might wait infinitely for
transfers to complete.

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

7 years agoMFC r301544:
hselasky [Wed, 29 Jun 2016 10:40:34 +0000 (10:40 +0000)]
MFC r301544:
Fallback to arc4rand() in the LinuxKPI when read_random() returns
zero. This can happen for virtual machines.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r301545:
hselasky [Wed, 29 Jun 2016 10:33:11 +0000 (10:33 +0000)]
MFC r301545:
Add SR-IOV guest support to the mlx5en driver.

This patch adds the missing pieces needed for device setup using the
mlx5en driver inside a virtual machine which is providing hardware
access through SR-IOV.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r302139:
hselasky [Wed, 29 Jun 2016 10:29:52 +0000 (10:29 +0000)]
MFC r302139:
Use correct Q-counter output array.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r302076:
hselasky [Wed, 29 Jun 2016 10:21:45 +0000 (10:21 +0000)]
MFC r302076:
Update the definition for number of scratch pages to match the latest
version of the XHCI specification. Make sure the code can handle the
maximum number of allowed scratch pages.

Submitted by: Shichun_Ma@Dell.com

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

7 years agoMFC r302213:
dchagin [Wed, 29 Jun 2016 06:04:45 +0000 (06:04 +0000)]
MFC r302213:

Fix a bug introduced in r283433.

[1] Remove unneeded sockaddr conversion before kern_recvit() call as the from
argument is used to record result (the source address of the received message) only.

[2] In Linux the type of msg_namelen member of struct msghdr is signed but native
msg_namelen has a unsigned type (socklen_t). So use the proper storage to fetch fromlen
from userspace and than check the user supplied value and return EINVAL if it is less
than 0 as a Linux do.

Reported by: Thomas Mueller <tmueller at sysgo dot com> [1]
Tested by: Thomas Mueller <tmueller at sysgo dot com> [both]
Reviewed by: kib@

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

7 years agoMFC r301138:
pfg [Tue, 28 Jun 2016 03:11:07 +0000 (03:11 +0000)]
MFC r301138:
sed(1): convert sed to use REG_STARTEND more explicitly.

This is a followup to previous r302228, which only merged the
incomplete r300684 causing a regression.

Reported by: mi
PR: 209387
Taken from:     openbsd-tech (Martijn van Duren)

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

7 years agoMFC r302063:
kib [Tue, 28 Jun 2016 00:37:34 +0000 (00:37 +0000)]
MFC r302063:
Avoid the active object marking for vm.vmtotal sysctl.

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

7 years agoMFC r300809,r300890,r300891:
bdrewery [Mon, 27 Jun 2016 22:21:29 +0000 (22:21 +0000)]
MFC r300809,r300890,r300891:

  r300809:
    filemon exec: Use imgp->execpath rather than vn_fullpath(9).
  r300890:
    exec: Cease tracing if credentials will change with the new image.
  r300891:
    Write to the log using the tracer's credentials.

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

7 years agoMFC r300793:
bdrewery [Mon, 27 Jun 2016 22:13:43 +0000 (22:13 +0000)]
MFC r300793:

  exec: Provide execpath in imgp for the process_exec hook.

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

7 years agoMFC r300792,r300851,r301580:
bdrewery [Mon, 27 Jun 2016 22:12:11 +0000 (22:12 +0000)]
MFC r300792,r300851,r301580:

  r300792:
    exec: Add credential change information into imgp for process_exec hook.
  r300851:
    exec: get rid of one vnode lock/unlock pair in do_execve
  r301580:
    Old process credentials for setuid execve must not be dereferenced when the
    process credentials were not changed.  This can happen if an error occured
    trying to activate the setuid binary.  And on error, if new credentials
    were not yet assigned, they must be freed to not create the leak.

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

7 years agoMFC r292384:
bdrewery [Mon, 27 Jun 2016 22:10:07 +0000 (22:10 +0000)]
MFC r292384:

  Fix style issues around existing SDT probes.

  ** Changes to sys/netinet/in_kdtrace.c and sys/netinet/in_kdtrace.h skipped.

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

7 years agoMFC r298819:
bdrewery [Mon, 27 Jun 2016 21:50:30 +0000 (21:50 +0000)]
MFC r298819:

  sys/kern: spelling fixes in comments.

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

7 years agoMFC r297391:
bdrewery [Mon, 27 Jun 2016 21:44:27 +0000 (21:44 +0000)]
MFC r297391:

  Remove some NULL checks for M_WAITOK allocations.

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

7 years agoMFC r285513:
bdrewery [Mon, 27 Jun 2016 21:37:30 +0000 (21:37 +0000)]
MFC r285513:

  exec: textvp -> oldtextvp; binvp -> newtextvp

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

7 years agoMFC r285512:
bdrewery [Mon, 27 Jun 2016 21:35:19 +0000 (21:35 +0000)]
MFC r285512:

  exec plug a redundant vref + vrele of the image vnode

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

7 years agoMFC r273351:
bdrewery [Mon, 27 Jun 2016 21:30:37 +0000 (21:30 +0000)]
MFC r273351:

  Plug unnecessary binvp NULL initialization and test.

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

7 years agoMFC r280130:
bdrewery [Mon, 27 Jun 2016 21:25:01 +0000 (21:25 +0000)]
MFC r280130:

  cred: add proc_set_cred helper

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

7 years agosed(1): convert sed to use REG_STARTEND more explicitly.
pfg [Mon, 27 Jun 2016 20:54:02 +0000 (20:54 +0000)]
sed(1): convert sed to use REG_STARTEND more explicitly.

Summarizing the findings in the OpenBSD list:

This solves a reproduceable issue with very recent Mesa where REG_NOTBOL
combined with a match at the begin of the string causes our regex library
to treat the word as not begin of word.

Bump __FreeBSD_version: JIC we hit the issue in recent Mesa ports.

PR: 209352, 209387 (exp-run)
Taken from:     openbsd-tech (Martijn van Duren)
MFC after: 1 month

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

7 years agoMFC r280121:
bdrewery [Mon, 27 Jun 2016 20:38:38 +0000 (20:38 +0000)]
MFC r280121:

  audit: fix cred assignment when A_SETPMASK is used

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

7 years agoMFC r296285:
bdrewery [Mon, 27 Jun 2016 20:31:56 +0000 (20:31 +0000)]
MFC r296285:

  Correct a comment.

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

7 years agoMFC r302031
slm [Mon, 27 Jun 2016 17:01:26 +0000 (17:01 +0000)]
MFC r302031

- No log bit in IOCStatus and endian-safe changes.

Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
make a few more things endian-safe.

- Fix possible use of invalid pointer.

It was possible to use an invalid pointer to get the target ID value. To fix
this, initialize a local Target ID variable to an invalid value and change that
variable to a valid value only if the pointer to the Target ID is not NULL.

- No need to set the MPSSAS_SHUTDOWN flag because it's never used.

- done_ccb pointer can be used if it is NULL.

To prevent this, move check for done_ccb == NULL to before done_ccb is used in
mpssas_stop_unit_done().

- Disks can go missing until a reboot is done in some cases.

This is due to the DevHandle not being released, which causes the Firmware to
not allow that disk to be re-added.

Approved by: ken, scottl, ambrisko (mentors)

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

7 years agohyperv/vmbus: Fix mismerge of r301015
sephe [Mon, 27 Jun 2016 01:17:00 +0000 (01:17 +0000)]
hyperv/vmbus: Fix mismerge of r301015

Submitted by: Oliver Pinter <oliver.pinter hardenedbsd org>
Sponsored by: Microsoft OSTC

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

7 years agoMFC r302020:
kib [Sun, 26 Jun 2016 13:18:03 +0000 (13:18 +0000)]
MFC r302020:
Handle EDEADLK and EINTR from local adv lock manager.

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

7 years agoMFC r302019:
kib [Sun, 26 Jun 2016 13:16:02 +0000 (13:16 +0000)]
MFC r302019:
Do not access NFS data for reclaimed vnode.

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

7 years agoMFC r300775:
ed [Sat, 25 Jun 2016 10:08:04 +0000 (10:08 +0000)]
MFC r300775:

  Let l64a() properly null terminate its result.

  Though the buffer used by l64a() is initialized with null bytes,
  repetetive calls may end up having trailing garbage of previous
  invocations because we don't end up terminating the string.

  Instead of importing NetBSD's fix, use this opportunity to simplify this
  function dramatically, for example by just storing the Base64 character
  set in a string. There is also no need to do the bitmasking, as we can
  just use the proper integer type from <stdint.h>.

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

7 years agoMFC r302013:
kib [Sat, 25 Jun 2016 09:32:35 +0000 (09:32 +0000)]
MFC r302013:
After the vnode unlock, mount point might be destroyed immediately,
dropping the reference on mnt_cred. Prevent this by referencing the
temporal credentials before unlock.

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

7 years agoMFC 301483,301484,301487,301488,301583,301588
sephe [Fri, 24 Jun 2016 02:30:14 +0000 (02:30 +0000)]
MFC 301483,301484,301487,301488,301583,301588

301483
    hyperv: Move machine dependent bits into machine dependent files.

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6701

301484
    hyperv/vmbus: Define type for channel messages.

    And fix message processing; only channel messages are supported.

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6706

301487
    hyperv/vmbus: Factor out channel message processing

    This paves the way for further cleanup.

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6707

301488
    hyperv/vmbus: Constify channel message

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6708

301583
    hyperv/vmbus: Busdma-fy MNF and event flags.

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6744

301588
    hyperv/vmbus: Change tx_evtflags type to u_long to match vmbus_evtflags

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6745

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

7 years agoMFC r300683:
pfg [Fri, 24 Jun 2016 02:24:34 +0000 (02:24 +0000)]
MFC r300683:
libc: regexec(3) adjustment.

Change the behavior of when REG_STARTEND is combined with REG_NOTBOL.

From the original posting[1]:

"Enable the assumption that pmatch[0].rm_so is a continuation offset
to  a string and allows us to do a proper assessment of the character
in  regards to it's word position ('^' or '\<'), without risking going
into unallocated memory."

This change makes us similar to how glibc handles REG_STARTEND |
REG_NOTBOL, and is closely related to a soon-to-land fix to sed.

Special thanks to Martijn van Duren and Ingo Schwarze for working
out some consistent behaviour.

Differential Revision: https://reviews.freebsd.org/D6257
Taken from: openbsd-tech 2016-05-24 [1]  (Martijn van Duren)

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

7 years agoMFC 301113
sephe [Fri, 24 Jun 2016 02:06:13 +0000 (02:06 +0000)]
MFC 301113

    hyperv: Rename some cleaned up/almost cleaned up files

    MFC after:  1 week
    Sponsored by:       Microsoft OSTC

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