]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r335886:
kp [Tue, 10 Jul 2018 07:29:51 +0000 (07:29 +0000)]
MFC r335886:

pfctl: Don't retrieve interface list if '-n' is set

If '-n' is set we don't use the list of skip interfaces, so don't retrieve it.
This fixes issues if 'pfctl -n' is used before the pf module is loaded. This
was broken by r333181.

Reported by: Jakub Chromy <hicks AT cgi.cz>

5 years agoMFC r334307, r335103-r335104
araujo [Tue, 10 Jul 2018 04:26:32 +0000 (04:26 +0000)]
MFC r334307, r335103-r335104

r334307:
Simplify macros EFPRINTF and EFFLUSH. [0]
Also stdarg(3) says that each invocation of va_start() must be paired
with a corresponding invocation of va_end() in the same function. [1]

Reported by: Coverity
CID: 1194318[0] and 1194332[1]
Discussed with: jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15548

r335103:
Fix style(9) space vs tab.

Reviewed by: jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15774

r335104:
Fix style(9) space vs tab.

Reviewed by: jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15768

5 years agoMFC r335655:
delphij [Tue, 10 Jul 2018 02:46:31 +0000 (02:46 +0000)]
MFC r335655:

Fix division by zero when reading boot block by postponing division
until it is necessary and after we validated bytes per sector is non-
zero.

Obtained from: Android https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/36362

5 years agoMFC r328489, r329232, r331836
jah [Tue, 10 Jul 2018 01:06:43 +0000 (01:06 +0000)]
MFC r328489, r329232, r331836

r328489:

Remove system makefile path directives from env passed to PORTS_MODULES step

Previously, MAKESYSPATH as well as '-m' directives in MAKEFLAGS would cause
any port rebuilt during the PORTS_MODULES stage to consume system makefiles
from $(SRCROOT)/share/mk instead of those installed under /usr/share/mk.
For kernel modules that need to build against an updated src tree this
makes sense; less so for <bsd.port.mk> or  any userspace library or utility
the port may also happen to install.

Before 11.0, this probably didn't matter much in practice.  But the addition
of src.libnames.mk under $(SRCROOT)/share/mk in 11.0 breaks any consumer of
bsd.prog.mk and DPADD/LDADD during PORTS_MODULES.

Address the build breakage by removing MAKESYSPATH and any occurrence of
'-m' from MAKEFLAGS in the environment created for the port build.
Instead set SYSDIR so that any kmod built by the port will still consume
conf/kmod.mk from the updated src tree, assuming it uses <bsd.kmod.mk>

r329232 (by bdrewery):

ports modules: Don't leak AUTO_OBJ changes into the port builds.

This came about when r328489 made ports modules builds no longer use the
in-tree share/mk files, but didn't cleanup MAKEOBJDIR from the
environment.

This fixes "Variable OBJTOP is recursive".

r331836:

Remove MK_AUTO_OBJ from env passed to PORTS_MODULES

This fixes a failure to resolve object file paths seen when buildkernel
(which sets MK_AUTO_OBJ=yes) and installkernel (which sets MK_AUTO_OBJ=no)
are run as separate steps.  r329232 partially fixed this scenario by removing
MAKEOBJDIR, but it seems the AUTO_OBJ setting also needs to be on the same
page for the build and install steps.

5 years agoMFC r333004
davidcs [Mon, 9 Jul 2018 21:13:21 +0000 (21:13 +0000)]
MFC r333004
  Fix Issue with adding MultiCast Addresses. When multicast addresses are
  added/deleted, the delete the multicast addresses previously programmed
  in HW and reprogram the new set of multicast addresses.

Submitted by: Vaishali.Kulkarni@cavium.com

5 years agoMFC r336029:
kib [Mon, 9 Jul 2018 13:38:19 +0000 (13:38 +0000)]
MFC r336029:
Style.

5 years agoMFC r335559:
delphij [Mon, 9 Jul 2018 06:02:45 +0000 (06:02 +0000)]
MFC r335559:

Don't bail out when we find primary and secondary bootblocks miscompare.
We do not have code to fix this situation, and the mismatch does not
prevent the kernel driver from consuming the file system, and some factory
formatted SD cards seem to have a garbage backup block.

This makes the code match to its comments (replacing pfatal with pwarn).

Inspired by: NetBSD r1.13
Inspired by: https://android.googlesource.com/platform/external/fsck_msdos/+/b47b16353f3db228711dded9f7c975b820059ddc

5 years agoMFC r335469: Don't leak tmpstr.
delphij [Mon, 9 Jul 2018 05:56:13 +0000 (05:56 +0000)]
MFC r335469: Don't leak tmpstr.

5 years agoMFC r335660:
markj [Sun, 8 Jul 2018 16:37:50 +0000 (16:37 +0000)]
MFC r335660:
Add missing MLINK.

5 years agopflog/pfsync: Fix module build with VIMAGE=yes
kp [Sun, 8 Jul 2018 10:54:11 +0000 (10:54 +0000)]
pflog/pfsync: Fix module build with VIMAGE=yes

pflog and pfsync's module Makefile fails to include opt_global.h to SRCS
leading to build error for VIMAGE case.

Reproduced with:
cd /usr/src/sys/modules/pflog && make VIMAGE=yes

PR: 229404
Submitted by: eugen@

