]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r298698:
pfg [Wed, 11 May 2016 00:36:31 +0000 (00:36 +0000)]
MFC r298698:
geom: unsign some types to match their definitions and avoid overflows.

In struct:gctl_req, nargs is unsigned.

In mirror:
g_mirror_syncreqs is unsigned.

In raid:
in struct:g_raid_volume, v_disks_count is unsigned.

In virstor:
in struct:g_virstor_softc, n_components is unsigned.

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

7 years agoMFC r298904:
wblock [Tue, 10 May 2016 20:12:27 +0000 (20:12 +0000)]
MFC r298904:

Spelling fixes supplied by pfg@, detected with codespell, plus
additional misspellings detected by igor.

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

7 years agoMFC 294923
asomers [Tue, 10 May 2016 17:34:35 +0000 (17:34 +0000)]
MFC 294923

Fix grep_test:recurse with ZFS and TMPFS tmpdirs

contrib/netbsd-tests/usr.bin/grep/t_grep.sh
Fix grep_test:recurse when /tmp is either zfs or tmpfs. The test was
relying on an implicit ordering of directory recursion which happens to
be true when using UFS. grep's specification requires no such ordering.
The solution is to ignore the order of grep's results.

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

7 years agoMFC 297868
asomers [Tue, 10 May 2016 16:49:50 +0000 (16:49 +0000)]
MFC 297868

Fix rare double free in vdev_geom_attrchanged

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
        Don't drop the g_topology_lock before freeing old_physpath. That
        opens up a race where one thread can call vdev_geom_attrchanged,
        set old_physpath, drop the g_topology_lock, then block trying to
        acquire the SCL_STATE lock. Then another thread can come into
        vdev_geom_attrchanged, set old_physpath to the same value, and
        proceed to free it. When the first thread resumes, it will free
        the same location.

        It turns out that the SCL_STATE lock isn't needed. It was
        originally added by gibbs to protect vd->vdev_physpath while
        updating the same. However, the update process subsequently was
        switched to an atomic operation (a pointer swap). Now, there is
        no need for the SCL_STATE lock, and hence no need to drop the
        g_topology_lock.

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

7 years agoMFC 299205: Restore name=value format of PCI location strings.
jhb [Tue, 10 May 2016 03:42:18 +0000 (03:42 +0000)]
MFC 299205: Restore name=value format of PCI location strings.

When devctl was added, the location string for PCI devices was changed to
use the PCI "selector" that pciconf and devctl accept.  However, devd
assumes that location strings are formatted as a list of name=value pairs.
As a result, devd is no longer parsing any of the values out of PCI
device events.  Restore the previous format of the PCI location strings
to restore the location and slot keywords in case any devd scripts are
using this.  Add the "selector" as a new 'dbsf' location variable.

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

7 years agoMFC r298591
davidcs [Tue, 10 May 2016 02:35:13 +0000 (02:35 +0000)]
MFC r298591

1. Removed -Wno-shift-negative-value from Makefile
2. Fixed warning its absence caused in bxe_elink.c

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

7 years agoMFC r298496
davidcs [Tue, 10 May 2016 02:30:18 +0000 (02:30 +0000)]
MFC r298496

Remove Unused/Dead Code

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

7 years agoMFC r298294
davidcs [Tue, 10 May 2016 02:26:26 +0000 (02:26 +0000)]
MFC r298294
  1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated
     and freed on as needed basis.
  2. grcdump can be taken at failure points by invoking bxe_grc_dump()
     when trigger_grcdump sysctl flag is set. When grcdump is taken
     grcdump_done sysctl flag is set.
  3. grcdump_done can be monitored by the user to retrieve the grcdump

Submitted by: vaishali.kulkarni@qlogic.com

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

7 years agoMFC r298609:
pfg [Tue, 10 May 2016 02:13:17 +0000 (02:13 +0000)]
MFC r298609:
ext2fs: make use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.

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

7 years agoMFC r298589:
markj [Mon, 9 May 2016 17:13:40 +0000 (17:13 +0000)]
MFC r298589:
Allow DOF sections with excessively long probe function components.

PR: 207735

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

7 years agoMFC r298783:
hselasky [Mon, 9 May 2016 13:12:12 +0000 (13:12 +0000)]
MFC r298783:
Regenerate usb.conf .

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

7 years agoMFC r298772:
hselasky [Mon, 9 May 2016 13:11:00 +0000 (13:11 +0000)]
MFC r298772:
Correct some error codes to native FreeBSD ones.

Sponsored by: Mellanox Technologies
Tested by: Netflix

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

7 years agoMFC r298771:
hselasky [Mon, 9 May 2016 13:09:41 +0000 (13:09 +0000)]
MFC r298771:
Add function to detect the presence of a port module and use this
function to error out early when no port module is present and doing
eeprom access. This also prevents error codes from filling up in
dmesg.

Sponsored by: Mellanox Technologies
Tested by: Netflix

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

7 years agoRevert r298920 until we have addressed all known regressions on head/ after
delphij [Sun, 8 May 2016 18:09:30 +0000 (18:09 +0000)]
Revert r298920 until we have addressed all known regressions on head/ after
settle.  file is now downgraded to 5.25.

