]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoANSIfy libc/quad
emaste [Sun, 21 Oct 2018 00:20:40 +0000 (00:20 +0000)]
ANSIfy libc/quad

Some of these routines exist in both lib/libc/quad/ and sys/libkern/.
r325988 ANSIfied sys/libkern.  Update libc/quad to match.

PR: 223641
Reported by: bde
Sponsored by: The FreeBSD Foundation

5 years agoRestore the ability to prevent the user from interrupting the boot process
dteske [Sun, 21 Oct 2018 00:15:51 +0000 (00:15 +0000)]
Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).

PR: kern/207069
Reported by: david@dcrosstech.com
MFC after: 3 days
Sponsored by: Smule, Inc.

5 years agoUnindent vm_map_simplify_entry() after r339506.
kib [Sun, 21 Oct 2018 00:11:56 +0000 (00:11 +0000)]
Unindent vm_map_simplify_entry() after r339506.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17632

5 years agoamd64: flush L1 data cache on syscall return with an error.
kib [Sat, 20 Oct 2018 23:17:24 +0000 (23:17 +0000)]
amd64: flush L1 data cache on syscall return with an error.

The knob allows to select the flushing mode or turn it off/on.  The
idea, as well as the list of the ignored syscall errors, were taken
from https://www.openwall.com/lists/kernel-hardening/2018/10/11/10 .

I was not able to measure statistically significant difference between
flush enabled vs disabled using syscall_timing getuid.

Reviewed by: bwidawsk
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17536

5 years agoReduce code duplication in merging vm_entry neighbors.
kib [Sat, 20 Oct 2018 23:08:04 +0000 (23:08 +0000)]
Reduce code duplication in merging vm_entry neighbors.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17610

5 years agomcount: tidy up ANSIfication
emaste [Sat, 20 Oct 2018 22:39:35 +0000 (22:39 +0000)]
mcount: tidy up ANSIfication

libc/gmon's mcount was ANSIfied in r124180, with libkern following over
a decade later, in r325988, but some minor discrepancies remained.
Update libc/gmon's mexitcount to an ANSI C function definition, and use
(void) for libkern-only functions that take no arguments.

Reported by: bde

5 years agolibi386: remove CLANG_NO_IAS workaround
emaste [Sat, 20 Oct 2018 22:35:06 +0000 (22:35 +0000)]
libi386: remove CLANG_NO_IAS workaround