5 years agoMFC r335980:
kib [Sun, 8 Jul 2018 06:50:34 +0000 (06:50 +0000)]
MFC r335980:
Silence warnings about unused variables when RACCT is defined but RCTL
is not.

5 years agoMFC r335976:
kib [Sun, 8 Jul 2018 06:49:11 +0000 (06:49 +0000)]
MFC r335976:
Add a name for the MSR controlling standard extended features report on AMD.

5 years agoMFC r335975:
kib [Sun, 8 Jul 2018 06:47:51 +0000 (06:47 +0000)]
MFC r335975:
Order the portion of the AMD-specific MSRs names definitions numerically.

5 years agoMFC r335580:
markj [Sat, 7 Jul 2018 17:58:20 +0000 (17:58 +0000)]
MFC r335580:
Re-count available PV entries after reclaiming a PV chunk.

5 years agoMFC r335816:
kp [Sat, 7 Jul 2018 14:46:02 +0000 (14:46 +0000)]
MFC r335816:

pfsync: Fix state sync during initial bulk update

States learned via pfsync from a peer with the same ruleset checksum were not
getting assigned to rules like they should because pfsync_in_upd() wasn't
passing the PFSYNC_SI_CKSUM flag along to pfsync_state_import.

PR: 229092
Submitted by: Kajetan Staszkiewicz <vegeta tuxpowered.net>
Obtained from: OpenBSD
Sponsored by: InnoGames GmbH

5 years agoMFC r335862:
ed [Sat, 7 Jul 2018 11:39:20 +0000 (11:39 +0000)]
MFC r335862:

  Document that syslogd -v has no effect when RFC 5424 mode is enabled.

  The variable it sets, LogFacPri, is only used in the RFC 3164 formatting
  codepath.

PR: 229457

5 years agoMFC r335861:
ed [Sat, 7 Jul 2018 11:38:44 +0000 (11:38 +0000)]
MFC r335861:

  Restore the order in which RFC 3164 messages with fac/pri are formatted.

  The refactoring of the syslogd code to format messages using iovecs
  slightly altered the output of syslogd by placing the facility/priority
  after the hostname, as opposed to printing it right before. This change
  reverts the behaviour to be consistent with how it was before.

PR: 229457

5 years agoMFC r335921:
jamie [Fri, 6 Jul 2018 19:10:11 +0000 (19:10 +0000)]
MFC r335921:

  Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8),
   sockstat(1), ugidfw(8)
  These are the last of the jail-aware userland utilities that didn't work
   with names.

PR: 229266
Differential Revision: D16047

5 years agoMFC r335283:
ian [Thu, 5 Jul 2018 16:15:17 +0000 (16:15 +0000)]
MFC r335283:

Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.

5 years agoMFC r333255, r333260
ian [Thu, 5 Jul 2018 16:12:48 +0000 (16:12 +0000)]
MFC r333255, r333260

r333255:
Make reading imx6 gpio pins work correctly whether the pin is in open-drain
mode or not.  An earlier attempt to make this work was done in r320456, by
always reading the pad status register (PSR) instead of the data register.
But it turns out the values in PSR only reflect the electrical level of an
output pin if the pad is configured with the SION (Set Input On) bit in the
pinmux config, and most output gpio pads are not configured that way.

So now a gpio read is done by returning the value from the data register,
which works right whether the pin is configured for input or output, unless
the pin has been set for OPENDRAIN mode, in which case the PSR is read
instead.  For this to work, the pin must also be configured with SION turned
on in the fdt pinmux data, which is a reasonable thing to require for the
unusual case of reading an open-drain output pin.

r333260:
Properly support the GPIO_PIN_PRESET_{LOW,HIGH} options when configuring
a gpio pin.  If neither of the options is specified, pre-set the pin's
output value to the pin's current input value, to achieve glitch-free
transitions to output mode on pins that are pulled up or down at reset
or via fdt pinctrl data.

5 years agoMFC r335759:
ae [Thu, 5 Jul 2018 15:36:49 +0000 (15:36 +0000)]
MFC r335759:
  Remove extra "ipfw" from example.

5 years agoMFC r335479, r335509
kevans [Thu, 5 Jul 2018 15:27:38 +0000 (15:27 +0000)]
MFC r335479, r335509

MFC r335479: subr_hints: simplify a little bit

Some complexity exists in these bits that isn't needed. The sysctl handler,
upon change to '2', runs through the current set of hints and sets them in
the kenv.

However, this isn't at all necessary if we're pulling hints from the kenv,
static or dynamic, as the former will get added to the latter in
init_dynamic_kenv (see: kern_environment.c). We can reduce this
configuration to just adding static_hints to the kenv if we were previously
using them.

The changes in res_find are minimal and based on the observation that once
use_kenv gets set to '1' it will never be reset to '0', and it gets set to
'1' as soon as we hit fallback mode. Later work will refactor res_find a
little bit and eliminate this now-local, because it's become clear that
there's some funkiness revolving around use_kenv=1 and it being used to
imply that we're certainly looking at the dynamic_kenv.

MFC r335509: subr_hints: Fix acpi unit hinting (at the very least)

The refactoring in r335479 overlooked the fact that the dynamic kenv can
also be switched to if hintmode == 0. This is problematic because the
checkmethod bits are only ever ran once, but it worked previously because
the use_kenv was a global state and the first lookup would enable it if
occurring after the dynamic environment has been setup.