PR: bin/209211
Requested by: Tomoaki AOKI
Relnotes: yes

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

7 years agoMFC r298898:
kib [Sun, 8 May 2016 09:08:05 +0000 (09:08 +0000)]
MFC r298898:
Explain NOTE_LINK reporting for the directories.

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

7 years agoMFC r298891:
kib [Sun, 8 May 2016 09:06:52 +0000 (09:06 +0000)]
MFC r298891:
Avoid duplicated calls to pmap_page_get_memattr().
Avoid logging inconsistency for the /dev/mem device.

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

7 years agoMFC r298890:
kib [Sun, 8 May 2016 09:02:51 +0000 (09:02 +0000)]
MFC r298890:
Make it explicit that D_MEM cdevsw d_flag is to signify that the
driver is (or behaves identically to) /dev/mem.  Remove the D_MEM flag
from random drivers.

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

7 years agoMFC: r298523
rmacklem [Sat, 7 May 2016 20:17:23 +0000 (20:17 +0000)]
MFC: r298523
Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation.

It was reported via email that a Linux client couldn't do a Kerberized
NFS mount when only "sec=krb5" was specified for the exports. The Linux
client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT.
Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I
think it is the correct reply, so this patch enables that.
I do not know if this fixes the mount attempt, but adding "krb5i" to the
list of allowed security flavours does allow the mount to work.

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

7 years agoMFC: r298495
rmacklem [Sat, 7 May 2016 20:09:15 +0000 (20:09 +0000)]
MFC: r298495
Fix a LOR in the NFSv4.1 server.

The ordering of acquisition of the state and session mutexes was
reversed in two cases executed when an NFSv4.1 client created/freed
a session. Since clients will typically do this only when mounting
and dismounting, the likelyhood of causing a deadlock was low but possible.
This can only occur for NFSv4.1 mounts, since the others do not
use sessions.
This was detected while testing the pNFS server/client where the
client crashed during dismounting.
The patch also reorders the unlocks, although that isn't necessary
for correct operation.

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

7 years agoMFC r295856 (by des@):
dchagin [Sat, 7 May 2016 19:05:39 +0000 (19:05 +0000)]
MFC r295856 (by des@):
Implement /proc/$$/limits.

MFC r297781 (by dchagin@):
More complete implementation of /proc/self/limits.
Fix the way the code accesses process limits struct - pointed out by mjg@.

MFC r298318, 298319 (by cem@):
Don't print uninitialized values and initialize error return before use.

PR: 207386

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

7 years agoMFC r285394 (by mjg@):
dchagin [Sat, 7 May 2016 18:54:35 +0000 (18:54 +0000)]
MFC r285394 (by mjg@):
vref the vnode passed to vn_fullpath.

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

7 years agoMFC r298519:
dchagin [Sat, 7 May 2016 08:30:21 +0000 (08:30 +0000)]
MFC r298519:
Fix streams and svr4 module dependency. Both modules are complaining about
undefined symbol svr4_delete_socket which was moved from streams to the svr4 module
in r160558 that created a two-way dependency between them.

MFC r298520:
Allow to build svr4 module with SYSV support separatelly from the kernel build.

PR: 208464
Reported by: Kristoffer Eriksson

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

7 years agoMFC: r297869
rmacklem [Sat, 7 May 2016 00:02:28 +0000 (00:02 +0000)]
MFC: r297869
If the VOP_SETATTR() call that saves the exclusive create verifier failed,
the NFS server would leave the newly created vnode locked. This could
result in a file system that would not unmount and processes wedged,
waiting for the file to be unlocked.
Since this VOP_SETATTR() never fails for most file systems, this bug
doesn't normally manifest itself. I found it during testing of an
exported GlusterFS file system, which can fail.
This patch adds the vput() and changes the error to the correct NFS one.

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

7 years agoMFC: r297837
rmacklem [Fri, 6 May 2016 23:44:24 +0000 (23:44 +0000)]
MFC: r297837
Bruce Evans reported that there was a performance regression between
the old and new NFS clients. He did a good job of isolating the problem
which was caused by the new NFS client not setting the post write mtime
correctly. The new NFS client code was cloned from the old client, but
was incorrect, because the mtime in the nfs vnode's cache wasn't yet
updated. This patch fixes this problem. The patch also adds missing mutex
locking.

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

7 years agoMFC r298280
sbruno [Fri, 6 May 2016 19:18:44 +0000 (19:18 +0000)]
MFC r298280

aacraid(4): Sanely copyin userland pointers and ensure that we don't get
anything janky from a user. (cturt)

aac(4) landergriffith+freebsdbugzilla@gmail.com pointed out that aac(4)
had the same issue and handling of pointers, so let's change that too.

PR: 206573
Submitted by: cturt@hardenedbsd.org

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

7 years agoMFC r298224
sbruno [Fri, 6 May 2016 19:14:57 +0000 (19:14 +0000)]
MFC r298224

Correct possible underflow conditions when checking for available space
in the tx h/w ring buffer.

Sponsored by: Limelight Networks

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

7 years agoMFC r298279
sbruno [Fri, 6 May 2016 19:11:47 +0000 (19:11 +0000)]
MFC r298279

Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non-
null terminated ASCII string.

PR: 207626
Submitted by: cturt@hardenedbsd.org

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

