]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
6 years agoMFC r318703:
ngie [Tue, 18 Jul 2017 18:35:41 +0000 (18:35 +0000)]
MFC r318703:

__iconv_get_list: separate .Nm entries with commas

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

6 years agoMFC r318707:
ngie [Tue, 18 Jul 2017 18:34:16 +0000 (18:34 +0000)]
MFC r318707:

sctp_send(3): start sentences on new lines

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

6 years agoMFC r318280:
ngie [Tue, 18 Jul 2017 18:33:05 +0000 (18:33 +0000)]
MFC r318280:

getconf: use nitems(..) to compute NWORDS instead of hardcoding
the equivalent macro

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

6 years agoMFC r318704,r318708,r318709:
ngie [Tue, 18 Jul 2017 18:23:54 +0000 (18:23 +0000)]
MFC r318704,r318708,r318709:

r318704:

posix1e(3): reference using the section (3) when referencing libbsm with .Xr

r318708:

acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS

r318709:

acl_to_text(3): start sentences on new lines

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

6 years agoMFC r318710:
ngie [Tue, 18 Jul 2017 18:21:00 +0000 (18:21 +0000)]
MFC r318710:

quick_exit(3): delete trailing whitespace in licensing tort

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

6 years agoMFC r318718,r318719,r318720,r318721:
ngie [Tue, 18 Jul 2017 18:15:45 +0000 (18:15 +0000)]
MFC r318718,r318719,r318720,r318721:

r318718:

rctl_add_rule(2): fix manlint warnings

- Fix commas (either missing or misused) after .Nm entries in SYNOPSIS

r318719:

open(2): fix manlint warnings

- Sort SEE ALSO .Xr entries.
- Sort sections (HISTORY comes after STANDARDS).

r318720:

ptrace(2): clean up trailing whitespace

r318721:

kill(2): add missing section for sysctl(9)

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

6 years agoMFC r319048,r319049,r319051,r319054:
ngie [Tue, 18 Jul 2017 18:09:26 +0000 (18:09 +0000)]
MFC r319048,r319049,r319051,r319054:

r319048:

Push `snapshot_file` copying down into run_tests function, and mark snapshot_file
const char *.

This fixes a bogus set of errors from gcc about strdup not being allowed a NULL
argument.

r319049:

Bump WARNS from 1 to 3 after recent commits to fix warnings in the
directory.

Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0

r319051:

hostent_test_getnameinfo_eq(..): initialize found_a_host to false

CID: 1368943

r319054:

hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done

This plugs a leak of memory allocated via getaddrinfo.

CID: 1346866

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

6 years agoMFC r316552,r319662:
ngie [Tue, 18 Jul 2017 17:51:33 +0000 (17:51 +0000)]
MFC r316552,r319662:

r316552:

atf-c: fix documentation description for atf_utils_wait(3)

atf_utils_wait(3) should be used in combination with atf_utils_fork(3),
not itself (atf_utils_wait(3)).

r319662:

Add MLINKS for atf-sh(3) to each of the functions it implements

This hopefully will make atf-sh(3) easier to understand for newcomers,
without having to go through the atf-sh(3) level of indirection.

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

6 years agoMFC r302500,r319339,r319543,r319544,r319551,r321138:
ngie [Tue, 18 Jul 2017 17:36:25 +0000 (17:36 +0000)]
MFC r302500,r319339,r319543,r319544,r319551,r321138:

r302500 (by cem):

dd(1): Enable access to SIZE_T_MAX character devices

On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking
character devices to negative off_t values.  This enables dd(1) to interact
with kernel KVA in /dev/kmem on amd64, for example.

r319339 (by asomers):

Fix integer overflow detection in dd

dd(1) tried to detect whether the seek offset would overflow, but it failed
to account for the case where the provided argument was negative and the
file was a regular file (negative seeks are allowed for character devices).
I fixed it, and added a regression test.

CID: 1368659

r319543:

Stylistic tweaks

Move opening braces of functions from the last column to column 0.

MFC with: r319339

r319544:

Mark :seek_overflow as an expected failure

MFC with: r319339
PR: 219757

r319551 (by asomers):

Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS

Split the postive and negative parts into separate test cases.  The positive
test case can only run on ZFS, because only ZFS supports files that large.

PR: 219757

r321138:

Remove unnecessary make logic added in r319339

This makes the change cleaner and easier to backport to ^/stable/10.

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

6 years agoMFC r319800,r319806:
ngie [Tue, 18 Jul 2017 17:16:58 +0000 (17:16 +0000)]
MFC r319800,r319806:

r319800:

Don't explicitly get the class to PART in gctl_test_helper.c

This will allow the tool to be used with arbitrary geom(4) classes, like GEOM.

Specify class=PART explicitly in the tester to keep existing behavior.

r319806:

Improve handling with system state

- Always unlink $cmd after exit via END block.
- The tests don't function well if kern.geom.debugflags != 0. Save debugflags,
  then restore them at the end of the test.

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

6 years agoMFC r318255:
ngie [Tue, 18 Jul 2017 16:58:52 +0000 (16:58 +0000)]
MFC r318255:

Add missing braces around MCAST_EXCLUDE check when KTR support is
compiled into the kernel

This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly
decremented for MLD-layer source datagrams when inspecting im*s_st[1]
(the second state in the structure).