Clang's Integrated Assembler was previously disabled for i386 with the
note that it "doesn't grok .codeNN directives yet."  This is no longer
the case (and hasn't been for some time), and the assembled output .text
is identical between gas and IAS.

MFC after: 2 months
Sponsored by: The FreeBSD Foundation

5 years agoImport tzdata 2018f
philip [Sat, 20 Oct 2018 22:32:10 +0000 (22:32 +0000)]
Import tzdata 2018f

Changes: https://github.com/eggert/tz/blob/2018f/NEWS

MFC after: 3 days

5 years agoAdd link to the setproctitle_fast function.
oshogbo [Sat, 20 Oct 2018 22:25:57 +0000 (22:25 +0000)]
Add link to the setproctitle_fast function.

MFC after: 1 week

5 years agonetdump: Zone mbufs should be allocated before dump
cem [Sat, 20 Oct 2018 22:24:58 +0000 (22:24 +0000)]
netdump: Zone mbufs should be allocated before dump

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17306

5 years agoEmbedded chacha: Remove some harmless dead stores in keystream mode
cem [Sat, 20 Oct 2018 22:17:16 +0000 (22:17 +0000)]
Embedded chacha: Remove some harmless dead stores in keystream mode

(From r338059.)

Sponsored by: Dell EMC Isilon

5 years agoEmbedded chacha: Distinguish via dedicated macro
cem [Sat, 20 Oct 2018 22:14:29 +0000 (22:14 +0000)]
Embedded chacha: Distinguish via dedicated macro

Set embedding expectations via CHACHA_EMBED macro rather than _KERNEL
definition.

No functional change.

Sponsored by: Dell EMC Isilon

5 years agocrypto/chacha: Split header into separate _chacha.h
cem [Sat, 20 Oct 2018 22:12:53 +0000 (22:12 +0000)]
crypto/chacha: Split header into separate _chacha.h

Sponsored by: Dell EMC Isilon

5 years agoZSTDIO: Correctly initialize zstd context with provided 'level'
cem [Sat, 20 Oct 2018 21:49:44 +0000 (21:49 +0000)]
ZSTDIO: Correctly initialize zstd context with provided 'level'

Prior to this revision, we allocated sufficient context space for 'level'
but never actually set the compress level parameter, so we would always get
the default '3'.

Reviewed by: markj, vangyzen
MFC after: 12 hours
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17144

5 years agogetentropy(3): Trap non-API errnos from getrandom(2) and abort
cem [Sat, 20 Oct 2018 21:45:17 +0000 (21:45 +0000)]
getentropy(3): Trap non-API errnos from getrandom(2) and abort

Additionally, reconcile our abort behavior with arc4random(3).  Unlike
SIGABRT, SIGKILL cannot be caught by the user program.  These failures
are fatal conditions and should not return to the caller, as they did in
the instance that resulted in D17049.

While here, fix some minor typos in a comment.

Reviewed by: delphij
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17050

5 years agoBring back the WARNS level to what it used to be to please gcc arches at least
bapt [Sat, 20 Oct 2018 21:33:34 +0000 (21:33 +0000)]
Bring back the WARNS level to what it used to be to please gcc arches at least

5 years agomdmfs(8): Check for other types of helper-program failure
cem [Sat, 20 Oct 2018 21:33:00 +0000 (21:33 +0000)]
mdmfs(8): Check for other types of helper-program failure

Exiting with a signal should not be treated the same as successful exit with
zero status.

Return signal exit information to the callers via negative integers, to
enable distinction from normal exit statuses.  (All consumers that check for
errors don't care what the exact non-zero exit value is -- in such a case
they print a diagnostic message and either continue or bail.)

Additionally, check for unexpected sources of waitpid() wakeup and bail if
we encounter them.

Reported by: lev@
Reviewed by: kib, lev, markj (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17035

5 years agoFix typo
imp [Sat, 20 Oct 2018 21:13:57 +0000 (21:13 +0000)]
Fix typo

The vendor name wds should have been wdc. Add wdc and keep the wds for
script compat.

MFC after: 3 days

5 years agoFortuna: Fix a race to prevent reseed spamming
cem [Sat, 20 Oct 2018 21:09:12 +0000 (21:09 +0000)]
Fortuna: Fix a race to prevent reseed spamming

If multiple threads enter fortuna_pre_read contemporaneously, such as via
read(2) or getrandom(2), they could race to check how long it has been since
the last update due to a TOCTOU problem with 'now'.

Here is an example problematic execution:

Thread A:                       Thread B:
now_A = getsbinuptime();
                                now_B = getsbinuptime();  // now_B > now_A
                                RANDOM_RESEED_LOCK();
                                if (now - fs_lasttime > SBT_1S/10) {
                                        fs_lasttime = now;
                                        ... // reseed
                                }
                                RANDOM_RESEED_UNLOCK();
RANDOM_RESEED_LOCK();
if (now_A - fs_lasttime > SBT_1S/10)  // now_A - fs_lasttime underflows
        fs_lasttime = now_A;
        ... // reseed again, despite less than 100ms elapsing
}
RANDOM_RESEED_UNLOCK();

To resolve the race, simply check the current time after we win the lock
race.

If getsbinuptime is perceived to be expensive, another option might be to
just accept the race and validate that fs_lasttime isn't "in the future."
(It should be within the last ~2^31 seconds out of ~2^32 seconds
representable duration.)

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16984

5 years agorandom(4): Correct a bare zero to the appropriate enum
cem [Sat, 20 Oct 2018 21:06:15 +0000 (21:06 +0000)]
random(4): Correct a bare zero to the appropriate enum

The convention for updating hc_destination[] is to index with a
random_entropy_source.  Zero happens to match RANDOM_CACHED, which is
correct for this source (early random data).  Spell the zero value as the
enum name instead of the magic constant.

No functional change.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16983

5 years agoAdd an assertion to pmap_enter().
markj [Sat, 20 Oct 2018 20:53:35 +0000 (20:53 +0000)]
Add an assertion to pmap_enter().

When modifying an existing managed mapping, we should find a PV entry
for the old mapping.  Verify this.

Before r335784 this would have been implicitly tested by the fact that
we always freed the PV entry for the old mapping.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17626

5 years agoAdd -b/-l options to localedef(1) to specify output endianness and use
yuripv [Sat, 20 Oct 2018 20:51:05 +0000 (20:51 +0000)]
Add -b/-l options to localedef(1) to specify output endianness and use
it appropriately when building share/ctypedef and share/colldef.

This makes the resulting locale data in EL->EB (amd64->powerpc64) cross
build and in the native EB build match.  Revert the changes done to libc
in r308170 as they are no longer needed.

PR: 231965
Reviewed by: bapt, emaste, sbruno, 0mp
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17603

5 years agoUpdate libdialog to 1.3-20180621
bapt [Sat, 20 Oct 2018 20:49:46 +0000 (20:49 +0000)]
Update libdialog to 1.3-20180621

5 years agorandom(4): Translate a comment requirement into a compile-time invariant
cem [Sat, 20 Oct 2018 20:49:37 +0000 (20:49 +0000)]
random(4): Translate a comment requirement into a compile-time invariant

In various places, random represents the set of sources as a 32-bit word
bitmask.  It assumes all sources fit within this, i.e., the maximum valid
source number is 31.

There was a comment specifying this limitation, but we can actually refuse
to compile if our assumption is violated instead.  We still have a few spare
random source slots, but sooner or later someone may need to convert the
masks used from raw 32-bit words to bitset(9) APIs.

This prevents some kinds of developer foot-shooting when adding new random
sources.  No functional change.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16982

5 years agoddb: Enable 'thread <address>'
cem [Sat, 20 Oct 2018 20:45:49 +0000 (20:45 +0000)]
ddb: Enable 'thread <address>'

Currently, the 'thread' command (to switch the debugger to another thread)
only accepts decimal-encoded tids.  Use the same parsing logic as 'show
thread <arg>' to accept hex-encoded thread pointers in addition to
decimal-encoded tids.

Document the 'thread' command in ddb.4 and expand the 'show thread'
documentation to cover the tid usage.

Reported by: bwidawsk
Reviewed by: bwidawsk (earlier version), kib (earlier version), markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16962

5 years agoAdd a dev_refthread.9 document.
cem [Sat, 20 Oct 2018 20:41:25 +0000 (20:41 +0000)]
Add a dev_refthread.9 document.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential: https://reviews.freebsd.org/D16897

5 years agobsd-family-tree: Announce two new releases
eadler [Sat, 20 Oct 2018 20:34:36 +0000 (20:34 +0000)]
bsd-family-tree: Announce two new releases

- OpenBSD 6.4; NetBSD 7.2

5 years agoImport dialog 1.3-20180621
bapt [Sat, 20 Oct 2018 20:32:57 +0000 (20:32 +0000)]
Import dialog 1.3-20180621

5 years agoFortuna: trivial static variable cleanup
cem [Sat, 20 Oct 2018 20:15:06 +0000 (20:15 +0000)]
Fortuna: trivial static variable cleanup

Remove unnecessary use of function-local static variable.  32 bytes is
small enough to live on the stack.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16937

5 years agoFortuna: Add trivial assert to match FS&K definition
cem [Sat, 20 Oct 2018 20:12:57 +0000 (20:12 +0000)]
Fortuna: Add trivial assert to match FS&K definition

FS&K GenerateBlocks function asserts C (counter) != 0.  This should also
be true in our implementation.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16936

5 years agoFortuna: Clean up reseeding key material to closer match FS&K
cem [Sat, 20 Oct 2018 19:44:59 +0000 (19:44 +0000)]
Fortuna: Clean up reseeding key material to closer match FS&K

When reseeding, only incorporate actual key material.  Do not include e.g.
the derived key schedules or other AES context.

I don't think the extra material was harmful here, just not beneficial.

Reviewed by: delphij, markm
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16934

5 years agodev_refthread: Do not initialize *ref when reference was not acquired
cem [Sat, 20 Oct 2018 19:42:38 +0000 (19:42 +0000)]
dev_refthread: Do not initialize *ref when reference was not acquired

Like the companion API devvn_refthread, leave *ref uninitialized when a
reference was not acquired.  Initializing to 1 provides a vaguely
correct-looking but bogus value for broken callers to (mistakenly) pass to
dev_relthread() when refthread fails.

Make it even more clear to consumers that dev_relthread is only valid when
dev_refthread succeeds.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16885

5 years agoNow that we've branched, turn off building DRM and DRM2 by default.
imp [Sat, 20 Oct 2018 19:18:30 +0000 (19:18 +0000)]
Now that we've branched, turn off building DRM and DRM2 by default.

We no longer build the drm/drm2 modules by default. See UPDATING for
which package to install instead. drm and drm2 have been completely
unsupported abandonware for a long time now. Please report issues with
the pkg modules to x11@freebsd.org.

Approved by: FreeBSD Graphics Team

5 years agoAdd a MINIMAL config for i386, based on amd64
cem [Sat, 20 Oct 2018 19:16:43 +0000 (19:16 +0000)]
Add a MINIMAL config for i386, based on amd64

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D17560

5 years agoAdd updating entry for DRM
imp [Sat, 20 Oct 2018 19:14:46 +0000 (19:14 +0000)]
Add updating entry for DRM

Update messaging for which drm module to install. Add guidance on what
hardware is supported (which should be copied into the release
notes). Note: the in tree drivers are abandonware. There has been no
organized support for them for many years, and the plan is to still
remove them for all but arm once the transition to drm-*kmod is
complete. Also note that WITHOUT_MODULE_DRM and WITHOUT_MODULE_DRM2
should generally be added to src.conf for anybody using the drm-*kmod
ports. That will become default in 13 soon, however.

Approved by: FreeBSD Graphics Team
Relnotes: Yes
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D17451

5 years agostty.1: Document kern.tty_info_kstacks behavior (r339471)
cem [Sat, 20 Oct 2018 18:53:32 +0000 (18:53 +0000)]
stty.1: Document kern.tty_info_kstacks behavior (r339471)

Reported by: bdrewery
Reviewed by: bdrewery
Sponsored by: Dell EMC Isilon

5 years agolibelf: also test for 64-bit ELF in _libelf_is_mips64el
emaste [Sat, 20 Oct 2018 18:47:45 +0000 (18:47 +0000)]
libelf: also test for 64-bit ELF in _libelf_is_mips64el

Although _libelf_is_mips64el is only called in contexts where we've
already checked that e_class is ELFCLASS64 but this may change in the
future.  Add a safety belt so that we don't access an invalid e_ehdr64
union member if it does.

Reported by: jkoshy (in review D17380)

5 years agorc.initdiskless: fix commentary grammar after r339465
eugen [Sat, 20 Oct 2018 18:46:36 +0000 (18:46 +0000)]
rc.initdiskless: fix commentary grammar after r339465

MFC after: 1 month

5 years agotty info (^T): Add optional kernel stack(9) traces
cem [Sat, 20 Oct 2018 18:42:28 +0000 (18:42 +0000)]
tty info (^T): Add optional kernel stack(9) traces

It is often useful for developers and administrators to determine a running
thread's stack for debugging purposes.  With this feature, using ^T will
print that information

For now, the feature is disabled by default.  Enable with sysctl
kern.tty_info_kstacks=1.

Discussed with: markj
Reviewed by: oshogbo
Relnotes: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17621

5 years agopf synproxy will do the 3WHS on behalf of the target machine, and once
kp [Sat, 20 Oct 2018 18:37:21 +0000 (18:37 +0000)]
pf synproxy will do the 3WHS on behalf of the target machine, and once
the 3WHS is completed, establish the backend connection. The trigger
for "3WHS completed" is the reception of the first ACK. However, we
should not proceed if that ACK also has RST or FIN set.

PR: 197484
Obtained from: OpenBSD
MFC after: 2 weeks

5 years agoRemove incorrect BSD-2-Clause-FreeBSD SPDX tags
emaste [Sat, 20 Oct 2018 18:32:34 +0000 (18:32 +0000)]
Remove incorrect BSD-2-Clause-FreeBSD SPDX tags

5 years agoReplace ttyprintf with sbuf_printf and tty drain routine
cem [Sat, 20 Oct 2018 18:31:36 +0000 (18:31 +0000)]
Replace ttyprintf with sbuf_printf and tty drain routine

Add string variants of cnputc and tty_putchar, and use them from the tty
sbuf drain routine.

Suggested by: ed@
Sponsored by: Dell EMC Isilon

5 years agoRemove incorrect BSD-2-Clause-FreeBSD SPDX tag
emaste [Sat, 20 Oct 2018 18:30:13 +0000 (18:30 +0000)]
Remove incorrect BSD-2-Clause-FreeBSD SPDX tag

5 years agopfctl tests: Basic test case for PR 231323
kp [Sat, 20 Oct 2018 18:18:28 +0000 (18:18 +0000)]
pfctl tests: Basic test case for PR 231323

PR: 231323
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17508

5 years agorc.initdiskless: add support for auxiliary NVRAM.
eugen [Sat, 20 Oct 2018 18:13:51 +0000 (18:13 +0000)]
rc.initdiskless: add support for auxiliary NVRAM.

Currently, rc.inidiskless assumes that local system configuration
changes are kept in some mountable file system. For example,
nanobsd uses dedicated partition mounted as /cfg for this.

However, small embedded devices like MIPS routers may have no enough flash
space to keep full-blown file system but have only one or couple
small flash blocks to keep persistent local configuration overrides.

This change extends rc.initdiskless and introduces ability to run auxiliary
command /conf/T/M/extract that is supposed to extract configuration overrides
from such local storage.

For example, the command /conf/default/etc/extract may contain something like:

cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg

bsdcpio command extracts compressed archive from the storage to /etc
assuming the storage is exposed by the kernel as /dev/map/cfg to userland.

PR: 204215
MFC after: 1 month

5 years agopfctl: Dup strings
kp [Sat, 20 Oct 2018 18:11:46 +0000 (18:11 +0000)]
pfctl: Dup strings

When we set the ifname we have to copy the string, rather than just keep
the pointer.

PR: 231323
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17507

5 years agoAdd flags variants to linker_files / stack(9) symbol resolution
cem [Sat, 20 Oct 2018 18:08:43 +0000 (18:08 +0000)]
Add flags variants to linker_files / stack(9) symbol resolution

Some best-effort consumers may find trylock behavior for stack(9) symbol
resolution acceptable.  Expose that behavior to such consumers.

This API is ugly.  If in the future the modules and linker file list locking
is cleaned up such that the linker_files list can be iterated safely without
acquiring a sleepable lock, this API should be removed.  However, most of
the time nothing will be holding the linker files lock exclusive and the
acquisition can proceed.

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17620

5 years agoMake upgrade from previous FreeBSD versions less painful
eugen [Sat, 20 Oct 2018 18:01:48 +0000 (18:01 +0000)]
Make upgrade from previous FreeBSD versions less painful
and make previously working configuration like this work again:

gif_interfaces="gif0"
gifconfig_gif0="1.1.1.1 2.2.2.2"
ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252"

PR: 204700
MFC after: 1 month

5 years agonvdimm(4): Fix GCC 6.4.0 build
cem [Sat, 20 Oct 2018 18:01:15 +0000 (18:01 +0000)]
nvdimm(4): Fix GCC 6.4.0 build

-Wformat= pedantically complains that the void* pointer is passed to a %s
format.

Sponsored by: Dell EMC Isilon

5 years agoFix a dead store.
markj [Sat, 20 Oct 2018 18:00:13 +0000 (18:00 +0000)]
Fix a dead store.

We would fail to clear DNS search list configuration if a router
stopped specifying the DNSSL RA option.  I suspect that the bug
was mostly harmless, as the RDNSS and DNSSL options are typically used
together and omitting the RDNSS option would have the same effect.

CID: 1006219
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoixl/iavf(4): Fix GCC 6.4.0 build
cem [Sat, 20 Oct 2018 18:00:12 +0000 (18:00 +0000)]
ixl/iavf(4): Fix GCC 6.4.0 build

Don't define redundant prototypes.

Sponsored by: Dell EMC Isilon

5 years agoFix formatting.
markj [Sat, 20 Oct 2018 17:48:05 +0000 (17:48 +0000)]
Fix formatting.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoAdd myself to calendar, and update mentors-mentee relationships.
rigoletto [Sat, 20 Oct 2018 17:45:42 +0000 (17:45 +0000)]
Add myself to calendar, and update mentors-mentee relationships.

Reviewed by: mat (mentor)
Approved by: tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D17396

5 years agoRemove dead code.
markj [Sat, 20 Oct 2018 17:44:23 +0000 (17:44 +0000)]
Remove dead code.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoStaticize a couple of functions.
markj [Sat, 20 Oct 2018 17:43:27 +0000 (17:43 +0000)]
Staticize a couple of functions.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoBump LLD_REVISION_STRING for 13-CURRENT
emaste [Sat, 20 Oct 2018 17:42:38 +0000 (17:42 +0000)]
Bump LLD_REVISION_STRING for 13-CURRENT

5 years agoRemove some obsolete compatibility code.
markj [Sat, 20 Oct 2018 17:40:30 +0000 (17:40 +0000)]
Remove some obsolete compatibility code.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoCreate some global domainsets and refactor NUMA registration.
markj [Sat, 20 Oct 2018 17:36:00 +0000 (17:36 +0000)]
Create some global domainsets and refactor NUMA registration.

Pre-defined policies are useful when integrating the domainset(9)
policy machinery into various kernel memory allocators.

The refactoring will make it easier to add NUMA support for other
architectures.

No functional change intended.

Reviewed by: alc, gallatin, jeff, kib
Tested by: pho (part of a larger patch)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17416

5 years agoobjcopy: restore behaviour required by GCC's build
emaste [Sat, 20 Oct 2018 17:27:53 +0000 (17:27 +0000)]
objcopy: restore behaviour required by GCC's build

In r339350 filter_reloc() was removed, to fix the case of stripping
statically linked binaries with relocations (which may come from ifunc
use, for example).  As a side effect this changed the behaviour when
stripping object files - the output was broken both before and after
r339350, in different ways.  Unfortunately GCC's build process relies
on the previous behaviour, so:

- Revert r339350, restoring filter_reloc().
- Fix an unitialized variable use (commited as r3638 in ELF Tool Chain).
- Change filter_reloc() to omit relocations referencing removed
  symbols, while retaining relocations with no symbol reference.
- Retain the entire relocation section if it references the dynamic
  symbol table (fix from kaiw in D17596).

PR: 232176
Reported by: antoine
Reviewed by: kaiw
MFC with: r339350
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17596

5 years agoA single comma was missing to separate the "see also" items in
bcr [Sat, 20 Oct 2018 17:22:04 +0000 (17:22 +0000)]
A single comma was missing to separate the "see also" items in
last.1 and lastlogin.8. Add it back.

PR: 231187
Submitted by: david.marec@davenulle.org

5 years agoamd64: relax constraints in curthread and curpcb
mjg [Sat, 20 Oct 2018 17:00:18 +0000 (17:00 +0000)]
amd64: relax constraints in curthread and curpcb

This makes the compiler less likely to reload the content from %gs.

The 'P' modifier drops all synteax prefixes and 'n' constraint treats
input as a known at compilation time immediate integer.

Example reloading victim was spinlock_enter.

Stolen from: OpenBSD

Reported by: jtl
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17615

5 years agovidcontrol(1): Fix a typo in the description of -f
tobik [Sat, 20 Oct 2018 16:59:43 +0000 (16:59 +0000)]
vidcontrol(1): Fix a typo in the description of -f

While here:
- Fix markup in -c
- Fix mandoc -Tlint and igor warnings

Reviewed by: 0mp, bjk
Approved by: bjk
Differential Revision: https://reviews.freebsd.org/D17428

5 years ago- Update head to 13.0-CURRENT.
gjb [Fri, 19 Oct 2018 00:37:47 +0000 (00:37 +0000)]
- Update head to 13.0-CURRENT.
- Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER,
  FREEBSD_CC_VERSION, OS_VERSION.
- Update comment in UPDATING regarding debugging options.
- Remove debug.witness.trace=0 from installation media.
- Bump __FreeBSD_version.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDo not flush cache for PCIe config window.
kib [Thu, 18 Oct 2018 20:49:16 +0000 (20:49 +0000)]
Do not flush cache for PCIe config window.

Apparently AMD machines cannot tolerate this. This was uncovered by
r339386, where cache flush started really flushing the requested range.

Introduce pmap_mapdev_pciecfg(), which simply does not flush cache
comparing with pmap_mapdev().  It assumes that the MCFG region was
never accessed through the cacheable mapping, which is most likely
true for machine to boot at all.

Note that i386 does not need the change, since the architecture
handles access per-page due to the KVA shortage, and page remapping
already does not flush the cache.

Reported and tested by: mjg, Mike Tancsa <mike@sentex.net>
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D17612

5 years agoIn r78161 the lookup_set linker method was introduced which optionally
bz [Thu, 18 Oct 2018 20:20:41 +0000 (20:20 +0000)]
In r78161 the lookup_set linker method was introduced which optionally
returns the section start and stop locations as well as a count if the
caller asks for them.
There was only one out-of-file consumer of count which did not actually
use it and hence was eliminated in r339407.
In r194784 parse_dpcpu(), and in r195699 parse_vnet() (a copy of the
former) started to use the link_elf_lookup_set() interface internally
also asking for the count.

count is computed as the difference of the void **stop - void **start
locations and as such, if the absoulte numbers
(stop - start) % sizeof(void *) != 0
a round-down happens, e.g., **stop 0x1003 - **start 0x1000 => count 0.

To get the section size instead of "count is the number of pointer
elements in the section", the parse_*() functions do a
count *= sizeof(void *).
They use the result to allocate memory and copy the section data
into the "master" and per-instance memory regions with a size of
count.

As a result of count possibly round-down this can miss the last
bytes of the section.  The good news is that we do not touch
out of bounds memory during these operations (we may at a later stage
if the last bytes would overflow the master sections).
Given relocation in elf_relocaddr() works based on the absolute
numbers of start and stop, this means that we can possibly try to
access relocated data which was never copied and hence we get
random garbage or at best zeroed memory.

Stop the two (last) consumers of count (the parse_*() functions)
from using count as well, and calculate the section size based on
the absolute numbers of stop and start and use the proper size for
the memory allocation and data copies.  This will make the symbols
in the last bytes of the pcpu or vnet sections be presented as
expected.

PR: 232289
Approved by: re (gjb)
MFC after: 2 weeks

5 years agoThe handling of RST segments in the SYN-RCVD state exists in the
tuexen [Thu, 18 Oct 2018 19:21:18 +0000 (19:21 +0000)]
The handling of RST segments in the SYN-RCVD state exists in the
code paths. Both are not consistent and the one on the syn cache code
does not conform to the relevant specifications (Page 69 of RFC 793
and Section 4.2 of RFC 5961).

This patch fixes this:
* The sequence numbers checks are fixed as specified on
  page Page 69 RFC 793.
* The sysctl variable net.inet.tcp.insecure_rst is now honoured
  and the behaviour as specified in Section 4.2 of RFC 5961.

Approved by: re (gjb@)
Reviewed by: bz@, glebius@, rrs@,
Differential Revision: https://reviews.freebsd.org/D17595
Sponsored by: Netflix, Inc.

5 years agoCorrect the comment for the 20181015 entry in ObsoleteFiles.inc.
gjb [Thu, 18 Oct 2018 19:07:15 +0000 (19:07 +0000)]
Correct the comment for the 20181015 entry in ObsoleteFiles.inc.

Reported by: rpokala
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoThe local_unbound service will configure and bootstrap itself, but only
des [Thu, 18 Oct 2018 18:33:44 +0000 (18:33 +0000)]
The local_unbound service will configure and bootstrap itself, but only
if a network connection is available.  This is not an issue when running
'service local_unbound setup' interactively, but can be on a diskless
system where local_unbound self-configures on every boot.  To address
this, add explicit dependencies on netwait and defaultroute.

Submitted by: eugen
Approved by: re (gjb)

5 years agoAdd support for DNS-over-TLS to the local_unbound service.
des [Thu, 18 Oct 2018 15:35:13 +0000 (15:35 +0000)]
Add support for DNS-over-TLS to the local_unbound service.

Approved by: re (kib)

5 years agoSupport RISC-V implementations that do not manage the A and D bits
br [Thu, 18 Oct 2018 15:25:07 +0000 (15:25 +0000)]
Support RISC-V implementations that do not manage the A and D bits
(e.g. RocketChip, lowRISC and derivatives).

RISC-V page table entries support A (accessed) and D (dirty) bits. The
spec makes hardware support for these bits optional. Implementations that
do not manage these bits in hardware raise page faults for accesses to a
valid page without A set and writes to a writable page without D set.
Check for these types of faults when handling a page fault and fixup the
PTE without calling vm_fault if they occur.

Reviewed by: jhb, markj
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17424

5 years agoRevert r339421 due to unintended files included to commit.
br [Thu, 18 Oct 2018 15:17:58 +0000 (15:17 +0000)]
Revert r339421 due to unintended files included to commit.

Reported by: ian
Approved by: re (gjb)
Sponsored by: DARPA, AFRL

5 years agoSupport RISC-V implementations that do not manage the A and D bits
br [Thu, 18 Oct 2018 15:08:14 +0000 (15:08 +0000)]
Support RISC-V implementations that do not manage the A and D bits
(e.g. RocketChip, lowRISC and derivatives).

RISC-V page table entries support A (accessed) and D (dirty) bits. The
spec makes hardware support for these bits optional. Implementations that
do not manage these bits in hardware raise page faults for accesses to a
valid page without A set and writes to a writable page without D set.
Check for these types of faults when handling a page fault and fixup the
PTE without calling vm_fault if they occur.

Reviewed by: jhb, markj
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17424

5 years agoFix typos from r339409.
jamie [Thu, 18 Oct 2018 15:02:57 +0000 (15:02 +0000)]
Fix typos from r339409.

Reported by: maxim
Approved by: re (gjb)

5 years agor334853 added a "socket destructor" callback. However, as implemented, it
jtl [Thu, 18 Oct 2018 14:20:15 +0000 (14:20 +0000)]
r334853 added a "socket destructor" callback. However, as implemented, it
was really a "socket close" callback.

Update the socket destructor functionality to run when a socket is
destroyed (rather than when it is closed). The original submitter has
confirmed that this change satisfies the intended use case.

Suggested by: rwatson
Submitted by: Michio Honda <micchie at sfc.wide.ad.jp>
Tested by: Michio Honda <micchie at sfc.wide.ad.jp>
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17590

5 years agoWhile preparing to move init(8) to its own package as indicated
bz [Thu, 18 Oct 2018 02:07:30 +0000 (02:07 +0000)]
While preparing to move init(8) to its own package as indicated
in r339413, a current pkgbase update problem came up.  For users
testing pkgbase at the moment there is no (automatic) way to pick
up new base packages (yet).
As a result rather than also moving init(8) to its own package,
back out the part of the change in r339413 that moved rc* to its
own package and defer creating new packages until the
infrastructure is in place to handle these cases.
Both init and rc* are considered too problematic to be lost by
early adaptors at this stage.

Discussed with: brd
Reviewed by: brd
Approved by: re (gjb)

5 years agoFix modules/nvdimm build issues after r339391 by adding a dependency
bz [Thu, 18 Oct 2018 00:51:42 +0000 (00:51 +0000)]
Fix modules/nvdimm build issues after r339391 by adding a dependency
to the SRC list.  Sort the list while changing the line.

Reported by: ci.f.o, make -j24 buildkernel
Approved by: re (gjb)

5 years agoFix spelling of an error message and add warning to another error
bz [Wed, 17 Oct 2018 16:54:13 +0000 (16:54 +0000)]
Fix spelling of an error message and add warning to another error
case in tunefs(8).

Reviewed by: imp (2017 version of the same diff)
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D10046

5 years agoMove the rc framework out of sbin/init into libexec/rc.
bz [Wed, 17 Oct 2018 16:49:11 +0000 (16:49 +0000)]
Move the rc framework out of sbin/init into libexec/rc.

The reasons for this are forward looking to pkgbase:
 * /sbin/init is a special binary; try not to replace it with
   every package update because an rc script was touched.
   (a follow-up commit will make init its own package)
 * having rc in its own place will allow more easy replacement
   of the rc framework with alternatives, such as openrc.

Discussed with: brd (during BSDCam), kmoore
Requested by: cem, bz
PR: 231522
Approved by: re (gjb)

5 years agoRevert r315571 for share/timedef/ca_IT.ISO8859-15.src, ca_IT is Catalan
yuripv [Wed, 17 Oct 2018 16:38:44 +0000 (16:38 +0000)]
Revert r315571 for share/timedef/ca_IT.ISO8859-15.src, ca_IT is Catalan
in Italy, and is not related to Canada.

While here, remove the header as we do NOT currently use CLDR data to
generate timedef, and it's misleading.

PR: 225855
Reviewed by: bapt
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17551

5 years agoAdd a new jail permission, allow.read_msgbuf. When true, jailed processes
jamie [Wed, 17 Oct 2018 16:11:43 +0000 (16:11 +0000)]
Add a new jail permission, allow.read_msgbuf.  When true, jailed processes
can see the dmesg buffer (this is the current behavior).  When false (the
new default), dmesg will be unavailable to jailed users, whether root or
not.

The security.bsd.unprivileged_read_msgbuf sysctl still works as before,
controlling system-wide whether non-root users can see the buffer.

PR: 211580
Submitted by: bz
Approved by: re@ (kib@)
MFC after: 3 days

5 years agostrptime: fix parsing of tm_year when both %C and %y appear in the
yuripv [Wed, 17 Oct 2018 14:51:43 +0000 (14:51 +0000)]
strptime: fix parsing of tm_year when both %C and %y appear in the
format string in arbitrary order.  This makes the related test cases in
lib/libc/tests/time (not yet connected to the build) pass.

While here, don't error on negative tm_year value based on the
APPLICATION USAGE in
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
(glibc does the same):

tm_year is a signed value; therefore, years before 1900 may be represented.

Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17550

5 years agoThe countp argument passed to linker_file_lookup_set() in
bz [Wed, 17 Oct 2018 10:31:08 +0000 (10:31 +0000)]
The countp argument passed to linker_file_lookup_set() in
linker_load_dependencies() is unused, so no need to ask for the
value in first place.  Remove the unused "count" variable.

Approved by: re (kib)

5 years agoAdd initial driver for ACPI NFIT-enumerated NVDIMMs.
kib [Tue, 16 Oct 2018 20:12:35 +0000 (20:12 +0000)]
Add initial driver for ACPI NFIT-enumerated NVDIMMs.

Driver enumerates NVDIMMs.  Besides, for each found System Physical
Address (SPA) range, spaN geom provider is created, which allows
formatting and mounting the region as the normal volume.  Also,
/dev/nvdimm_spaN node is created, which can be read/written/mapped by
userspace, the mapping is zero-copy.

No support for block access methods implemented, labels are not
parsed.   No management interfaces are provided.

Tested by: Intel, NetApp
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 2 weeks

5 years agoReparent a child of pdfork(2) to its reaper when the procdesc is closed.
markj [Tue, 16 Oct 2018 20:06:56 +0000 (20:06 +0000)]
Reparent a child of pdfork(2) to its reaper when the procdesc is closed.

Unconditionally reparenting to PID 1 breaks the procctl(2) reaper
functionality.

Add a regression test for this case.

Reviewed by: kib
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17589

5 years agoFix for reception of large full speed isochronous frames via the transaction
hselasky [Tue, 16 Oct 2018 18:47:13 +0000 (18:47 +0000)]
Fix for reception of large full speed isochronous frames via the transaction
translator, when using the DWC OTG USB controller driver. Make sure to re-try
getting the complete split packets until a DATA0 packet is received. Larger
isochronous frames may be split into multiple MDATA packets terminated
by a single DATA0 packet.

PR: 230434
MFC after: 3 days
Approved by: re (gjb)
Sponsored by: Mellanox Technologies

5 years agoGet rid unneccessary useless calls to lseek(2) from getgrent(3).
trasz [Tue, 16 Oct 2018 18:17:07 +0000 (18:17 +0000)]
Get rid unneccessary useless calls to lseek(2) from getgrent(3).
Looks like this:

 fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r-- ,inode=2167001,size=390,blksize=32768 },0x0) = 0 (0x0)
 open("/etc/group",O_RDONLY|O_CLOEXEC,0666)      = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=2166927,size=919,blksize=32768 }) = 0 (0x0)