7 years agoMFC r298893:
bcr [Fri, 6 May 2016 17:55:11 +0000 (17:55 +0000)]
MFC r298893:
Provide an example to the kqueue man page, showing
a basic usage example.  Although it is an
untypical example for the use of kqueue, it is
better than nothing and should get people started.

PR: 196844
Submitted by: fernando.apesteguia@gmail.com
Reviewed by: kib
Approved by: kib
Differential Revision:  https://reviews.freebsd.org/D6082

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

7 years agoMFC r298385
sephe [Fri, 6 May 2016 05:44:12 +0000 (05:44 +0000)]
MFC r298385

dhclient: Log a warning instead of bailing upon "illegal" options

In Azure, the DHCP servers add private option (id 0xf5), which contains
binary form of an IPv4 address. Once this option is converted to string
form, it could contain '$', e.g.

IPv4 address: 100.72.36.54
binary form: 0x64 0x48 0x24 0x36
string form: "dH$6"

dhclient bails upon "illegal" options like the above example, thus the
VM bring-up will fail.

Also as a side note, this "illegal" option detection was added in
OpenBSD ~11years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup

And it was removed along with the removal of script support in OpenBSD
~3years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup

Reported by: Hongxiong Xian <v-hoxian microsoft com>
Reviewed by: jhb, Dexuan Cui <decui microsoft com>
Tested by: Hongxiong Xian <v-hoxian microsoft com>
Analyzed by: Dong Liu <doliu microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5853

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

7 years agoMFC r298038
sephe [Fri, 6 May 2016 05:16:42 +0000 (05:16 +0000)]
MFC r298038

hyperv/stor: Temporary disable the wrongly done command timeout.

It will be reenabled once the request processing is corrected.

Sponsored by: Microsoft OSTC

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

7 years agoMFC r298868, r298874:
pfg [Fri, 6 May 2016 01:37:06 +0000 (01:37 +0000)]
MFC r298868, r298874:
restore: fix memory and resource handle leaks.

CID: 272297, 1007784

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

7 years agoMFC r298408:
jtl [Fri, 6 May 2016 01:26:58 +0000 (01:26 +0000)]
MFC r298408:
  Prevent underflows in tp->snd_wnd if the remote side ACKs more than
  tp->snd_wnd. This can happen, for example, when the remote side responds
  to a window probe by ACKing the one byte it contains.

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

7 years agoMFC r295583, r295584, r295729, r295730:
markj [Thu, 5 May 2016 23:06:39 +0000 (23:06 +0000)]
MFC r295583, r295584, r295729, r295730:
NDP code cleanup changes.

MFC r295732:
Fix an IPv6 DAD reference count leak.

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

7 years agoMFC r298759:
wblock [Thu, 5 May 2016 19:44:06 +0000 (19:44 +0000)]
MFC r298759:

Clarify build(7) instructions for alternate object directory.

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

7 years agoMFC r297999:
ngie [Thu, 5 May 2016 08:11:36 +0000 (08:11 +0000)]
MFC r297999:

Clean up trailing whitespace in lib/libcam; no functional change

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

7 years agoMFC r298732:
pfg [Thu, 5 May 2016 01:34:58 +0000 (01:34 +0000)]
MFC r298732:
sys/devfs: unsign an index to prevent signed integer overflow.

cdp_maxdirent in struct:cdev_priv is of type u_int.  Use the same
type for the corresponding index in devfs_revoke().

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

7 years agoMFC r298731, r298734:
pfg [Thu, 5 May 2016 01:29:53 +0000 (01:29 +0000)]
MFC r298731, r298734:
ndis(4): unsign some indexes to prevent overflows.

The "len" parameter is uint32_t, indexing it with an int may
end up in a signed integer overflow.

strlen(3) returns an integer of size_t but a correponding index
of type u_int is more than enough.

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

7 years agoMerge r299077, which provides ability to override NO_INSTALLEXTRAKERNELS.
glebius [Wed, 4 May 2016 17:27:49 +0000 (17:27 +0000)]
Merge r299077, which provides ability to override NO_INSTALLEXTRAKERNELS.

Override NO_INSTALLEXTRAKERNELS for the release build. Historically, in
the stable/10 branch the regular 'installkernel' target DID NOT install
extra kernels, while the release build DID. This change finally restores
POLA, I hope.

Reported by: Fedor <f att.org.ru>
Reviewed by: gjb

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

7 years agoMFC r297857: re-enable AMD Topology extension on certain models if
avg [Wed, 4 May 2016 11:53:30 +0000 (11:53 +0000)]
MFC r297857: re-enable AMD Topology extension on certain models if
disabled by BIOS

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

7 years agoMFC r297812: zio: align use of "no dump" flag between use_uma and !use_uma cases
avg [Wed, 4 May 2016 11:40:13 +0000 (11:40 +0000)]
MFC r297812: zio: align use of "no dump" flag between use_uma and !use_uma cases

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

7 years agoMFC r298366:
ngie [Wed, 4 May 2016 07:39:23 +0000 (07:39 +0000)]
MFC r298366:

Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c

- Ensure socket(2) calls succeed
- Don't leak slist allocated by earlier socket(2) call

CID: 976773, 1251405

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