Extending our local definition of use_kenv to include all non-STATIC
hintmodes as long as the dynamic_kenv is setup fixes this. We still have
potential issues if the dynamic kenv comes up while we're doing an anchored
search through the environment, but this is not much of a concern right now
because:

1.) The dynamic environment comes up super early in boot, just after kmem

2.) This is going to get rewritten to provide a safer mechanism for the
anchored searches, ensuring that we continue using the same environment
chain (dynamic env or static fallback) for all anchored search invocations

5 years agoMFC r306098 (br): Use kqueue(2) instead of select(2).
emaste [Wed, 4 Jul 2018 18:01:53 +0000 (18:01 +0000)]
MFC r306098 (br): Use kqueue(2) instead of select(2).

This helps to ensure we will not lose SIGINT sent by parent to child.

PR: 212562, 228492

5 years agoMFC r335595-r335596
ian [Wed, 4 Jul 2018 14:04:23 +0000 (14:04 +0000)]
MFC r335595-r335596

r335595:
Modernize usage of "restrict" keyword in ntp.conf

It is no longer necessary to specify a -4/-6 flag on any ntp.conf
keyword.  The address type is inferred from the address itself as
necessary.  "restrict default" statements always apply to both address
families regardless of any -4/-6 flag that may be present.

So this change just tidies up our default config by removing the redundant
restrict -6 statement and comment, and by removing the -6 flag from the
restrict keyword that allows access from localhost.

This change was inspired by the patches provided in PRs 201803 and 210245,
and included some contrib/ntp code inspection to verify that the -4/-6
keywords are basically no-ops in all contexts now.

PR: 201803 210245
Differential Revision: https://reviews.freebsd.org/D15974

r335596:
Fix a comment; the ntp leaplist file is updated periodically, but not weekly
(it's only updated when a check shows it's within 30 days of expiring).

PR: 207138

5 years agoMFC r335575, r335786-r335787
ian [Wed, 4 Jul 2018 14:01:56 +0000 (14:01 +0000)]
MFC r335575, r335786-r335787

r335575:
Use 'mv -f' in rc.d/ntpd to avoid spuriously halting the boot.

The final 'mv' to install a fetched leap-list file can fail (due to a
readonly fs, or schg flags, for example), and that leads to mv(1)
prompting the user, stopping the boot process.  Instead, use mv -f
to supress the prompting, and if verbose mode is on, emit a warning
that the existing file cannot be replaced.

PR: 219255

r335786:
Rename variable ntp_tmp_leapfile to have a leading underbar, to distinguish
it from variables with similar names which are set in rc.conf.  This will
make more sense as the script grows more similar-name local variables in
some upcoming changes.

r335787:
When being verbose about various leapfile versions, also mention expiration.

The expiration date is actually more of a version number than the version
date, because expiration changes twice a year, whereas the version only
changes when actual leap second events occur (except in USNO leapfiles,
which inappropriately bump the version with every expiration date change).

5 years agoMFC r335489:
ian [Wed, 4 Jul 2018 13:57:49 +0000 (13:57 +0000)]
MFC r335489:

Add some words clarifying that rename(2) does nothing when the 'from' and
'to' args are the same file.  Wording borrowed from POSIX.1-2017, but
the freebsd code to implement this behavior was added in 2002 (r103180).

5 years agoMFC r335486:
ian [Wed, 4 Jul 2018 13:56:01 +0000 (13:56 +0000)]
MFC r335486:

Add a note about using option VERBOSE_SYSINIT=0 to get the verbose code
compiled in but disabled by default.

5 years agoMFC SVN r335750: Fix typo in top-level Makefile
dteske [Wed, 4 Jul 2018 03:22:44 +0000 (03:22 +0000)]
MFC SVN r335750: Fix typo in top-level Makefile

Submitted by: Ben Widawsky <ben.widawsky@intel.com>
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/P186

5 years agoMFC r327317:
robak [Tue, 3 Jul 2018 14:40:19 +0000 (14:40 +0000)]
MFC r327317:

humanize_number(3): fix math edge case in rounding large numbers

Fix for remainder overflow, when in rare cases adding remainder to divider
exceeded 1 and turned the total to 1000 in final formatting, taking up
the space for the unit character.

The fix continues the division of the original number if the above case
happens -- added the appropriate check to the for loop performing
the division. This lowers the value shown, to make it fit into the buffer
space provided (1.0M for 4+1 character buffer, as used by ls).

Add test case for the reported bug and extend test program to support
providing buffer length (ls -lh uses 5, tests hard-coded 4).

PR: 224498

5 years agoMFC r335558:
dim [Mon, 2 Jul 2018 21:20:36 +0000 (21:20 +0000)]
MFC r335558:

Add support for selectively enabling LLVM targets

This makes it possible, through src.conf(5) settings, to select which
LLVM targets you want to build during buildworld.  The current list is:

* (WITH|WITHOUT)_LLVM_TARGET_AARCH64
* (WITH|WITHOUT)_LLVM_TARGET_ARM
* (WITH|WITHOUT)_LLVM_TARGET_MIPS
* (WITH|WITHOUT)_LLVM_TARGET_POWERPC
* (WITH|WITHOUT)_LLVM_TARGET_SPARC
* (WITH|WITHOUT)_LLVM_TARGET_X86

To not influence anything right now, all of these are on by default, in
situations where clang is enabled.