-lseek(3,0x0,SEEK_CUR)                           = 0 (0x0)
-lseek(3,0x0,SEEK_SET)                           = 0 (0x0)
 read(3,"# $FreeBSD: release/10.0.0/etc/g"...,32768) = 919 (0x397)
 close(3)                                        = 0 (0x0)

Reviewed by: kib
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17571

5 years agoProvide pmap_large_map() KPI on amd64.
kib [Tue, 16 Oct 2018 17:28:10 +0000 (17:28 +0000)]
Provide pmap_large_map() KPI on amd64.

The KPI allows to map very large contigous physical memory regions
into KVA, which are not covered by DMAP.

I see both with QEMU and with some real hardware started shipping, the
regions for NVDIMMs might be very far apart from the normal RAM, and
we expect that at least initial users of NVDIMM could install very
large amount of such memory.  IMO it is not reasonable to extend DMAP
to cover that far-away regions both because it could overflow existing
4T window for DMAP in KVA, and because it costs in page table pages
allocations, for gap and for possibly unused NV RAM.

Also, KPI provides some special functionality for fast cache flushing
based on the knowledge of the NVRAM mapping use.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17070

5 years agoapropos/whatis: use output of manpath(1) to set defpaths if -M is not
yuripv [Tue, 16 Oct 2018 17:17:11 +0000 (17:17 +0000)]
apropos/whatis: use output of manpath(1) to set defpaths if -M is not
specified.  This fixes searching the paths specified in
/usr/local/etc/man.d/*.conf, as currently apropos/whatis from mandoc
suite aren't aware about them.

PR: 227922
Reviewed by: bapt
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17454

5 years agoAdd clwb().
kib [Tue, 16 Oct 2018 17:00:42 +0000 (17:00 +0000)]
Add clwb().

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D17070

5 years agoInvalidate TLB on a local hart.
br [Tue, 16 Oct 2018 16:03:17 +0000 (16:03 +0000)]
Invalidate TLB on a local hart.

This was missed in r339367 ("Various fixes for TLB management on RISC-V.").

This fixes operation on lowRISC.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17583

5 years agopw: (file == NULL) check is always false in read_userconfig(), remove
yuripv [Tue, 16 Oct 2018 16:00:41 +0000 (16:00 +0000)]
pw: (file == NULL) check is always false in read_userconfig(), remove
it.  Drop the now unused _PATH_PW_CONF definition. [1]

While here, change the last remaining hardcoded "/etc" to _PATH_PWD.

Noted by: glebius [1]
Reviewed by: eugen
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17575

5 years agoPlug sendfile(2) on a listening socket with proper error code.
glebius [Tue, 16 Oct 2018 15:57:16 +0000 (15:57 +0000)]
Plug sendfile(2) on a listening socket with proper error code.

Reported by: ngie
Reviewed by: ngie
Approved by: re (delphij)

5 years agoIn r338102, the TCP reassembly code was substantially restructured. Prior
jtl [Tue, 16 Oct 2018 14:41:09 +0000 (14:41 +0000)]
In r338102, the TCP reassembly code was substantially restructured. Prior
to this change, the code sometimes used a temporary stack variable to hold
details of a TCP segment. r338102 stopped using the variable to hold
segments, but did not actually remove the variable.

Because the variable is no longer used, we can safely remove it.

Approved by: re (gjb)

5 years agoUpdate head from ALPHA9 to ALPHA10 as part of the 12.0-RELEASE
gjb [Tue, 16 Oct 2018 14:16:39 +0000 (14:16 +0000)]
Update head from ALPHA9 to ALPHA10 as part of the 12.0-RELEASE
cycle.

This is expected to be the final ALPHA build of this release
cycle, prior to branching stable/12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoImport CK as of commit 5221ae2f3722a78c7fc41e47069ad94983d3bccb.
jtl [Tue, 16 Oct 2018 02:30:13 +0000 (02:30 +0000)]
Import CK as of commit 5221ae2f3722a78c7fc41e47069ad94983d3bccb.
This fixes two problems, one where epoch calls could occur before all
the readers had exited the epoch section, and one where the epoch calls
could be unnecessarily delayed.

Approved by: re (glebius)

5 years agoSkip VDEV_IO_DONE stage only for ZIO_TYPE_FREE.
mav [Mon, 15 Oct 2018 21:59:24 +0000 (21:59 +0000)]
Skip VDEV_IO_DONE stage only for ZIO_TYPE_FREE.

Device removal code uses zio_vdev_child_io() with ZIO_TYPE_NULL parent,
that never happened before.  It confused FreeBSD-specific TRIM code,
which does not use VDEV_IO_DONE for logical ZIO_TYPE_FREE ZIOs.  As
result of that stage being skipped device removal ZIOs leaked references
and memory that supposed to be freed by VDEV_IO_DONE, making it stuck.

It is a quick patch rather then a nice fix, but hopefully we'll be able
to drop it all together when alternative TRIM implementation finally get
landed.

PR: 228750, 229007
Discussed with: allanjude, avg, smh
Approved by: re (delphij)
MFC after: 5 days
Sponsored by: iXsystems, Inc.

5 years agoCorrect COMPAT* macro names in syscalls.master
kevans [Mon, 15 Oct 2018 21:35:57 +0000 (21:35 +0000)]
Correct COMPAT* macro names in syscalls.master

Both ^/sys/compat/freebsd32/syscalls.master and ^/sys/kern/syscalls.master
cited "COMPAT[n] #ifdef" instead of "COMPAT_FREEBSD[n] #ifdef" in places.

Approved by: re (glebius)

5 years agoAvoid OOB reads in memmem(3).
glebius [Mon, 15 Oct 2018 20:20:57 +0000 (20:20 +0000)]
Avoid OOB reads in memmem(3).

commit 51bdcdc424bd7169c8cccdc2de7cad17f5ea0f70
Author: Alexander Monakov <amonakov@ispras.ru>
Date:   Fri Jun 30 00:35:33 2017 +0300

    fix OOB reads in Xbyte_memmem

    Reported by Leah Neukirchen.

Reviewed by: emaste
Approved by: re (kib)

5 years agopw: respect path specified using -V when writing pw.conf, and -C is not
yuripv [Mon, 15 Oct 2018 20:11:53 +0000 (20:11 +0000)]
pw: respect path specified using -V when writing pw.conf, and -C is not
explicitly specified.  -V path is already used to determine which file
to read default values from, so it's only logical to write them to the
same file.

PR: 231653
Reviewed by: eugen, bapt
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17566

5 years agoPrevent flex(1) from generating calls to isatty(3) - and, in turn,
trasz [Mon, 15 Oct 2018 19:48:36 +0000 (19:48 +0000)]
Prevent flex(1) from generating calls to isatty(3) - and, in turn,
TIOCGETA ioctls - when parsing nsswitch.conf(5).

Reviewed by: imp, markj
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17564