7 years agoMFC r298304:
ngie [Wed, 4 May 2016 07:37:02 +0000 (07:37 +0000)]
MFC r298304:

Fix issues identified by Coverity

- Always munmap memory regions after mmap'ing them.
- Make sure getpagesize() returns a value greater than 0 and use a
  cached value instead of always calling getpagesize(3).
- Remove intermediate variable for assigning from $TMPDIR if set in the
  environment to eliminate warnings about pointer conversions with "/tmp",
  and to mute an invalid buffer overflow concern from Coverity
  (snprintf and tacking on a NUL terminator was alleviating that concern
  before).
- Remove useless self-test of psize before it's initialized.
- Check the return values of getrlimit/setrlimit.

Cosmetic changes:
- Replace a `(void*)0` with NULL.
- Do some minor whitespace clean up.
- Remove an unnecessary cast to mmap.
- Make all munmap calls use ATF_REQUIRE_MSG instead of using the:

  > if (munmap(..) == -1)
  >    atf_tc_fail(..)

  idiom. Employ the new idiom consistently when calling munmap.

CID: 13313511331382-133138613315131331514133156513315831331694

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

7 years agoMFC r298301:
ngie [Wed, 4 May 2016 07:35:43 +0000 (07:35 +0000)]
MFC r298301:

Fix leaks and test for getpagesize() returning == -1

- close file descriptors after use.
- Always munmap memory regions after mmap'ing them.
- Make sure getpagesize() returns a value greater than 0 and use a
  cached value instead of always calling getpagesize(3).

CID: 1331374-13313771331653-1331662

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

7 years agoMFC r298758:
ngie [Wed, 4 May 2016 07:33:58 +0000 (07:33 +0000)]
MFC r298758:

Remove logically impossible test in scsidoinquiry(..)

It was already done 4 lines prior and the value of error didn't change

CID: 1011236

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

7 years agoMFC r298753:
ngie [Wed, 4 May 2016 00:39:03 +0000 (00:39 +0000)]
MFC r298753:

Fix va_list handling

- Add missing va_end's after corresponding va_start's to cleanup state
- Eliminate questionable bzero'ing of va_list passed in to
  do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..)
  and csio_{de,en}code_visit(..). Make va_list a pointer instead and
  pass NULL into the underlying functions to handler this in a portable
  way.
- Do some minor style(9) clean up in affected functions.

CID: 1018500-1018503

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

7 years agoMFC r298450:
ngie [Wed, 4 May 2016 00:34:45 +0000 (00:34 +0000)]
MFC r298450:

Simplify always evaluated branch (`e != NULL`)

- xalloc(..) ensures that e will be non-null via malloc + err.
- `e` is already dereferenced above, so logically it's impossible
  to hit the lower test without crashing if it was indeed NULL.

CID: 1007408

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

7 years agoMFC r298311,r298312:
ngie [Wed, 4 May 2016 00:30:36 +0000 (00:30 +0000)]
MFC r298311,r298312:

r298311:

Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell
on the FILE object

This fixes potential null pointer dereferences on failure

CID: 1254952

r298312:

Fix double fclose of `fp1` when freopen fails

freopen handles closing file descriptors on error, with the exception of
fdopen'ed descriptors, so closing an already fclose'd file descriptor is
incorrect

CID: 1338525

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

7 years agoMFC r298368,r298660:
ngie [Wed, 4 May 2016 00:29:05 +0000 (00:29 +0000)]
MFC r298368,r298660:

r298368:

Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c

Ensure opening /dev/zero succeeds. Abort the test if it doesn't.

Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero"

CID: 1251410

r298660:

Fix up r298368

Remove the semicolon accidentally added after the new conditional that tests
that /dev/zero is opened successfully.

CID: 1354980

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

7 years agoMFC r298448,r298464:
ngie [Wed, 4 May 2016 00:25:20 +0000 (00:25 +0000)]
MFC r298448,r298464:

r298448:

Don't leak `string` in parse_define(..) when a macro has been found
and the parser token != TOK_ASSIGN

CID: 10071871007188
Obtained from: Isilon OneFS (part of r445479)

r298464:

Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with
the rest of the users in the file

No functional change

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

7 years agoMFC r298451,r298452,r298507,r298750:
ngie [Wed, 4 May 2016 00:14:50 +0000 (00:14 +0000)]
MFC r298451,r298452,r298507,r298750:

r298451:

Don't use `entry` after free in the "already in lists" case

Return with 0 as it isn't an error.

CID: 1006085
Obtained from: Isilon OneFS (part of r493633)

r298452:

Don't try to free `string` (stack allocated char[])

Fix minor style with warnx call while in the neighborhood

CID: 1009683

r298507:

Fix looking for "UTC" at start of ptr by using strnmp instead of improperly
unrolled equivalent

CID: 1347118

r298750:

Use a better idiom for finding UTC prefixed timezones

Instead of copy-pasting the string literal for "UTC" 3 times and using
strlen, use a static char[3] buffer and sizeof(..).

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

7 years agoMFC r295575, r295576, r295578, r295579, r295580:
markj [Tue, 3 May 2016 23:46:01 +0000 (23:46 +0000)]
MFC r295575, r295576, r295578, r295579, r295580:
Various NDP cleanups. No functional change intended.

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