Selectively turning a few targets off manually should work.  Turning on
only one target should work too, even if that target does not correspond
to the build architecture.  (In that case, LLVM_NATIVE_ARCH will not be
defined, and you can only use the resulting clang executable for
cross-compiling.)

I performed a few measurements on one of the FreeBSD.org reference
machines, building clang from scratch, with all targets enabled, and
with only the x86 target enabled.  The latter was ~12% faster in real
time (on a 32-core box), and ~14% faster in user time.  For a full
buildworld the difference will probably be less pronounced, though.

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D11077

5 years agoMFC r335642, r335651: config(8) envvar support
kevans [Mon, 2 Jul 2018 13:08:27 +0000 (13:08 +0000)]
MFC r335642, r335651: config(8) envvar support

r335642:
config(8): Add `envvar` support

envvar allows adding individual environment variables to the kernel's static
environment without the overhead of pulling in a full file. envvar in a
config looks like:

envvar some_var=5

All envvar-provided variables will be added after the env file is processed,
so envvar keys that exist in the previous env will be overwritten by
whatever value is set here in the kernel configuration directly.

As an aside, envvar lines are intentionally tokenized differently from
basically every other line. We used a named state when ENVVAR is encountered
to gobble up the rest of the line, which will later be cleaned and validated
in post-processing by sanitize_envline. This turns out to be the simplest
and cleanest way to allow the flexibility that kenv does while not
compromising on silly hacks.

r335651:
config(8): Set envmode if we accept an envvar

5 years agoMFC r335635:
kib [Mon, 2 Jul 2018 07:58:57 +0000 (07:58 +0000)]
MFC r335635:
Do not leave stray qword on top of stack for interrupts and exceptions
without error code.  Doing so it mis-aligned the stack.

PR: 229222

5 years agoMFC r335553: Make CLOCK_PROCESS_CPUTIME_ID more accurate by including
cperciva [Sat, 30 Jun 2018 21:36:35 +0000 (21:36 +0000)]
MFC r335553: Make CLOCK_PROCESS_CPUTIME_ID more accurate by including
the current timeslice, matching the behaviour of CLOCK_VIRTUAL and
CLOCK_PROF.

5 years agoMFC r335253:
kib [Sat, 30 Jun 2018 20:09:43 +0000 (20:09 +0000)]
MFC r335253:
Rework ofed build.

Sponsored by: Mellanox Technologies

5 years agoMFC r335505:
kib [Sat, 30 Jun 2018 15:09:24 +0000 (15:09 +0000)]
MFC r335505:
linux_clone_thread: mark new thread as TDB_BORN.

5 years agoMFC r335504:
kib [Sat, 30 Jun 2018 15:07:44 +0000 (15:07 +0000)]
MFC r335504:
fork: avoid endless wait with PTRACE_FORK and RFSTOPPED.

5 years agoMFC r335503:
kib [Sat, 30 Jun 2018 15:03:06 +0000 (15:03 +0000)]
MFC r335503:
Update proc->p_ptevents annotation to reflect the actual locking.

5 years agoMFC r333087 (by cem):
kib [Sat, 30 Jun 2018 14:55:47 +0000 (14:55 +0000)]
MFC r333087 (by cem):
amd64/mp_machdep.c: Fix GCC build after r333059.

Noted by: bde

5 years agoMFC r335569:
kp [Fri, 29 Jun 2018 16:46:19 +0000 (16:46 +0000)]
MFC r335569:

pf: Support "return" statements in passing rules when they fail.

Normally pf rules are expected to do one of two things: pass the traffic or
block it. Blocking can be silent - "drop", or loud - "return", "return-rst",
"return-icmp". Yet there is a 3rd category of traffic passing through pf:
Packets matching a "pass" rule but when applying the rule fails. This happens
when redirection table is empty or when src node or state creation fails. Such
rules always fail silently without notifying the sender.

Allow users to configure this behaviour too, so that pf returns an error packet
in these cases.

PR: 226850
Submitted by: Kajetan Staszkiewicz <vegeta tuxpowered.net>
Sponsored by: InnoGames GmbH

5 years agoMFC r335641:
brooks [Thu, 28 Jun 2018 20:33:12 +0000 (20:33 +0000)]
MFC r335641:

Fix a stack overflow in mount_smbfs when hostname is too long.

The local hostname was blindly copied into the to the nn_name array.
When the hostname exceeded 16 bytes, it would overflow.  Truncate the
hostname to 15 bytes plus a 0 terminator which is the "workstation name"
suffix.

Use defensive strlcpy() when filling nn_name in all cases.

PR: 228354
Reported by: donald.buchholz@intel.com
Reviewed by: jpaetzel,  ian (prior version)
Discussed with: Security Officer (gtetlow)
Security: Stack overflow with the hostname.
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15936

5 years agoAdd an errata entry regarding Bugzilla 228536.
gjb [Thu, 28 Jun 2018 15:30:51 +0000 (15:30 +0000)]
Add an errata entry regarding Bugzilla 228536.

PR: 228536
Sponsored by: The FreeBSD Foundation