PR: 217509 [1]

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

6 years agoMFC r319850:
ngie [Tue, 18 Jul 2017 16:49:24 +0000 (16:49 +0000)]
MFC r319850:

Add some initial basic tests for du(1)

Tests that exercise the following flags are added in this commit:
- -A
- -H
- -I
- -g
- -h
- -k
- -m

Additional tests will be added soon.

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

6 years agoMFC r268030,r268793,r303212,r319642,r319830:
ngie [Tue, 18 Jul 2017 16:27:10 +0000 (16:27 +0000)]
MFC r268030,r268793,r303212,r319642,r319830:

r268030 (by eadler):

chown: add a test

Add a test for the chown utility. This sets up chown(8) to be capable of being
tested.  As such, only add one test for now as an example.

r268793 (by eadler):

chown: Fix chown test number

r303212 (by bdrewery):

Move chown tests to proper path

r319642:

Add some basic tests for chmod(1)

r319830:

Add more simple positive tests for chown(1)

The tests are largely symmetric with the tests for chmod(1)--added in r319642.

Remove chown-f_test (added in r268030) since the test coverage is now being
provided by `chown_test`.

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

6 years agoMFC r319842:
ngie [Tue, 18 Jul 2017 08:54:35 +0000 (08:54 +0000)]
MFC r319842:

getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE
gets output via warnx(3)

This helps set expectations for how one might deal with those messages, i.e.,
mute output from /dev/stderr today, since that's where vwarn(3) outputs messages
to today.

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

6 years agoMFC r318695:
ngie [Tue, 18 Jul 2017 08:50:36 +0000 (08:50 +0000)]
MFC r318695:

err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`

This is being done to aid humans and static analysis checkers.

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

6 years agoMFC r319844,r319845:
ngie [Tue, 18 Jul 2017 08:44:38 +0000 (08:44 +0000)]
MFC r319844,r319845:

r319844:

Add positive and negative testcases for cam_get_device(3)

r319845:

Remove stdlib.h #include added in r319844

A previous iteration of the tests I added in r319844 involved free(3), but
that attempt didn't pan out, so I switched to stack allocated buffers instead
of heap allocated ones, making the #include unnecessary.

MFC with: r319844

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

6 years agoMFC r318705:
ngie [Tue, 18 Jul 2017 08:33:29 +0000 (08:33 +0000)]
MFC r318705:

fopen(3): make manlint fixes

- Break on new lines.
- Use .Dv with NULL.
- Rewrap lines as necessary/when possible.

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

6 years agoMFC r316558:
ngie [Tue, 18 Jul 2017 08:30:58 +0000 (08:30 +0000)]
MFC r316558:

Use __FBSDID instead of the license agreement to embed the $FreeBSD$ RCS keyword

Reminded by a comment made by markj w.r.t. using __FBSDID in .c files ala a
past Phabricator review.

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

6 years agoMFC r316549,r316550,r316551,r316554:
ngie [Tue, 18 Jul 2017 08:28:14 +0000 (08:28 +0000)]
MFC r316549,r316550,r316551,r316554:

r316549:

Add sys/types.h #include to EXAMPLE to provide a complete functional
standalone example program

r316550:

sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries

This shortens the column count on many lines considerably.

While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9)
recommendations.

r316551:

sbuf(9): clarify kernel-only APIs

- move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as
  all three functions are kernel-only APIs.
- add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to
  make it visually clear that they are kernel-only APIs.

r316554:

sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9)

These functions were added in r279992.

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

6 years agoMFC r316557:
ngie [Tue, 18 Jul 2017 08:23:21 +0000 (08:23 +0000)]
MFC r316557:

sbuf(3): add some basic functional tests for the library

Areas not covered still [positive functionality wise] are:
- sbuf_{clear,get,set}_flags
- sbuf_new (in particular, with fixed buffers, etc).

Some basic negative testing has been added, but more will be added in the
future.

This work was in part to validate work done by cem in r288223, and ian
before that.

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

6 years agoMFC r279992,r280149,r280193,r288223,r288484,r321109:
ngie [Tue, 18 Jul 2017 08:15:02 +0000 (08:15 +0000)]
MFC r279992,r280149,r280193,r288223,r288484,r321109:

r279992 (by ian):

Add a new flag, SBUF_INCLUDENUL, and new get/set/clear functions for flags.

The SBUF_INCLUDENUL flag causes the nulterm byte at the end of the string
to be counted in the length of the data.  If copying the data using the
sbuf_data() and sbuf_len() functions, or if writing it automatically with
a drain function, the net effect is that the nulterm byte is copied along
with the rest of the data.

r280149 (by ian):

Update an sbuf assertion to allow for the new SBUF_INCLUDENUL flag.  If
INCLUDENUL is set and sbuf_finish() has been called, the length has been
incremented to count the nulterm byte, and in that case current length is
allowed to be equal to buffer size, otherwise it must be less than.

Add a predicate macro to test for SBUF_INCLUDENUL, and use it in tests, to
be consistant with the style in the rest of this file.

r280193 (by ian):

The minimum sbuf buffer size is 2 bytes (a byte plus a nulterm), assert that.

Values smaller than two lead to strange asserts that have nothing to do
with the actual problem (in the case of size=0), or to writing beyond the
end of the allocated buffer in sbuf_finish() (in the case of size=1).

r288223 (by cem):

sbuf: Process more than one char at a time

Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and
fixup callers.

Add a thin shim around sbuf_put_bytes() with the old ABI to avoid ugly
changes to some callers.

Obtained from: Dan Sledz

r288484 (by phk):

Fail the sbuf if vsnprintf(3) fails.

r321109:

Fix whitespace regression accidentally checked in via ^/head@r280149

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

6 years agoMFC r307873,r314397,r314399,r314419,r314420,r314533,r316553:
ngie [Tue, 18 Jul 2017 06:45:41 +0000 (06:45 +0000)]
MFC r307873,r314397,r314399,r314419,r314420,r314533,r316553:

r307873 (by marcel):

Include <stdarg.h> instead of <machine/stdarg.h> when compiled as
part of libsbuf. The former is the standard header, and allows us
to compile libsbuf on macOS/linux.

r314397 (by scottl):

Implement sbuf_prf(), which takes an sbuf and outputs it
to stdout in the non-kernel case and to the console+log
in the kernel case.  For the kernel case it hooks the
putbuf() machinery underneath printf(9) so that the buffer
is written completely atomically and without a copy into
another temporary buffer.  This is useful for fixing
compound console/log messages that become broken and
interleaved when multiple threads are competing for the
console.

r314399 (by scottl):

Add prototype for sbuf_putbuf()

r314419 (by jkim):

Include stdio.h to fix libsbuf build.

r314420 (by scottl):

Provide a comment on why stdio.h needs to be included.

r314533 (by scottl):

Expose the sbuf_putbuf() symbol to libsbuf.  There are a few other symbols
that are present but not exposed, like get/set/clear flags, not sure if they
need to be exposed at this point.

r316553:

sbuf(3): expose sbuf_{clear,get,set}_flags(3) via libsbuf

These functions were added to sbuf(9) in r279992, but never
exposed to userspace. Expose them now so they can be used/tested.

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

6 years agoMFC r319836:
ngie [Mon, 17 Jul 2017 21:19:29 +0000 (21:19 +0000)]
MFC r319836:

stat(1): sort flags in the DESCRIPTION section

-x's description should come after -t's description.

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

6 years agoMFC r319846:
ngie [Mon, 17 Jul 2017 21:18:44 +0000 (21:18 +0000)]
MFC r319846:

du(1): trivial whitespace cleanup

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

6 years agoMFC r319856,r320172,r320173:
ngie [Mon, 17 Jul 2017 21:13:43 +0000 (21:13 +0000)]
MFC r319856,r320172,r320173:

r319856:

Add a testcase for `ln -sF`

The testcase fails today, so mark it with atf_expect_fail: in
particular, the target (B) isn't being unlinked and the documentation
doesn't suggest special handling for directories. Thus, there's either
a doc or an implementation bug in ln(1) that needs to be resolved.

MFC with: r319714, r319854, r319855
PR: 219943

r320172:

ln(1): fix -F behavior

When '-F' option is used, the target directory needs to be unlinked.
Currently, the modified target ("target/source") is being unlinked, and
since it doesn't yet exist, the original target isn't removed.
This is fixed by skipping the block where target is modified to
"target/source" when '-F' option is set.
Hence, a symbolic link (with the same name as of the original target) to
the source_file is produced.

Update the test for ln(1) to reflect fix for option '-F'

PR: 219943

r320173:

Don't expect :sF_flag to fail anymore

While here, also add a check to verify that the link target
is updated in the testcase

MFC with: r320172
PR: 219943

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

6 years agoMFC r319857:
ngie [Mon, 17 Jul 2017 21:12:02 +0000 (21:12 +0000)]
MFC r319857:

ln(1): wordsmith -F option description

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

6 years agoMFC r319857:
ngie [Mon, 17 Jul 2017 21:10:08 +0000 (21:10 +0000)]
MFC r319857:

ln(1): wordsmith -F option description

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

6 years agoMFC r319928:
ngie [Mon, 17 Jul 2017 21:09:35 +0000 (21:09 +0000)]
MFC r319928:

Use nitems(..) when computing `max` instead of the longhand version of
the same logic

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

6 years agoMFC r319834,r319841,r320723,r320724:
ngie [Mon, 17 Jul 2017 21:01:07 +0000 (21:01 +0000)]
MFC r319834,r319841,r320723,r320724:

r319834:

Write up some basic tests for readlink(1)

The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic).

r319841:

Add initial tests for stat(1)

Testcases for -H, -L, and -f haven't been implemented yet, in part due
to additional complexity needed to validate the features:
* -H and -f will require an external "helper" program to display/modify
  the state/permissions for a given path.
* -L is being covered partially via the -n testcase today.

r320723:

Use %e instead of %d with x_output_date(..)

stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC with: r319841

r320724:

:l_flag:: be more aggressive when normalizing whitespace

Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC with: r319841

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

6 years agoMFC r318325:
ngie [Mon, 17 Jul 2017 20:57:38 +0000 (20:57 +0000)]
MFC r318325:

Start writing up some basic feature tests for procstat

These tests query a running process for information related to the -b,
-c, -e, and -f flags; the -f testcase is largely stubbed out, pending
additional work to determine a good, deterministic descriptor.

Core file test support is coming soon--it requires a bit more effort
due to the fact that:
- coredumps can be disabled (kern.coredump=0).
- corefiles can be put in different directories than the current
  directory, or be named something other than `<prog>.core`
  (`kern.corefile`).

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

6 years agoMFC r320472,r320508,r320509:
kib [Mon, 17 Jul 2017 14:09:34 +0000 (14:09 +0000)]
MFC r320472,r320508,r320509:
Make stdio deferred cancel-safe.

Requested by: eugen

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

6 years agoMFC r320988:
bapt [Mon, 17 Jul 2017 09:26:42 +0000 (09:26 +0000)]
MFC r320988:

Update pci_vendors to 2017.07.13

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

6 years agoMFC r320468:
delphij [Mon, 17 Jul 2017 06:46:57 +0000 (06:46 +0000)]
MFC r320468:

Don't bother to set target for SEEK_END.

While there also collapase SEEK_END into default case in lseek.

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

6 years agoMFC r320433:
delphij [Mon, 17 Jul 2017 06:37:46 +0000 (06:37 +0000)]
MFC r320433:

Use strlcpy() instead of strncpy() and nul-terminating.

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

6 years agoMFC r320986:
delphij [Mon, 17 Jul 2017 06:28:34 +0000 (06:28 +0000)]
MFC r320986:

Update arcmsr(4) to 1.40.00.00 in order to add support of
ARC-1884 SATA RAID controllers.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>

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

6 years agoMFC: r320458
rmacklem [Sun, 16 Jul 2017 19:36:44 +0000 (19:36 +0000)]
MFC: r320458
Fix an NFSv3 client case that probably never happens.

If an NFSv3 server were to reply with weak cache consistency attributes,
but not post operation attributes, the client would use garbage attributes
from memory. This was spotted during work on the code for the NFSv4.1 client.
I have never seen evidence that this happens and it wouldn't make sense
for an NFSv3 server to do this, so this patch is basically "theoretical",
but does fix the problem if a server were to do the above.

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

6 years agoMFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid()
emaste [Sun, 16 Jul 2017 19:25:18 +0000 (19:25 +0000)]
MFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid()

PR: 218039
CID: 1008934
Reported by: Coverity, PVS-Studio
Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r320969:
gjb [Sun, 16 Jul 2017 17:36:23 +0000 (17:36 +0000)]
MFC r320969:
 Fix a missing comment marker.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC: r320345
rmacklem [Sat, 15 Jul 2017 19:24:54 +0000 (19:24 +0000)]
MFC: r320345
Add support to the NFSv4.1/pNFS client for commits through the DS.

A NFSv4.1/pNFS server using File Layout can specify that Commit operations
are to be done against the DS instead of MDS. Since no extant pNFS
server did this, the code was untested and "#ifdef notyet".
The FreeBSD pNFS server I am developing does specify that Commits be done
through the DS, so the code has been enabled/tested.
This patch should only affect the case of a pNFS server that specfies
Commits through the DS.

Relnotes: yes

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

6 years agoMFC r305994 (by emaste@):
dchagin [Sat, 15 Jul 2017 18:25:59 +0000 (18:25 +0000)]
MFC r305994 (by emaste@):

Catch up to sys/capability.h rename to sys/capsicum.h in r263232

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

6 years agoMFC r298071 (by pfg@):
dchagin [Sat, 15 Jul 2017 18:08:20 +0000 (18:08 +0000)]
MFC r298071 (by pfg@):

compat/linux: for pointers replace 0 with NULL.

plvc is a pointer, no functional change.

Found with devel/coccinelle.

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

6 years agoMFC r297597 (by bapt@):
dchagin [Sat, 15 Jul 2017 18:05:28 +0000 (18:05 +0000)]
MFC r297597 (by bapt@):

Add kern.features flags for linux and linux64 modules

kern.features.linux: 1 meaning linux 32 bits binaries are supported
kern.features.linux64: 1 meaning linux 64 bits binaries are supported

The goal here is to help 3rd party applications (including ports) to determine
if the host do support linux emulation

Relnotes: yes

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

6 years agoMFC r296503:
dchagin [Sat, 15 Jul 2017 17:44:29 +0000 (17:44 +0000)]
MFC r296503:

Linux accept() system call return EOPNOTSUPP errno instead of EINVAL
for UDP sockets.

MFC r296504:

Does not leak fp. While here remove bogus cast of fp->f_data.

MFC r313913:

Initialize cap_rights before use.

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

6 years agoMFC r281437 (by mjg@):
dchagin [Sat, 15 Jul 2017 17:28:03 +0000 (17:28 +0000)]
MFC r281437 (by mjg@):

Replace struct filedesc argument in getsock_cap with struct thread

This is is a step towards removal of spurious arguments.

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

6 years agoMFC r281436 (by mjg@):
dchagin [Sat, 15 Jul 2017 17:25:40 +0000 (17:25 +0000)]
MFC r281436 (by mjg@):

fd: remove filedesc argument from fdclose

Just accept a thread instead. This makes it consistent with fdalloc.

No functional changes.

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

6 years agoMFC r284613 (by tuexen@):
dchagin [Sat, 15 Jul 2017 17:03:35 +0000 (17:03 +0000)]
MFC r284613 (by tuexen@):

When using KTRACE, set a variable to the appropriate value and don't
leave it initialized at NULL.

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

6 years agoRegen after r321017.
dchagin [Sat, 15 Jul 2017 17:00:43 +0000 (17:00 +0000)]
Regen after r321017.
Move the SCTP syscalls to netinet with the rest of the SCTP code.

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

6 years agoMFC r272823:
dchagin [Sat, 15 Jul 2017 16:55:02 +0000 (16:55 +0000)]
MFC r272823:

Move the SCTP syscalls to netinet with the rest of the SCTP code.  The
syscalls themselves are tightly coupled with the network stack and
therefore should not be in the generic socket code.

The following four syscalls have been marked as NOSTD so they can be
dynamically registered in sctp_syscalls_init() function:
  sys_sctp_peeloff
  sys_sctp_generic_sendmsg
  sys_sctp_generic_sendmsg_iov
  sys_sctp_generic_recvmsg

The syscalls are also set up to be dynamically registered when COMPAT32
option is configured.

As a side effect of moving the SCTP syscalls, getsock_cap needs to be
made available outside of the uipc_syscalls.c source file.  A proper
prototype has been added to the sys/socketvar.h header file.

API tests from the SCTP reference implementation have been run to ensure
compatibility. (http://code.google.com/p/sctp-refimpl/source/checkout)

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

6 years agoTemporarily r284696:
dchagin [Sat, 15 Jul 2017 16:52:40 +0000 (16:52 +0000)]
Temporarily r284696:

MFC r284613. When using KTRACE, set a variable to the appropriate value
and don't leave it initialized at NULL.

Will MFC it after proper MFC of r272823.

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

6 years agoMFC r293908:
dchagin [Sat, 15 Jul 2017 15:26:38 +0000 (15:26 +0000)]
MFC r293908:

Regen after get_robust_list fix.

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

6 years agoMFC r293907 (glebius@) partially:
dchagin [Sat, 15 Jul 2017 15:21:43 +0000 (15:21 +0000)]
MFC r293907 (glebius@) partially:

Change linux get_robust_list system call to match actual linux one.
This is the forgotten part of r293897.

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

6 years agoMFC r292744:
dchagin [Sat, 15 Jul 2017 15:08:18 +0000 (15:08 +0000)]
MFC r292744:

Return EINVAL in case of incorrect sigev_signo value specified instead of panicing.

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

6 years agoMFC r281882(by trasz@):
dchagin [Sat, 15 Jul 2017 14:57:24 +0000 (14:57 +0000)]
MFC r281882(by trasz@):

Simplify linux_getcwd(), removing code that was longer used.

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

6 years agoMFC r281829 (by trasz@):
dchagin [Sat, 15 Jul 2017 14:48:31 +0000 (14:48 +0000)]
MFC r281829 (by trasz@):

Modify kern___getcwd() to take max pathlen limit as an additional
argument.  This will be used for the Linux emulation layer - for Linux,
PATH_MAX is 4096 and not 1024.

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

6 years agoMFC r320804:
kib [Sat, 15 Jul 2017 06:38:01 +0000 (06:38 +0000)]
MFC r320804:
Fix handling of one more possible exception on return to usermode.

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

6 years agoDocument SA-17:05.heimdal, EN-17:06.hyperv
gjb [Thu, 13 Jul 2017 16:18:46 +0000 (16:18 +0000)]
Document SA-17:05.heimdal, EN-17:06.hyperv

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r320876:
hselasky [Thu, 13 Jul 2017 15:10:02 +0000 (15:10 +0000)]
MFC r320876:
Make sure the mlx4en RX DMA ring gets stamped with software ownership
in order to prevent the flow of QP to error in the firmware once
UPDATE_QP is called.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r320755,r320762,r320893:
kib [Thu, 13 Jul 2017 08:33:02 +0000 (08:33 +0000)]
MFC r320755,r320762,r320893:
BIT_FLS(9).

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

6 years agoAdd deprecation notices for various device drivers removed in 12.0.
jhb [Wed, 12 Jul 2017 22:16:54 +0000 (22:16 +0000)]
Add deprecation notices for various device drivers removed in 12.0.

This is a direct commit to stable/10 since these files have already
been removed in head.

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

6 years agoMFC r300761, r300762:
gjb [Wed, 12 Jul 2017 11:40:09 +0000 (11:40 +0000)]
MFC r300761, r300762:
 r300761:
  Disconnect the AZURE target from the CLOUDWARE list.

  Microsoft has graciously overtaken publication of FreeBSD
  on Azure since 10.3-RELEASE.

  Many thanks to Microsoft for their support of FreeBSD on
  Azure.

 r300762:
  Disconnect the OPENSTACK target from the CLOUDWARE list.

  This was reported to not work as expected, and feedback
  following the report was never received.  In addition, we
  do not publish these anywhere publicly.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r320906: MFV r320905: Import upstream fix for CVE-2017-11103.
delphij [Wed, 12 Jul 2017 07:26:07 +0000 (07:26 +0000)]
MFC r320906: MFV r320905: Import upstream fix for CVE-2017-11103.

In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Submitted by: hrs
Obtained from: Heimdal
Security: FreeBSD-SA-17:05.heimdal
Security: CVE-2017-11103

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

6 years agoMFC: r320577, r320620
marius [Tue, 11 Jul 2017 21:52:11 +0000 (21:52 +0000)]
MFC: r320577, r320620

Retry up to 2 ms to enable bus power as at least with some Intel
SDHCI/eMMC controllers the first attempt after a D3 to D0 transition,
i. e. when the firmware has put the devices into D3 state before,
can fail.

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

6 years agoMFC r320658:
kib [Tue, 11 Jul 2017 05:36:02 +0000 (05:36 +0000)]
MFC r320658:
When reporting undefined symbol, note the version, if specified.

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

6 years agoRemove waiters check from the inline rw wunlock routine.
mjg [Tue, 11 Jul 2017 03:45:47 +0000 (03:45 +0000)]
Remove waiters check from the inline rw wunlock routine.

This is a direct commit to stable/10.

r310979 is a merge of depessimisation of locking primitives.
The important part was getting rid of an attempt to grab the lock in the
slow path immediately after the fast path failed. In addition to that
temporary checks were added before all atomic ops. They have no impact on
semantic nor correctness, they only avoid an atomic operation which is
likely to fail.

After the addition of atomic_fcmpset and further changes said checks
became pessimal and got removed. This may get merged to stable/10.

Reports started showing up about a crash in all branches having extra
checks. The codepath is:
.. -> vm_map_delete -> __rw_wunlock_hard -> turnstile_broadcast

The kernel crashed trying to wake up nonexistent waiters. The lock value
as found in the vmcore matches the panicking thread, so in particular
there was no waiters bit set. The bit can only be cleared by the current
owner.

A debug patch was provided, which reportedly had a side effect of getting
rid of the issue.

Also one of the reporters said that reverting the patch which adds the
extra checks makes the crash go away.

It was also reported that head with the fcmpset changes (explicit checks
removed) also stops crashing.

Finally, one user tested crashing stable/10 variant with just the rw
wunlock check removed.

The common case in all but one reports was an Intel Atom cpu. Claiming
a cpu bug at this point is bold and I'm going to refrain from it, but
right now apart from cpu-specific optimisation made by the compiler on
custom kernel compiles I don't see how this can be a software bug.

This will have to be investigated more.

Meanwhile, restore rw wunlock to pre-r310979 state.

PR: 213903

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

6 years agoMFC r320619:
kib [Mon, 10 Jul 2017 06:08:44 +0000 (06:08 +0000)]
MFC r320619:
Resolve confusion between different error code spaces.

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

6 years agoMFC r320408:
pfg [Sun, 9 Jul 2017 15:14:22 +0000 (15:14 +0000)]
MFC r320408:
ext2fs: Support e2di_uid_high and e2di_gid_high.

The fields exist on all versions of the filesystem and using them is a mount
option on linux. For FreeBSD, the corresponding i_uid and i_gid are always
long enough so use them by default.

Reviewed by: Fedor Uporov

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

6 years agoMFC r320079:
pfg [Sun, 9 Jul 2017 15:09:15 +0000 (15:09 +0000)]
MFC r320079:
ext2fs: Enable RO huge_file feature support.

We have support for reading ext4 "huge" files but we can't write
(anything) on ext4. and some filesystem. Formally enable the feature
so that we can mount such filesystems.

Submitted by:    Fedor Uporov

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

6 years agoMFC 320675: Add deprecation notices for gdb and kgdb.
jhb [Sun, 9 Jul 2017 04:13:33 +0000 (04:13 +0000)]
MFC 320675: Add deprecation notices for gdb and kgdb.

Even though gdb and kgdb may not be removed for 12.0 on some architectures,
the notice is unconditional as these tools will likely be removed at some
point in the future when adequate replacements are available (gdb in ports
or lldb in base).

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

6 years agoMFC r320570:
kib [Sun, 9 Jul 2017 03:57:24 +0000 (03:57 +0000)]
MFC r320570:
Correct signatures of several pthreads stubs.

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

6 years agoMFC: r320208
rmacklem [Fri, 7 Jul 2017 21:33:06 +0000 (21:33 +0000)]
MFC: r320208
Ensure that the credentials field of the NFSv4 client open structure is
initialized.

bdrewery@ has reported panics "newnfs_copycred: negative nfsc_ngroups".
The only way I can see that this occurs is that the credentials field of
the open structure gets used before being filled in.
I am not sure quite how this happens, but for the file create case, the
code is serialized via the vnode lock on the directory. If, somehow, a
link to the same file gets created just after file creation, this might
occur.

This patch ensures that the credentials field is initialized to a reasonable
set of credentials before the structure is linked into any list, so I
this should ensure it is initialized before use.
I am committing the patch now, since bdrewery@ notes that the panics
are intermittent and it may be months before he knows if the patch fixes
his problem.

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

6 years agoMFC r319900:
asomers [Fri, 7 Jul 2017 15:35:42 +0000 (15:35 +0000)]
MFC r319900:

sbin/ipfw: strcpy, strncpy => strlcpy

Reported by: Coverity
CID: 13561621356166
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10662

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

6 years agoMFC r319337:
asomers [Fri, 7 Jul 2017 15:22:29 +0000 (15:22 +0000)]
MFC r319337:

Fix integer overflow in "camcontrol format"

Reported by: Coverity
CID: 1011426
Sponsored by: Spectra Logic Corp

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

6 years agoMFC r318790, r319336
asomers [Fri, 7 Jul 2017 15:09:08 +0000 (15:09 +0000)]
MFC r318790, r319336

r318790:
Fix a buffer overflow in bootparamd(8)

If /etc/bootparams contains a line with an excessively long pathname, and a
client asks for that path, then bootparamd will overflow a buffer and crash
while parsing that line.  This is not remotely exploitable since it requires
a malformed /etc/bootparams file.

Reported by: Coverity
CID: 1305954
Sponsored by: Spectra Logic Corp

r319336:
Fix uninitialized variable in bootparamd.c

Restore line that was accidentally deleted in change 318790

Reported by: Coverity
CID: 1375855
X-MFC-With: 318790
Sponsored by: Spectra Logic Corp

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

6 years agoMFC r310888:
eugen [Fri, 7 Jul 2017 11:54:45 +0000 (11:54 +0000)]
MFC r310888:

  Retry to open an F_PIPE process when it dies unexpectedly.

PR: 215335
Reviewed by: ae
Approved by: az (mentor)

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

6 years agoMFC 320490
sephe [Fri, 7 Jul 2017 09:38:40 +0000 (09:38 +0000)]
MFC 320490

    hyperv/input: Remove unnecessary inclusion.

    The unbreaks gcc compilation.

    Submitted by:   Ryan Libby
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D11415

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

6 years agoMFC r293295:
mjg [Thu, 6 Jul 2017 22:03:58 +0000 (22:03 +0000)]
MFC r293295:

cache: ansify functions and fix some style issues

No functional changes.

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

6 years agoMFC r320748:
gjb [Thu, 6 Jul 2017 18:46:33 +0000 (18:46 +0000)]
MFC r320748:
 Allow passing NOPKG= to make(1) to enable the pkg-stage target
 from getting executed when NOPKG is defined but empty.

Approved by: re (kib, insta-MFC)
Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r317161:
ngie [Thu, 6 Jul 2017 05:59:27 +0000 (05:59 +0000)]
MFC r317161:

which(1): sort #includes

No functional change [intended].

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

6 years agoRegenerate src.conf(5)
ngie [Thu, 6 Jul 2017 05:53:23 +0000 (05:53 +0000)]
Regenerate src.conf(5)

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

6 years agoMFC r317179:
ngie [Thu, 6 Jul 2017 05:51:20 +0000 (05:51 +0000)]
MFC r317179:

Clean up WITH*_PROFILE

- Clarify that profiled libraries are usable with gprof(8).
- Add WITH_PROFILE to complement WITHOUT_PROFILE and placate makeman.

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

6 years agoMFC r319626:
ngie [Thu, 6 Jul 2017 05:28:35 +0000 (05:28 +0000)]
MFC r319626:

Add basic tests for echo(1)

Verify that echo(1) does not...
- ... print the trailing newline character with option '-n'.
- ... print the trailing newline character when '\c' is appended to
      the end of the string.

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

6 years agoMFC r319637:
ngie [Thu, 6 Jul 2017 05:26:27 +0000 (05:26 +0000)]
MFC r319637:

Add testcases for `cat -b`

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

6 years agoMFC r319634:
ngie [Thu, 6 Jul 2017 05:22:10 +0000 (05:22 +0000)]
MFC r319634:

Add additional testcases for cat(1)

Verify the following additional cases:
- -s (in isolation, in addition to the -se testcase obtained via the
      NetBSD test).
- -vt

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

6 years agoFix up r319257
ngie [Thu, 6 Jul 2017 05:20:30 +0000 (05:20 +0000)]
Fix up r319257

PACKAGE support doesn't exist on ^/stable/10, so FILES must be used instead.
Furthermore, BINDIR isn't automatically set to ${TESTSDIR} on this branch.

This is a direct commit to ^/stable/10.

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

6 years agoMFC r320599:
gjb [Thu, 6 Jul 2017 00:43:43 +0000 (00:43 +0000)]
MFC r320599:
 Fix Vagrant image upload after recent API changes.

 - Update ATLAS_UPLOAD_URL to avoid various regular expressions
   from failing to match due to redirections.
 - Use ATLAS_UPLOAD_URL throughout the script.
 - Adjust several regular expression patterns.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r289861:
bdrewery [Wed, 5 Jul 2017 19:06:12 +0000 (19:06 +0000)]
MFC r289861:

  native-xtools: Replace common path with NXBDESTDIR.

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

6 years agoMFC r320644:
allanjude [Tue, 4 Jul 2017 15:53:54 +0000 (15:53 +0000)]
MFC r320644:
Add deprecation notices for all rcmd tools

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

6 years agoMFC: r320062, r320070, r320126
rmacklem [Tue, 4 Jul 2017 01:28:17 +0000 (01:28 +0000)]
MFC: r320062, r320070, r320126
This is a partial merge of only the NFS changes and not the maxbcachebuf
tunable.

The NFS client changes make the code handle different I/O sizes more
correctly. However, with the limit at 64K, they are not actually
necessary.
This MFC is mainly being done so that subsequent MFCs to the NFS
code will merge easily.

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

6 years agoMFC r319699
alc [Mon, 3 Jul 2017 22:21:44 +0000 (22:21 +0000)]
MFC r319699
  When allocating swap blocks, if the available number of free blocks in a
  subtree is already zero, then setting the "largest contiguous free block"
  hint for that subtree to anything other than zero makes no sense.  (To be
  clear, assigning a value to the hint that is too large is not a correctness
  problem, only a pessimization.)

MFC r319755
  blist_fill()'s return type is too narrow.  blist_fill() accepts a 64-bit
  quantity as the size of the range to fill, but returns a 32-bit quantity
  as the number of blocks that were allocated to fill that range.  This
  revision corrects that mismatch.

MFC r319793
  Remove an unnecessary field from struct blist.  (The comment describing
  what this field represented was also inaccurate.)

  In r178792, blist_create() grew a malloc flag, allowing M_NOWAIT to be
  specified.  However, blist_create() was not modified to handle the
  possibility that a malloc() call failed.  Address this omission.

  Increase the width of the local variable "radix" to 64 bits.  This
  matches the width of the corresponding field in struct blist.

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

6 years agoMFC: r319882
rmacklem [Mon, 3 Jul 2017 20:12:31 +0000 (20:12 +0000)]
MFC: r319882
Define NFS_MAXXDR as the upper bound on XDR overhead in an NFS RPC.

This definition is a part of the maxiotune2 patch that will be
committed soon.

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

6 years agoMFC r320421:
ken [Mon, 3 Jul 2017 15:34:19 +0000 (15:34 +0000)]
MFC r320421:

  ------------------------------------------------------------------------
  r320421 | ken | 2017-06-27 13:26:02 -0600 (Tue, 27 Jun 2017) | 37 lines

  Fix a panic in camperiphfree().

  If a peripheral driver (e.g. da, sa, cd) is added or removed from the
  peripheral driver list while an unrelated peripheral driver instance (e.g.
  da0, sa5, cd2) is going away and is inside camperiphfree(), we could
  dereference an invalid pointer.

  When peripheral drivers are added or removed (see periphdriver_register()
  and periphdriver_unregister()), the peripheral driver array is resized
  and existing entries are moved.

  Although we hold the topology lock while we traverse the peripheral driver
  list, we retain a pointer to the location of the peripheral driver pointer
  and then drop the topology lock.  So we are still vulnerable to the list
  getting moved around while the lock is dropped.

  To solve the problem, cache a copy of the peripheral driver pointer.  If
  its storage location in the list changes while we have the lock dropped, it
  won't have any effect.

  This doesn't solve the issue that peripheral drivers ("da", "cd", as opposed
  to individual instances like "da0", "cd0") are not generally part of a
  reference counting scheme to guard against deregistering them while there
  are instances active.  The caller (generally the person unloading a module)
  has to be aware of active drivers and not unload something that is in use.

  sys/cam/cam_periph.c:
   In camperiphfree(), cache a pointer to the peripheral driver
   instance to avoid holding a pointer to an invalid memory location
   in the event that the peripheral driver list changes while we have
   the topology lock dropped.

  PR: kern/219701
  Submitted by: avg
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
PR: kern/219701
Sponsored by: Spectra Logic

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

6 years agoMFC r320488:
gjb [Mon, 3 Jul 2017 13:02:21 +0000 (13:02 +0000)]
MFC r320488:
 Correct the branch naming convention in param.h.
 While here, consistently use upper-case 'X' to represent the
 version number.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r320093: Check return value of seteuid() and bail out if we fail.
delphij [Mon, 3 Jul 2017 05:30:31 +0000 (05:30 +0000)]
MFC r320093: Check return value of seteuid() and bail out if we fail.

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

6 years agoMFC r320494: Fix double free by reverting r300385 and r300624 which was
delphij [Mon, 3 Jul 2017 02:14:42 +0000 (02:14 +0000)]
MFC r320494: Fix double free by reverting r300385 and r300624 which was
false positive reported by cppcheck.

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

6 years agoMFC r320332:
kib [Sun, 2 Jul 2017 03:50:22 +0000 (03:50 +0000)]
MFC r320332:
Style.

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

6 years agoMFC r320049
alc [Sat, 1 Jul 2017 22:21:11 +0000 (22:21 +0000)]
MFC r320049
  Pages that are passed to swap_pager_putpages() should already be fully
  dirty.  Assert that they are fully dirty rather than redundantly calling
  vm_page_dirty() on them.

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

6 years agoMFC r320181
alc [Sat, 1 Jul 2017 20:08:45 +0000 (20:08 +0000)]
MFC r320181
  Eliminate an unused macro.

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

6 years agoMFC r319605
alc [Sat, 1 Jul 2017 19:24:53 +0000 (19:24 +0000)]
MFC r319605
  The variable "breakout" is used like a Boolean, so actually define it as
  one.

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

6 years agoMFC r318592: compress: Allow uncompress -c with multiple pathnames,
jilles [Sat, 1 Jul 2017 13:03:02 +0000 (13:03 +0000)]
MFC r318592: compress: Allow uncompress -c with multiple pathnames,
as required by POSIX.

Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating
the uncompressed data.

Passing multiple pathnames to compress -c remains disallowed, since the
result cannot be decompressed.

PR: 219387

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

6 years agoMFC r317912: sh: Fix INTOFF leak after a builtin with different locale
jilles [Sat, 1 Jul 2017 12:57:00 +0000 (12:57 +0000)]
MFC r317912: sh: Fix INTOFF leak after a builtin with different locale
settings.

After executing a builtin with different locale settings such as
  LC_ALL=C true
SIGINT handling was left disabled indefinitely.

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