7 years agoMFC r296479:
markj [Tue, 3 May 2016 20:08:05 +0000 (20:08 +0000)]
MFC r296479:
Fix fasttrap tracepoint locking.

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

7 years agoMFC r297771:
markj [Tue, 3 May 2016 19:42:58 +0000 (19:42 +0000)]
MFC r297771:
Initialize SDT probes during SI_SUB_DTRACE_PROVIDER.

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

7 years agoMerge OpenSSL 1.0.1t.
jkim [Tue, 3 May 2016 18:54:20 +0000 (18:54 +0000)]
Merge OpenSSL 1.0.1t.

Relnotes: yes

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

7 years agoMFC r298556:
pfg [Tue, 3 May 2016 15:04:56 +0000 (15:04 +0000)]
MFC r298556:

ifconfig: prevent some improbable signed integer overflows.

ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int.
Use an unsigned index to prevent overflowing the index.

Adopt unsigned integers in other cases where it is useful
to be aware of the unsigned quantities and there is no
risk of the values being negative.

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

7 years agoMFC r298103: Simplify memory allocation for NS requests.
mav [Tue, 3 May 2016 08:35:35 +0000 (08:35 +0000)]
MFC r298103: Simplify memory allocation for NS requests.

Since we no longer need additional buffers for request and response IOCBs,
we can increase receive space by 192 bytes, that is enough for fetching 48
more ports.  The new limit is 1020 fabric ports per virtual port.

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

7 years agoMFC r297818: Update 25xx chips firmware from 7.03.00 to 8.03.00.
mav [Tue, 3 May 2016 08:07:38 +0000 (08:07 +0000)]
MFC r297818: Update 25xx chips firmware from 7.03.00 to 8.03.00.

While the same update is also available for 24xx chips, it seems have
a problem with disabling virtual ports -- firmware handles the request,
but does not respong on it, causing timeout in driver.

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

7 years agoMFC r297991: Extract virtual port address from RQSTYPE_RPT_ID_ACQ.
mav [Tue, 3 May 2016 08:05:31 +0000 (08:05 +0000)]
MFC r297991: Extract virtual port address from RQSTYPE_RPT_ID_ACQ.

This should close the race between request arriving on new target mode
virtual port and its scanner thread finally fetch its address for request
routing.

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

7 years agoMFC r297915: Filter Port Database Changed notifications.
mav [Tue, 3 May 2016 08:04:34 +0000 (08:04 +0000)]
MFC r297915: Filter Port Database Changed notifications.

For some reason firmware sends Port Database Changed notifications in case
of explicit login requests from the driver when target port is unavailabe.
Those notifications don't give driver any new information, but only cause
infinite scan loop.

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

7 years agoMFC r297912: Respect NVRAM topology settings on 24xx and above chips.
mav [Tue, 3 May 2016 08:03:51 +0000 (08:03 +0000)]
MFC r297912: Respect NVRAM topology settings on 24xx and above chips.

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

7 years agoMFC r297867: Make all CT Pass-Through (name server requests) asynchronous.
mav [Tue, 3 May 2016 08:03:07 +0000 (08:03 +0000)]
MFC r297867: Make all CT Pass-Through (name server requests) asynchronous.

Previously we had to do it synchronously because we could not drop the lock
due to potential scratch memory use conflicts.  Previous commits fixed that
collision, so here it goes -- slower and less reliable external requests
are executed asynchronously without spinning in tight loop and with more
safe timeout handling.

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

7 years agoMFC r297859: Switch isp_getpdb() to synchronous IOCB DMA area.
mav [Tue, 3 May 2016 08:02:00 +0000 (08:02 +0000)]
MFC r297859: Switch isp_getpdb() to synchronous IOCB DMA area.

While technically it is not IOCB, it is synchronous and can be called from
different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient.

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

7 years agoMFC r297858: Allocate separate DMA area for synchronous IOCB execution.
mav [Tue, 3 May 2016 08:00:54 +0000 (08:00 +0000)]
MFC r297858: Allocate separate DMA area for synchronous IOCB execution.

Usually IOCBs should be put on queue for asynchronous processing and should
not require additional DMA memory.  But there are some cases like aborts and
resets that for external reasons has to be synchronous.  Give those cases
separate 2*64 byte DMA area to decouple them from other DMA scratch area
users, using it for asynchronous requests.

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

7 years agoMFC r297856: Reimplement ISP_TSK_MGMT IOCTL via asynchronous request.
mav [Tue, 3 May 2016 07:59:42 +0000 (07:59 +0000)]
MFC r297856: Reimplement ISP_TSK_MGMT IOCTL via asynchronous request.

I am not sure this code is not completely dead, but it used DMA scratch
are without good reason and asked to be refactored.

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

7 years agoMFC r297854: Add couple missing memory barriers.
mav [Tue, 3 May 2016 07:58:51 +0000 (07:58 +0000)]
MFC r297854: Add couple missing memory barriers.

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

7 years agoMFC r297817: Polish debugging IOCB dumping.
mav [Tue, 3 May 2016 07:58:11 +0000 (07:58 +0000)]
MFC r297817: Polish debugging IOCB dumping.

Add few more missing cases, unify byte order.

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