5 years agoMFC r335565:
ed [Thu, 28 Jun 2018 12:55:05 +0000 (12:55 +0000)]
MFC r335565:

  Still parse messages that don't contain an RFC 3164 timestamp.

  The changes made in r326573 required that messages always start with an
  RFC 3164 timestamp. It looks like certain devices, but also certain
  logging libraries (Python 3's "logging" package) simply don't generate
  RFC 3164 formatted messages containing a timestamp.

  Make timestamps optional again. When the timestamp is missing, also
  assume that the message contains no hostname. The first word of the
  message likely already belongs to the message payload.

PR: 229236

5 years agoMFC r334882, r334884-r334885: loader(8) boot flag <-> environment fixes
kevans [Thu, 28 Jun 2018 01:32:37 +0000 (01:32 +0000)]
MFC r334882, r334884-r334885: loader(8) boot flag <-> environment fixes

r334882:
stand: Consolidate checking for boot flags driven by environment vars

e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these
in multiple places, consolidate into common/ and allow a setting of "NO" for
any of these to turn them off. This allows systems with multiple
loader.conf(5) or loader.conf(5) overlay systems to easily turn off
variables in later processed files by setting it to NO.

Reported by: Nick Wolff @ iXsystems
Reviewed by: imp

r334884:
stand: Fix build after r334882

Not sure how this was not caught in Universe.

r334885:
stand: One more trivial consolidation (setting environment from howto)

5 years agoMFC r334878: libsa(3): Correct statement about FS Write-support, name change
kevans [Thu, 28 Jun 2018 01:30:03 +0000 (01:30 +0000)]
MFC r334878: libsa(3): Correct statement about FS Write-support, name change

- jhb implemented UFS write support a little over 16 years ago.
- Update the library name while we're here.

5 years agoMFC r335467: Don't remove loader.conf(5) when built WITHOUT_FORTH
kevans [Wed, 27 Jun 2018 23:02:18 +0000 (23:02 +0000)]
MFC r335467: Don't remove loader.conf(5) when built WITHOUT_FORTH

The new stand/ structure installs loader.conf(5) and defaults/loader.conf
regardless of interpreter. The only thing gating installation now is
MK_BOOT.

5 years agoMFC r330090:
bdrewery [Wed, 27 Jun 2018 22:52:32 +0000 (22:52 +0000)]
MFC r330090:

  Add 'usr.bin/seq' to tests mtree after r330086

PR: 217149

5 years agoMFC r332395 (ian): Use explicit_bzero() when cleaning values out of the kenv
kevans [Wed, 27 Jun 2018 21:22:48 +0000 (21:22 +0000)]
MFC r332395 (ian): Use explicit_bzero() when cleaning values out of the kenv

Sometimes the values contain geli passphrases being communicated from
loader(8) to the kernel, and some day the compiler may decide to start
eliding calls to memset() for a pointer which is not dereferenced again
before being passed to free().

5 years agoMFC r335458: Add debug.verbose_sysinit tunable for VERBOSE_SYSINIT
kevans [Wed, 27 Jun 2018 21:13:20 +0000 (21:13 +0000)]
MFC r335458: Add debug.verbose_sysinit tunable for VERBOSE_SYSINIT

VERBOSE_SYSINIT is currently an all-or-nothing option. debug.verbose_sysinit
adds an option to have the code compiled in but quiet by default so that
getting this information from a device in the field doesn't necessarily
require distributing a recompiled kernel.

Its default is VERBOSE_SYSINIT's value as defined in the kernconf. As such,
the default behavior for simply omitting or including this option is
unchanged.

5 years agoMFC r335404: sort(1): Fix -m when only implicit stdin is used for input
kevans [Wed, 27 Jun 2018 21:11:28 +0000 (21:11 +0000)]
MFC r335404: sort(1): Fix -m when only implicit stdin is used for input

Observe:

printf "a\nb\nc\n" > /tmp/foo
# Next command results in no output
cat /tmp/foo | sort -m
# Next command results in proper output
cat /tmp/foo | sort -m -
# Also works:
sort -m /tmp/foo

Some const'ification was done to simplify the actual solution of adding "-"
explicitly to the file list if we didn't have any file arguments left over.

PR: 190099

5 years agoMFC r333221: rsu(4) does not require legal.realtek.license_ack=1
kevans [Wed, 27 Jun 2018 21:09:55 +0000 (21:09 +0000)]
MFC r333221: rsu(4) does not require legal.realtek.license_ack=1

The rsu firmware license check has been disabled since r292756. Changes
rsu(4) since the license ack is no longer required.

While here, add `device rsufw` hint to the kernel configuration lines and
add/update paths to the installed license file in both rsu(4) and rsufw(4).

5 years agoMFC r333192: fcntl(2): Vaguely document that ENOTTY is possible + examples
kevans [Wed, 27 Jun 2018 21:04:29 +0000 (21:04 +0000)]
MFC r333192: fcntl(2): Vaguely document that ENOTTY is possible + examples

5 years agoMFC r330086, r333155: seq(1) improvements
kevans [Wed, 27 Jun 2018 21:03:05 +0000 (21:03 +0000)]
MFC r330086, r333155: seq(1) improvements

MFC r330086 (cem): seq(1): Consistently include 'last' for non-integers

The source of error is a rounded increment being too large and thus the loop
steps slightly past 'last'.  Perform a final comparison using the formatted
string values (truncated precision) to determine if we still need to print
the 'last' value.

MFC r333155: seq(1): Move long_opts up with globals

PR: 217149

5 years agoMFC r333157: cmp(1): Provide some long options
kevans [Wed, 27 Jun 2018 21:00:09 +0000 (21:00 +0000)]
MFC r333157: cmp(1): Provide some long options

These match GNU cmp(1) for compatibility where applicable.

Future work might implement the -i option from GNU cmp(1) to express skip
either in terms of both files or of the form "SKIP1:SKIP2" rather than
specifying them as additional arguments to cmp(1).

5 years agoMFC r333156: uniq(1): Add some long options
kevans [Wed, 27 Jun 2018 20:55:49 +0000 (20:55 +0000)]
MFC r333156: uniq(1): Add some long options

These match GNU uniq(1) where appropriate for compatibility's sake.

While here, re-sort options alphabetically by the short-option.

5 years agoMFC r333122: seq(1): Provide some long options
kevans [Wed, 27 Jun 2018 20:54:12 +0000 (20:54 +0000)]
MFC r333122: seq(1): Provide some long options

These match GNU seq(1) names where applicable for compatibility purposes.

5 years agoMFC r335607: check-password.4th(8): Fix manual [in]accuracy
dteske [Wed, 27 Jun 2018 20:50:23 +0000 (20:50 +0000)]
MFC r335607: check-password.4th(8): Fix manual [in]accuracy

SVN r280384 updated the maximum password length from 16 bytes to 255. The
manual was not updated to reflect this.

Sponsored by: Smule, Inc.

5 years agoMFC r335355:
cy [Wed, 27 Jun 2018 19:42:55 +0000 (19:42 +0000)]
MFC r335355:

Fix amq -i timestamp segmentation violation.

5 years agoAdd an entry about an incorrectly-listed driver name in the
gjb [Wed, 27 Jun 2018 17:29:27 +0000 (17:29 +0000)]
Add an entry about an incorrectly-listed driver name in the
11.2 announcement.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r335461:
hselasky [Wed, 27 Jun 2018 07:24:07 +0000 (07:24 +0000)]
MFC r335461:
Permit the kernel environment to set an array of numeric values for a single
sysctl(9) node.

Reviewed by: kib@, imp@, jhb@
Differential Revision: https://reviews.freebsd.org/D15802
Sponsored by: Mellanox Technologies

5 years agoMFC r335604:
kib [Wed, 27 Jun 2018 07:18:54 +0000 (07:18 +0000)]
MFC r335604:
bhyve/vmrun.sh: make -L functional.

5 years agoMFC r302776, r302799:
eadler [Wed, 27 Jun 2018 04:37:22 +0000 (04:37 +0000)]
MFC r302776, r302799:

mail(1): Bring some fixes from other BSDs.

- Use varargs properly
- Use pid_t
- Better handling of error conditions on forked jobs.
- Some prototype and warning cleanups.

Fix missing forked job changes from r302776 in wait_child().

5 years agoMFC r333622, r334019, r334084
araujo [Wed, 27 Jun 2018 03:58:02 +0000 (03:58 +0000)]
MFC r333622, r334019, r334084

r333622:
vq_getchain() can return -1 if some descriptor(s) are invalid and prints
a diagnostic message. So we do a sanity checking on the return value
of vq_getchain().

Spotted by: gcc49
Reviewed by: avg
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15388

r334019:
Include atkbdc header where there are declared the prototype functions
atkbdc_event and atkbdc_init.

Sponsored by: iXsystems Inc.

r334084:
pthread_rwlock_unlock(3) returns 0 if successful, otherwise an error number
will be returned to indicate the error, so I'm applying an assert(3) to do
a sanity check of the return value.

Reported by: Coverity CID: 13912351193654 and 1193651
Reviewed by: grehan
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15533

5 years agoMFC r334208:
eadler [Wed, 27 Jun 2018 03:29:36 +0000 (03:29 +0000)]
MFC r334208:

rctl:correct use of "vmem" instead of "vmemoryuse"

PR: 228482

5 years agoMFC r325107, r335665:
gjb [Tue, 26 Jun 2018 16:16:08 +0000 (16:16 +0000)]
MFC r325107, r335665:
 r325107 (eadler, partial):
  Update the updating URL in UPDATING.

 r335665:
  Use the 'Updating from Source' Handbook section in UPDATING.

PR: 229345
Submitted by: Niels Bakker
Approved by: re (marius, insta-MFC)
Sponsored by: The FreeBSD Foundation

5 years agoAdd an errata note that the URL in UPDATING for source-based
gjb [Tue, 26 Jun 2018 14:48:23 +0000 (14:48 +0000)]
Add an errata note that the URL in UPDATING for source-based
upgrades is incorrect.

PR: 229345
Sponsored by: The FreeBSD Foundation

5 years agoDocument that a few device drivers were omitted from the 11.2
gjb [Tue, 26 Jun 2018 14:01:03 +0000 (14:01 +0000)]
Document that a few device drivers were omitted from the 11.2
hardware page.

Sponsored by: The FreeBSD Foundation

5 years agoAdd a few missing drivers to the 11-STABLE hardware page.
gjb [Tue, 26 Jun 2018 13:53:33 +0000 (13:53 +0000)]
Add a few missing drivers to the 11-STABLE hardware page.

Submitted by: Grzegorz Junka list1 _@t_ gjunka.com
Sponsored by: The FreeBSD Foundation

5 years agoDocument an issue with emulators/virtualbox-ose reported in
gjb [Tue, 26 Jun 2018 13:29:49 +0000 (13:29 +0000)]
Document an issue with emulators/virtualbox-ose reported in
Bugzilla 228535.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r334340: add support for console resuming, implement it for uart, use on x86
avg [Tue, 26 Jun 2018 09:04:24 +0000 (09:04 +0000)]
MFC r334340: add support for console resuming, implement it for uart, use on x86

5 years agoMFC r333268: for bus suspend, detach and shutdown iterate children in reverse order
avg [Tue, 26 Jun 2018 08:56:34 +0000 (08:56 +0000)]
MFC r333268: for bus suspend, detach and shutdown iterate children in reverse order

5 years agoMFC r334204,r334338: re-synchronize TSC-s on SMP systems after resume
avg [Tue, 26 Jun 2018 08:35:58 +0000 (08:35 +0000)]
MFC r334204,r334338: re-synchronize TSC-s on SMP systems after resume

5 years agoMFC r333994: stop and restart kernel event timers in the suspend / resume cycle
avg [Tue, 26 Jun 2018 08:31:08 +0000 (08:31 +0000)]
MFC r333994: stop and restart kernel event timers in the suspend / resume cycle

5 years agoMFC r321427,r321445:
bdrewery [Mon, 25 Jun 2018 18:53:06 +0000 (18:53 +0000)]
MFC r321427,r321445:

  r321427:
    PROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.
  r321445:
    cleandir: Fix ESTALE errors from parallel removals.

5 years agoMFC r334277, r334376, r334378 and r334418:
hselasky [Mon, 25 Jun 2018 15:09:55 +0000 (15:09 +0000)]
MFC r334277, r334376, r334378 and r334418:

MFV r333789: libpcap 1.9.0 (pre-release)

- Update local copy of dlt.h with new DLT types.

Sponsored by: Mellanox Technologies

5 years agoMFC r334881:
markj [Mon, 25 Jun 2018 10:37:21 +0000 (10:37 +0000)]
MFC r334881:
Add DW_LANG_* definitions from DWARF 4 and 5.

5 years agoMFC r333638: calibrate lapic timer in native_lapic_setup
avg [Mon, 25 Jun 2018 09:19:50 +0000 (09:19 +0000)]
MFC r333638: calibrate lapic timer in native_lapic_setup

5 years agoMFC r334002: uchcom: extend hardware support to version 0x30
avg [Mon, 25 Jun 2018 08:56:30 +0000 (08:56 +0000)]
MFC r334002: uchcom: extend hardware support to version 0x30

5 years agoMFC r334001: uchcom: remove UCHCOM_REG_BREAK2 alias of UCHCOM_REG_LCR1
avg [Mon, 25 Jun 2018 08:54:46 +0000 (08:54 +0000)]
MFC r334001: uchcom: remove UCHCOM_REG_BREAK2 alias of UCHCOM_REG_LCR1

5 years agoMFC r334000: uchcom: reject parity and double stop bits as unsupported
avg [Mon, 25 Jun 2018 08:52:48 +0000 (08:52 +0000)]
MFC r334000: uchcom: reject parity and double stop bits as unsupported

5 years agoMFC r333999: uchcom: add a hardware configuration tweak seen in Linux code
avg [Mon, 25 Jun 2018 08:50:06 +0000 (08:50 +0000)]
MFC r333999: uchcom: add a hardware configuration tweak seen in Linux code

5 years agoMFC r333998: uchcom: add DPRINTF-s to aid debugging of the driver
avg [Mon, 25 Jun 2018 08:48:39 +0000 (08:48 +0000)]
MFC r333998: uchcom: add DPRINTF-s to aid debugging of the driver

5 years agoMFC r333997: uchcom: report detected product based on USB product ID
avg [Mon, 25 Jun 2018 08:47:07 +0000 (08:47 +0000)]
MFC r333997: uchcom: report detected product based on USB product ID

5 years agoMFC r335282:
slavash [Mon, 25 Jun 2018 07:25:41 +0000 (07:25 +0000)]
MFC r335282:
Fix false positive on failure

When running mckey, errors may happen in the init/connect stage.
When leaving multicast groups, we override this value.

Fix that by saving the return value from rdma_leave_multicast to different
parameter, and only in case of failure in rdma_leave_multicast override it.

Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoMFC r334928:
kib [Sun, 24 Jun 2018 13:26:31 +0000 (13:26 +0000)]
MFC r334928:
libc qsort(3): stop aliasing.

PR: 228780

5 years agoMFC r335258:
kib [Sat, 23 Jun 2018 00:38:44 +0000 (00:38 +0000)]
MFC r335258:
Remove unused file.

5 years agoMFC r333059 (by tychon):
kib [Fri, 22 Jun 2018 23:52:20 +0000 (23:52 +0000)]
MFC r333059 (by tychon):
Expand the checks for UCR3 == PMAP_NO_CR3 to enable processes to be
excluded from PTI.

5 years agocxgbe(4): Determine early in the ioctl whether it is allowed to sleep or
np [Fri, 22 Jun 2018 20:19:33 +0000 (20:19 +0000)]
cxgbe(4): Determine early in the ioctl whether it is allowed to sleep or
not, instead of always starting a non-sleepable operation and
re-adjusting later.  This ensures that an operation that is allowed to
sleep (ifconfig up/down) never fails with EBUSY on the initial attempt
to start a synchronized operation.

This is a direct commit to stable/11.  The driver ioctl is always
allowed to sleep in head.

Sponsored by: Chelsio Communications

5 years agoMFC r333667: followup to r332730/r332752: set kdb_why to "trap" for fatal traps
avg [Fri, 22 Jun 2018 10:49:21 +0000 (10:49 +0000)]
MFC r333667: followup to r332730/r332752: set kdb_why to "trap" for fatal traps

This change updates arm, arm64 and mips achitectures.  Additionally, it
removes redundant checks for kdb_active where it already results in
kdb_reenter() and adds kdb_reenter() calls where they were missing.

Some architectures check the return value of kdb_trap(), but some don't.
I haven't changed any of that.

Some trap handling routines have a return code.  I am not sure if I
provided correct ones for returns after kdb_reenter().  kdb_reenter
should never return unless kdb_jmpbufp is NULL for some reason.

5 years agoMFC r333321,r333707: x86 cpususpend_handler: call wbinvd after setting suspend state...
avg [Fri, 22 Jun 2018 10:44:33 +0000 (10:44 +0000)]
MFC r333321,r333707: x86 cpususpend_handler: call wbinvd after setting suspend state bits

Without a subsequent wbinvd the changes to suspended_cpus (and
resuming_cpus) can be lost at least on AMD systems that use MOESI cache
coherency protocol.  That can happen because one of APs ends up as an
Owner of the corresponding cache line(s) and the changes may never reach
the main memory before the AP is reset.

This change fixed suspend to RAM a previously broken AMD-based system.

5 years agoMFC r332918, r333222: go deeper for ACPI suspend bounce test
avg [Fri, 22 Jun 2018 10:39:22 +0000 (10:39 +0000)]
MFC r332918, r333222: go deeper for ACPI suspend bounce test

debug.acpi.suspend_bounce sysctl now allows a deeper dive into the sleep
abyss.  The system will execute the suspend sequence up to the call to
AcpiEnterSleepState().  That includes saving processor contexts and
parking APs.  Then, instead of actually entering the sleep state, the
BSP will call resumectx() to emulate the wakeup.  The APs should get
restarted by the sequence of Init and Startup IPIs that BSP sends to
them.

AcpiOsEnterSleep() is used to implement this feature.

Joint work with jkim.

5 years agoMFC r335199:
kib [Fri, 22 Jun 2018 10:07:21 +0000 (10:07 +0000)]
MFC r335199:
linprocfs: add TracerPid to /proc/pid/status.

5 years agoMFC r333630: Fix 'zpool create -t <tempname>'
avg [Fri, 22 Jun 2018 09:37:26 +0000 (09:37 +0000)]
MFC r333630: Fix 'zpool create -t <tempname>'

Creating a pool with a temporary name fails when we also specify custom
dataset properties: this is because we mistakenly call
zfs_set_prop_nvlist() on the "real" pool name which, as expected,
cannot be found because the SPA is present in the namespace with the
temporary name.

5 years agoMFC r334785: expand descriptions of x86 panic_on_nmi and kdb_on_nmi sysctls
avg [Fri, 22 Jun 2018 09:29:34 +0000 (09:29 +0000)]
MFC r334785: expand descriptions of x86 panic_on_nmi and kdb_on_nmi sysctls

5 years agoMFC r333269: amdsbwd: fix reboot status reporting
avg [Fri, 22 Jun 2018 09:25:24 +0000 (09:25 +0000)]
MFC r333269: amdsbwd: fix reboot status reporting

5 years agoMFC r333243: opensolaris system_taskq does not need to run at maximum priority
avg [Fri, 22 Jun 2018 09:22:30 +0000 (09:22 +0000)]
MFC r333243: opensolaris system_taskq does not need to run at maximum priority

5 years agoMFC r333212: amdsbwd: add suspend and resume methods
avg [Fri, 22 Jun 2018 09:20:00 +0000 (09:20 +0000)]
MFC r333212: amdsbwd: add suspend and resume methods

5 years agoMFC r332816: call racct_proc_ucred_changed() under the proc lock
avg [Fri, 22 Jun 2018 09:18:38 +0000 (09:18 +0000)]
MFC r332816: call racct_proc_ucred_changed() under the proc lock

5 years agoMFC r333209: hpet: use macros instead of magic values for the timer mode
avg [Fri, 22 Jun 2018 09:08:38 +0000 (09:08 +0000)]
MFC r333209: hpet: use macros instead of magic values for the timer mode

5 years agoMFC r334472:
eadler [Fri, 22 Jun 2018 04:54:51 +0000 (04:54 +0000)]
MFC r334472:

service(1): Improve manual page

* Sort options..
* Fix some typos.
* Use one Bd macro for code blocks instead of a bunch of Dl
* macros.
* Improve formatting.
* Clarify 'jail' argument

PR: 228552

5 years agoMFC r335213: ldd: reference readelf instead of objdump in warning message
emaste [Fri, 22 Jun 2018 00:30:24 +0000 (00:30 +0000)]
MFC r335213: ldd: reference readelf instead of objdump in warning message

We have an obsolete GNU objdump 2.17.50 in the base system, which will
be removed in the future.  Suggest readelf(1) for examining ELF files
instead; for most use cases it is the preferred tool anyhow.

PR: 229046
Sponsored by: The FreeBSD Foundation