7 years agoMFC r297751: Register symbolic port/node names in FC name server.
mav [Tue, 3 May 2016 07:57:26 +0000 (07:57 +0000)]
MFC r297751: Register symbolic port/node names in FC name server.

This is cosmetics that simplifies identification of new ports on FC switch.

It would be good to use target name from CTL here instead of hostname, but
it is not passed here through CAM now.

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

7 years agoMFC r297741: Reduce code duplication when executing Passthrough IOCB.
mav [Tue, 3 May 2016 07:56:42 +0000 (07:56 +0000)]
MFC r297741: Reduce code duplication when executing Passthrough IOCB.

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

7 years agoMFC r297522: Pass through some new block device features.
mav [Tue, 3 May 2016 07:52:06 +0000 (07:52 +0000)]
MFC r297522: Pass through some new block device features.

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

7 years agoMFC r297921: Add hint.ahci.X.quirks tunable for some odd cases.
mav [Tue, 3 May 2016 07:50:58 +0000 (07:50 +0000)]
MFC r297921: Add hint.ahci.X.quirks tunable for some odd cases.

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

7 years agoMFC r297963: Remove watchdog timer stop check.
mav [Tue, 3 May 2016 07:49:40 +0000 (07:49 +0000)]
MFC r297963: Remove watchdog timer stop check.

There are bunch of reports that this check fails at least on Nuvoton
NCT6776 chips.  I don't see why this check needed there, and Linux does
not have it either.  So far this check only made watchdogd unstopable.

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

7 years agoMFC r297243: Polish wbwd(4) driver and add more supported chips.
mav [Tue, 3 May 2016 07:48:52 +0000 (07:48 +0000)]
MFC r297243: Polish wbwd(4) driver and add more supported chips.

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

7 years agoMFC r298192: MFV r298178:
delphij [Mon, 2 May 2016 05:46:47 +0000 (05:46 +0000)]
MFC r298192: MFV r298178:

Update file to 5.26.

Relnotes: yes

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

7 years agoMFC r298888: typo
jamie [Sun, 1 May 2016 16:49:32 +0000 (16:49 +0000)]
MFC r298888: typo

Submitted by: Jimmy Olgeni

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

8 years agoMFC r295471:
jamie [Sat, 30 Apr 2016 15:06:18 +0000 (15:06 +0000)]
MFC r295471:

  Add new rc.conf parameter "jail_reverse_stop"

  When a user defines "jail_list" in rc.conf the jails are started in the
  order defined. Currently the jails are not are stopped in reverse order
  which may break dependencies between jails/services and prevent a clean
  shutdown. The new parameter "jail_reverse_stop" will shutdown jails in
  "jail_list" in reverse order when set to "YES".

  Please note that this does not affect manual invocation of the jail rc
  script. If a user runs the command

    # service jail stop jail1 jail2 jail3

  the jails will be stopped in exactly the order specified regardless of
  jail_reverse_stop being defined in rc.conf.

MFC r295568:

  Document the new jail_reverse_stop parameter

  While here clean up the documentation for jail_list

PR: 196152
Submitted by: feld

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

8 years agoMFC r298525:
wblock [Sat, 30 Apr 2016 14:47:45 +0000 (14:47 +0000)]
MFC r298525:

Add a single example of adding a user that roughly corresponds with the
adduser example in the Handbook.

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

8 years agoMFC r298735
arybchik [Sat, 30 Apr 2016 06:35:20 +0000 (06:35 +0000)]
MFC r298735

sfxge(4): do not use RxQ index as label

Labels are limitted by 32 on EF10. It is not sufficient on powerful hosts.
Since only one RxQ is running over each EvQ, zero label may be used.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
PR:             208267
Differential Revision:  https://reviews.freebsd.org/D6121

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

8 years agoMFC r298584:
jamie [Sat, 30 Apr 2016 04:02:32 +0000 (04:02 +0000)]
MFC r298584:

  Note the existence of module-specific jail paramters, starting with the
  linux.* parameters when linux emulation is loaded.

MFC r298585:

  Encapsulate SYSV IPC objects in jails.  Define per-module parameters
  sysvmsg, sysvsem, and sysvshm, with the following bahavior:

  inherit: allow full access to the IPC primitives.  This is the same as
  the current setup with allow.sysvipc is on.  Jails and the base system
  can see (and moduly) each other's objects, which is generally considered
  a bad thing (though may be useful in some circumstances).

  disable: all no access, same as the current setup with allow.sysvipc off.

  new: A jail may see use the IPC objects that it has created.  It also
  gets its own IPC key namespace, so different jails may have their own
  objects using the same key value.  The parent jail (or base system) can
  see the jail's IPC objects, but not its keys.

PR: 48471

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

8 years agoMFC r297367:
jamie [Sat, 30 Apr 2016 04:01:22 +0000 (04:01 +0000)]
MFC r297367:

  Move the various per-type arrays of OSD data into a single structure array.

MFC r297422:

  Add osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation
  of an OSD array.

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

8 years agoMFC r298565:
jamie [Sat, 30 Apr 2016 03:19:07 +0000 (03:19 +0000)]
MFC r298565:

  Add a new jail OSD method, PR_METHOD_REMOVE.  It's called when a jail is
  removed from the user perspective, i.e. when the last pr_uref goes away,
  even though the jail mail still exist in the dying state.  It will also
  be called if either PR_METHOD_CREATE or PR_METHOD_SET fail.

MFC r298683:

  Delay removing the last jail reference in prison_proc_free, and instead
  put it off into the pr_task.  This is similar to prison_free, and in fact
  uses the same task even though they do something slightly different.

MFC r298566:

  Pass the current/new jail to PR_METHOD_CHECK, which pushes the call
  until after the jail is found or created.  This requires unlocking the
  jail for the call and re-locking it afterward, but that works because
  nothing in the jail has been changed yet, and other processes won't
  change the important fields as long as allprison_lock remains held.

  Keep better track of name vs namelc in kern_jail_set.  Name should
  always be the hierarchical name (relative to the caller), and namelc
  the last component.

MFC r298668:

  Use crcopysafe in jail_attach.

PR: 48471

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

8 years agoMFC r298564:
jamie [Sat, 30 Apr 2016 03:05:36 +0000 (03:05 +0000)]
MFC r298564:

  Remove the PR_REMOVE flag, which was meant as a temporary marker for
  a jail that might be seen mid-removal.  It hasn't been doing the right
  thing since at least the ability to resurrect dying jails, and such
  resurrection also makes it unnecessary.

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

8 years agoMFC r298664
kp [Fri, 29 Apr 2016 20:19:41 +0000 (20:19 +0000)]
MFC r298664

msdosfs: Prevent buffer overflow when expanding win95 names

In win2unixfn() we expand Windows 95 style long names. In some cases that
requires moving the data in the nbp->nb_buf buffer backwards to make room. That
code failed to check for overflows, leading to a stack overflow in win2unixfn().

We now check for this event, and mark the entire conversion as failed in that
case. This means we present the 8 character, dos style, name instead.

PR: 204643
Differential Revision:      https://reviews.freebsd.org/D6015

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

8 years agoMFC r297696 and r298424:
hselasky [Fri, 29 Apr 2016 11:37:06 +0000 (11:37 +0000)]
MFC r297696 and r298424:
Add new USB quirks.

Submitted by: AJ <aleksanderlothe@live.com>
PR: 208623
Submitted by: Naram Qashat <cyberbotx@cyberbotx.com>
PR: 208642

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

8 years agoMFC r298458:
hselasky [Fri, 29 Apr 2016 11:29:52 +0000 (11:29 +0000)]
MFC r298458:
Add missing set of the current VNET when inputting IP packets in IPoIB.

This fixes a kernel panic when using IPoIB with VIMAGE and infiniband.

PR: 208957
Sponsored by: Mellanox Technologies
Tested by: Justin Clift <justin@postgresql.org>

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

8 years agoMFC r297968:
hselasky [Fri, 29 Apr 2016 11:18:48 +0000 (11:18 +0000)]
MFC r297968:
Remove some unused fields.

Sponsored by: Mellanox Technologies

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

8 years agoMFC r297967:
hselasky [Fri, 29 Apr 2016 11:14:02 +0000 (11:14 +0000)]
MFC r297967:
Ensure the received IP header gets 32-bits aligned.

The FreeBSD's TCP/IP stack assumes that the IP-header is 32-bits aligned
when decoding it. Else unaligned 32-bit memory access can happen, which
not all processor architectures support.

Sponsored by: Mellanox Technologies

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

8 years agoMFC r297966:
hselasky [Fri, 29 Apr 2016 11:06:24 +0000 (11:06 +0000)]
MFC r297966:
Add missing port_up checks.

When downing a mlxen network adapter we need to check the port_up variable
to ensure we don't continue to transmit data or restart timers which can
reside in freed memory.

Sponsored by: Mellanox Technologies

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

8 years agoMFC r298640:
pfg [Fri, 29 Apr 2016 03:12:14 +0000 (03:12 +0000)]
MFC r298640:
ed(1): switch two statements so we check the index before dereferencing.

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

8 years agoMFC r298551, r298679, r298680:
pfg [Fri, 29 Apr 2016 03:04:56 +0000 (03:04 +0000)]
MFC r298551, r298679, r298680:
fsck_ffs: use uint32_t for closedisk().

fs_ncg is of type uint32_t, and we were indexing it with an int.
Fixed this using an unsigned type.

Reviewed by: mckusick

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

8 years agoMFC r298530:
pfg [Fri, 29 Apr 2016 02:56:03 +0000 (02:56 +0000)]
MFC r298530:
patch(1): avoid signed integer overflow when debugging.

Integer i is used to index p_end of type LINENUM (actually long).
Match the types.

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

8 years agoMFC r298562:
jamie [Thu, 28 Apr 2016 01:40:47 +0000 (01:40 +0000)]
MFC r298562:

  Make jail(8) interpret escape codes in fstab the same as getfsent(3).

PR: 208663

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

8 years agoMFC r298516:
jamie [Thu, 28 Apr 2016 01:31:07 +0000 (01:31 +0000)]
MFC r298516:

  Don't remove the /var/run/jail_name.id file if a jail fails to start.
  This messes up ezjail (and possibly others), when attempting to start
  a jail that already exists.

PR: 208806
Reviewed by: tj

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

8 years agoMFC r298521;
pfg [Thu, 28 Apr 2016 01:11:25 +0000 (01:11 +0000)]
MFC r298521;
regex: prevent two improbable signed integer overflows.

In matcher() we used an integer to index nsub of type size_t.
In print() we used an integer to index nstates of type sopno,
typedef'd long.
In both cases the indexes never take negative values.

Match the types to avoid any error.

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

8 years agoMFC r298518:
pfg [Thu, 28 Apr 2016 01:05:40 +0000 (01:05 +0000)]
MFC r298518:
ext2_htree_release(): prevent signed integer overflow in a loop.

h_levels_num, as most data structs in ext2fs, is unsigned so
the index that addresses it has to be unsigned as well.

To get to overflow here we would probably be considering a
degenerate case though.

MFC after: 5 days

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

8 years agoMFC 297932,298295:
jhb [Wed, 27 Apr 2016 23:04:42 +0000 (23:04 +0000)]
MFC 297932,298295:
Improvements for PCI passthru devices.

297932:
Handle PBA that shares a page with MSI-X table for passthrough devices.

If the PBA shares a page with the MSI-X table, map the shared page via
/dev/mem and emulate accesses to the portion of the PBA in the shared
page by accessing the mapped page.

298295:
Always emit an error message on passthru configuration errors.

Previously, many errors (such as the PCI device not being attached
to the ppt(4) driver) resulted in bhyve silently exiting without
starting the virtual machine.  Now any errors encountered when
configuring a virtual slot for a PCI passthru device should be noted
on stderr.

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

8 years agoMFC 297039,297374,297398,297484:
jhb [Wed, 27 Apr 2016 19:12:49 +0000 (19:12 +0000)]
MFC 297039,297374,297398,297484:
Poll the IPI status while waiting constantly instead of delaying
5 microseconds between checks.  This avoids inserting a minimum
latency of 5 microseconds on each IPI.

297039:
Check IPI status more frequently when waiting.

An IPI cannot be sent via the local APIC if a previous IPI is still
being delivered.  Attempts to send an IPI will wait for a pending IPI
to clear.  Prior to r278325 these checks used a spin loop with a
hardcoded maximum count which broke AP startup on some systems.
However, r278325 also enforced a minimum latency of 5 microseconds if an
IPI was still pending which resulted in a measurable performance hit.
This change reduces that minimum latency to 1 microsecond.

297374:
Calibrate the frequency of the of the native_lapic_ipi_wait() loop,
and avoid a delay while waiting for IPI delivery acknowledgement in
xAPIC mode.  This makes the loop exit immediately after the delivery
bit in APIC_ICR register is set, instead of waiting for some
microseconds.

We only need to ensure that some amount of time is allowed for the
LAPIC to react to the command, and we need that the wait time is
finite and reasonable.  For that reasons, it is irrelevant if the CPU
frequency or throttling decrease the speed and make the loop,
calibrated for full CPU speed at boot time, execute somewhat slower.

297398:
Fix several bugs in r297374:
- fix UP build [1]
- do not obliterate initial reading of rdtsc by the loop counter [2]
- restore the meaning of the argument -1 to native_lapic_ipi_wait()
  as wait until LAPIC acknowledge without timeout
- correct formula for calculating loop iteration count for 1us, it was
  inverted, and ensure that even on unlikely slow CPUs at least one
  check for ack is performed.

297484:
Style(9), use tabs for the #define LOOPS line.
Print unsigned values with %u.
Make code slightly more compact by inlining loop limit.

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

8 years agoMFC r298524:
bcr [Wed, 27 Apr 2016 16:23:16 +0000 (16:23 +0000)]
MFC r298524:

Define which of the username options (-u/-U) to jexec(8) is the default.
Bump Dd.

PR: 207587
Submitted by: dewayne@heuristicsystems.com.au
Sponsored by:   Essen Hackathon 2016

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

8 years agoMFC r298522:
bcr [Wed, 27 Apr 2016 15:48:47 +0000 (15:48 +0000)]
MFC r298522:

The default value of MINFREE is defined to be 8% in
ufs/ffs/fs.h and not 10%.  The newfs(8) and tunefs(8)
man pages had this change already, but fs(5) did not.
This change makes it consistent again.

Bump Dd.

PR:             204929
Submitted by:   amutu@amutu.com
Sponsored by:   Essen Linuxhotel Hackathon 2016

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

8 years agoMFC r298695: MFV r298691: ntp 4.2.8p7.
delphij [Wed, 27 Apr 2016 15:24:33 +0000 (15:24 +0000)]
MFC r298695: MFV r298691: ntp 4.2.8p7.

Security: CVE-2016-1547, CVE-2016-1548, CVE-2016-1549, CVE-2016-1550
Security: CVE-2016-1551, CVE-2016-2516, CVE-2016-2517, CVE-2016-2518
Security: CVE-2016-2519
Security: FreeBSD-SA-16:16.ntp
With hat: so

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

8 years agoMFC r298482:
pfg [Tue, 26 Apr 2016 17:39:54 +0000 (17:39 +0000)]
MFC r298482:
Cleanup redundant parenthesis from existing howmany()/roundup() macro uses.

Requested by: dchagin

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