]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoTurn back the clock just a little: make userboot.so always be 4th
Warner Losh [Sun, 19 Aug 2018 18:18:19 +0000 (18:18 +0000)]
Turn back the clock just a little: make userboot.so always be 4th

Turns out there was a hidden dependency we hasn't counted upon.  The
host load /boot/userboot.so to boot the VMs it runs. This means that
the change to lua meant suddently that nobody could run their older
VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or
whatever.  Even more than for the /boot/loader* binaries, we need a
good coexistance strategy for this. While that's being designed and
implemented, drop back to always 4th for userboot.so. This will fail
safe in all but the most extreme environments (but lua-only hacks
to .lua files won't be processes in VMs until we fix it).

Differential Review: https://reviews.freebsd.org/D16805

5 years agolualoader: Stop exporting drawer.draw
Kyle Evans [Sun, 19 Aug 2018 18:12:11 +0000 (18:12 +0000)]
lualoader: Stop exporting drawer.draw

drawer.draw is the back-end for drawlogo and drawbrand and should not be
used directly.

5 years agoFix a couple of comment nits.
John Baldwin [Sun, 19 Aug 2018 17:57:51 +0000 (17:57 +0000)]
Fix a couple of comment nits.

5 years agoBump __FreeBSD_version after r338059 (Chacha20 based arc4random(3)
Xin LI [Sun, 19 Aug 2018 17:47:30 +0000 (17:47 +0000)]
Bump __FreeBSD_version after r338059 (Chacha20 based arc4random(3)
and deprecation of arc4random_stir and arc4random_addrandom).

5 years agoDocument socket control message routines for ancillary data access (CMSG_DATA).
Mateusz Piotrowski [Sun, 19 Aug 2018 17:42:49 +0000 (17:42 +0000)]
Document socket control message routines for ancillary data access (CMSG_DATA).

PR: 227777
Reviewed by: bcr, eadler
Approved by: mat (mentor), manpages (bcr)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D15215

5 years agoUpdate userland arc4random() with OpenBSD's Chacha20 based arc4random().
Xin LI [Sun, 19 Aug 2018 17:40:50 +0000 (17:40 +0000)]
Update userland arc4random() with OpenBSD's Chacha20 based arc4random().

  ObsoleteFiles.inc:

    Remove manual pages for arc4random_addrandom(3) and
    arc4random_stir(3).

  contrib/ntp/lib/isc/random.c:
  contrib/ntp/sntp/libevent/evutil_rand.c:

    Eliminate in-tree usage of arc4random_addrandom().

  crypto/heimdal/lib/roken/rand.c:
  crypto/openssh/config.h:

    Eliminate in-tree usage of arc4random_stir().

  include/stdlib.h:

    Remove arc4random_stir() and arc4random_addrandom() prototypes,
    provide temporary shims for transistion period.

  lib/libc/gen/Makefile.inc:

    Hook arc4random-compat.c to build, add hint for Chacha20 source for
    kernel, and remove arc4random_addrandom(3) and arc4random_stir(3)
    links.

  lib/libc/gen/arc4random.c:

    Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the
    sys/crypto/chacha20 implementation of keystream.

  lib/libc/gen/Symbol.map:

    Remove arc4random_stir and arc4random_addrandom interfaces.

  lib/libc/gen/arc4random.h:

    Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own.

  lib/libc/gen/arc4random.3:

    Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and
    r118247.

  lib/libc/gen/arc4random-compat.c:

    Compatibility shims for arc4random_stir and arc4random_addrandom
    functions to preserve ABI.  Log once when called but do nothing
    otherwise.

  lib/libc/gen/getentropy.c:
  lib/libc/include/libc_private.h:

    Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl).
    Remove from libc_private.h as a result.

  sys/crypto/chacha20/chacha.c:
  sys/crypto/chacha20/chacha.h:

    Make it possible to use the kernel implementation in libc.

PR: 182610
Reviewed by: cem, markm
Obtained from: OpenBSD
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16760

5 years agoFix the MPTable probe code after the 4:4 changes on i386.
John Baldwin [Sun, 19 Aug 2018 17:36:50 +0000 (17:36 +0000)]
Fix the MPTable probe code after the 4:4 changes on i386.

The MPTable probe code was using PMAP_MAP_LOW as the PA -> VA offset
when searching for the table signature but still using KERNBASE once
it had found the table.  As a result, the mpfps table pointed into a
random part of the kernel text instead of the actual MP Table.

Rather than adding more #ifdef's, use BIOS_PADDRTOVADDR from
<machine/pc/bios.h> which already uses PMAP_MAP_LOW on i386 and KERNBASE
on amd64.

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

5 years agoFor traditional disks, the filesystem attempts to allocate the
Kirk McKusick [Sun, 19 Aug 2018 17:19:20 +0000 (17:19 +0000)]
For traditional disks, the filesystem attempts to allocate the
blocks of a file as contiguously as possible. Since the filesystem
does not know how large a file will grow when it is first being
written, it initially places the file in a set of blocks in which
it currently fits. As it grows, it is relocated to areas with
larger contiguous blocks.  In this way it saves its large contiguous
sets of blocks for the files that need them and thus avoids
unnecessaily fragmenting its disk space.

We used to skip reallocating the blocks of a file into a contiguous
sequence if the underlying flash device requested BIO_DELETE
notifications, because devices that benefit from BIO_DELETE also
benefit from not moving the data. However, in the algorithm described
above that reallocates the blocks, the destination for the data is
usually moved before the data is written to the initially allocated
location. So we rarely suffer the penalty of extra writes.  With
the addition of the consolodation of contiguous blocks into single
BIO_DELETE operations, having fewer but larger contiguous blocks
reduces the number of (slow and expensive) BIO_DELETE operations.
So when doing BIO_DELETE consolodation, we do block reallocation.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoAdd consolodation of TRIM / BIO_DELETE commands to the UFS/FFS filesystem.
Kirk McKusick [Sun, 19 Aug 2018 16:56:42 +0000 (16:56 +0000)]
Add consolodation of TRIM / BIO_DELETE commands to the UFS/FFS filesystem.

When deleting files on filesystems that are stored on flash-memory
(solid-state) disk drives, the filesystem notifies the underlying
disk of the blocks that it is no longer using. The notification
allows the drive to avoid saving these blocks when it needs to
flash (zero out) one of its flash pages. These notifications of
no-longer-being-used blocks are referred to as TRIM notifications.
In FreeBSD these TRIM notifications are sent from the filesystem
to the drive using the BIO_DELETE command.

Until now, the filesystem would send a separate message to the drive
for each block of the file that was deleted. Each Gigabyte of file
size resulted in over 3000 TRIM messages being sent to the drive.
This burst of messages can overwhelm the drive's task queue causing
multiple second delays for read and write requests.

This implementation collects runs of contiguous blocks in the file
and then consolodates them into a single BIO_DELETE command to the
drive. The BIO_DELETE command describes the run of blocks as a
single large block being deleted. Each Gigabyte of file size can
result in as few as two BIO_DELETE commands and is typically less
than ten.  Though these larger BIO_DELETE commands take longer to
run, they do not clog the drive task queue, so read and write
commands can intersperse effectively with them.

Though this new feature has been throughly reviewed and tested, it
is being added disabled by default so as to minimize the possibility
of disrupting the upcoming 12.0 release. It can be enabled by running
``sysctl vfs.ffs.dotrimcons=1''. Users are encouraged to test it.
If no problems arise, we will consider requesting that it be enabled
by default for 12.0.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoRemove some vestiges of IPI_LAZYPMAP on i386.
John Baldwin [Sun, 19 Aug 2018 16:14:59 +0000 (16:14 +0000)]
Remove some vestiges of IPI_LAZYPMAP on i386.

The support for lazy pmap invalidations on i386 was removed in r281707.
This removes the constant for the IPI and stops accounting for it when
sizing the interrupt count arrays.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16801

5 years agoAdd config.lua(8) to the tree
Kyle Evans [Sun, 19 Aug 2018 15:07:39 +0000 (15:07 +0000)]
Add config.lua(8) to the tree

Reviewed by: 0mp, rpokala (earlier version)
Differential Revision: https://reviews.freebsd.org/D14819

5 years agoDon't expose the uptime via the TCP timestamps.
Michael Tuexen [Sun, 19 Aug 2018 14:56:10 +0000 (14:56 +0000)]
Don't expose the uptime via the TCP timestamps.

The TCP client side or the TCP server side when not using SYN-cookies
used the uptime as the TCP timestamp value. This patch uses in all
cases an offset, which is the result of a keyed hash function taking
the source and destination addresses and port numbers into account.
The keyed hash function is the same a used for the initial TSN.

Reviewed by: rrs@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16636

5 years agolibsa: Add lshrdi3.c for powerpc* and mips
Kyle Evans [Sun, 19 Aug 2018 14:48:32 +0000 (14:48 +0000)]
libsa: Add lshrdi3.c for powerpc* and mips

5 years agoProvide set_constraint_handler_s(3) man page.
Konstantin Belousov [Sun, 19 Aug 2018 14:39:57 +0000 (14:39 +0000)]
Provide set_constraint_handler_s(3) man page.

Mention abort_handler_s(3) and ignore_handler_s(3), provide
cross-reference from memset(3).

Submitted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D16797

5 years agostand: Flip the default interpreter to Lua
Kyle Evans [Sun, 19 Aug 2018 14:26:33 +0000 (14:26 +0000)]
stand: Flip the default interpreter to Lua

After years in the making, lualoader is ready to make its debut. Both
flavors of loader are still built by default, and may be installed as
/boot/loader or /boot/loader.efi as appropriate either by manually creating
hard links or using LOADER_DEFAULT_INTERP as documented in build(7).

Discussed with: imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16795

5 years agoClarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility.
Konstantin Belousov [Sun, 19 Aug 2018 14:25:28 +0000 (14:25 +0000)]
Clarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility.
Fix typos and other nits.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D16797

5 years agoUse tab for indent.
Konstantin Belousov [Sun, 19 Aug 2018 14:22:45 +0000 (14:22 +0000)]
Use tab for indent.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 3 days

5 years agoThe bucket index is subtracted by one at lines 2304 and 2314. When 0 it
Cy Schubert [Sun, 19 Aug 2018 13:45:03 +0000 (13:45 +0000)]
The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
becomes -1, except these are unsigned integers, so they become very large
numbers. Thus are always larger than the maximum bucket; the hash table
insertion fails causing NAT to fail.

This commit ensures that if the index is already zero it is not reduced
prior to insertion into the hash table.

PR: 208566

5 years agoAdd handy DTrace probes useful in diagnosing NAT issues. DTrace probes
Cy Schubert [Sun, 19 Aug 2018 13:44:59 +0000 (13:44 +0000)]
Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes
are situated next to error counters and/or in one instance prior to the
-1 return from various functions. This was useful in diagnosis of
PR/208566 and will be handy in the future diagnosing NAT failures.

PR: 208566
MFC after: 3 days

5 years agoExpose np (nat_t - an entry in the nat table structure) in the DTrace
Cy Schubert [Sun, 19 Aug 2018 13:44:56 +0000 (13:44 +0000)]
Expose np (nat_t - an entry in the nat table structure) in the DTrace
probe when nat fails (label badnat). This is useful in diagnosing
failed NAT issues and was used in PR/208566.

PR: 208566
MFC after: 3 days

5 years agoFix typo.
Konstantin Belousov [Sun, 19 Aug 2018 13:23:46 +0000 (13:23 +0000)]
Fix typo.

Noted by: Yuri Pankov <yuripv@yuripv.net>
MFC after: 12 days

5 years agoDocument LOADER_DEFAULT_INTERP.
Warner Losh [Sun, 19 Aug 2018 10:15:28 +0000 (10:15 +0000)]
Document LOADER_DEFAULT_INTERP.

This controls what interpreter the default boot loader in
/boot/loader{,.efi} is, and which one we compile into userboot by
default.

5 years agosend-pr: wave goodbye
Eitan Adler [Sun, 19 Aug 2018 07:12:35 +0000 (07:12 +0000)]
send-pr: wave goodbye

Entering into the world of 12.x we no longer need even the placeholder
for send-pr. It has not done anything for some time.

With Hat: bugmeister

5 years agobuild: remove reference to some dead utilities
Eitan Adler [Sun, 19 Aug 2018 07:05:33 +0000 (07:05 +0000)]
build: remove reference to some dead utilities

5 years agodiff(1): Refactor -B a little bit
Kyle Evans [Sun, 19 Aug 2018 04:15:38 +0000 (04:15 +0000)]
diff(1): Refactor -B a little bit

Instead of doing a second pass to skip empty lines if we've specified -I, go
ahead and check both at once. Ignore critera has been split out into its own
function to try and keep the logic cleaner.

5 years agodiff(1): Implement -B/--ignore-blank-lines
Kyle Evans [Sun, 19 Aug 2018 03:57:20 +0000 (03:57 +0000)]
diff(1): Implement -B/--ignore-blank-lines

As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag.
This was not previously implemented here, so one was forced to create a link
for GNU diff to /usr/local/bin/diff

Implement the -B flag and add some primitive tests for it. It is implemented
in the same fashion that -I is implemented; each chunk's lines are scanned,
and if a non-blank line is encountered then the chunk will be output.
Otherwise, it's skipped.

MFC after: 2 weeks

5 years agoExtending the delay cycles to give the codec more time to pump ADC data across the...
Tai-hwa Liang [Sun, 19 Aug 2018 01:14:46 +0000 (01:14 +0000)]
Extending the delay cycles to give the codec more time to pump ADC data across the AC-link.

Without this patch, some CS4614 cards will need users to reload the driver manually or
the hardware won't be initialised properly. Something like:

# kldload snd_csa
# kldunload snd_csa
# kldload snd_csa

Tested with: Terratec SiXPack 5.1+

5 years agoBack out r338035 until Warner is finished churning GSoC PNP patches
Conrad Meyer [Sun, 19 Aug 2018 00:46:22 +0000 (00:46 +0000)]
Back out r338035 until Warner is finished churning GSoC PNP patches

I was not aware Warner was making or planning to make forward progress in
this area and have since been informed of that.

It's easy to apply/reapply when churn dies down.

5 years agoRemove unused and easy to misuse PNP macro parameter
Conrad Meyer [Sun, 19 Aug 2018 00:22:21 +0000 (00:22 +0000)]
Remove unused and easy to misuse PNP macro parameter

Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely.  The 'table' parameter is now required to
have correct pointer (or array) type.  Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

  $ cat modpnpsize0.cocci
    @normaltables@
    identifier b,c;
    expression a,d,e;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,d,
    -sizeof(d[0]),
     e);

    @singletons@
    identifier b,c,d;
    expression a;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,&d,
    -sizeof(d),
     1);

  $ rg -l MODULE_PNP_INFO -- sys | \
    xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not.  So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).

5 years agoOops. r338030 didn't eliminate the unused arena argument from all of
Alan Cox [Sat, 18 Aug 2018 22:35:19 +0000 (22:35 +0000)]
Oops.  r338030 didn't eliminate the unused arena argument from all of
kmem_alloc_attr()'s callers.  Correct that mistake.

5 years agoReplace the TRIM consolodation framework originally added in -r337396
Kirk McKusick [Sat, 18 Aug 2018 22:21:59 +0000 (22:21 +0000)]
Replace the TRIM consolodation framework originally added in -r337396
driven by problems found with the algorithms being tested for TRIM
consolodation.

Reported by:  Peter Holm
Suggested by: kib
Reviewed by:  kib
Sponsored by: Netflix

5 years agoEliminate the unused arena parameter from kmem_alloc_attr().
Alan Cox [Sat, 18 Aug 2018 22:07:48 +0000 (22:07 +0000)]
Eliminate the unused arena parameter from kmem_alloc_attr().

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D16793

5 years agoRevert -r337396. It is being replaced with a revised interface that
Kirk McKusick [Sat, 18 Aug 2018 21:21:06 +0000 (21:21 +0000)]
Revert -r337396. It is being replaced with a revised interface that
resulted from testing and further reviews.

5 years agols(1): Gate the do_color_* definitions behind COLORLS
Kyle Evans [Sat, 18 Aug 2018 21:03:19 +0000 (21:03 +0000)]
ls(1): Gate the do_color_* definitions behind COLORLS

Pointy hat to: me

5 years agols(1): Support other aliases for --color arguments used by GNU ls(1)
Kyle Evans [Sat, 18 Aug 2018 20:55:20 +0000 (20:55 +0000)]
ls(1): Support other aliases for --color arguments used by GNU ls(1)

These aliases are supported and documented in the man page. For now, they
will not be mentioned in the error when an invalid argument is encountered,
instead keeping that list to the shorter 'preferred' names of each argument.

Reported by: rgrimes

5 years agoUse the size of one bge_devs element for the MODULE_PNP_INFO macro,
Dimitry Andric [Sat, 18 Aug 2018 20:41:43 +0000 (20:41 +0000)]
Use the size of one bge_devs element for the MODULE_PNP_INFO macro,
instead of the size of the whole bge_devs array.

This should stop kldxref searching beyond the end of .rodata when it
processes relocations, and emitting "unhandled relocation type" errors,
at least on i386.

5 years agoRudimentary AER reading code for ddb(4).
Konstantin Belousov [Sat, 18 Aug 2018 20:35:19 +0000 (20:35 +0000)]
Rudimentary AER reading code for ddb(4).

This is very primitive code to inspect the PCI error state and AER
error state, dump the log and clear errors, from ddb.
pci_print_faulted_dev() is made external to allow calling it from
other places.  It was called from NMI handler but this chunk is not
included.

Also there is a tunable-controlled code to clear AER on device attach,
disabled by default.

All this code was useful to me when I debugged ACPI_DMAR failures (not
faults) long time ago.

Reviewed by: cem, imp (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7813

5 years agoMake 'device crypto' lines more consistent.
John Baldwin [Sat, 18 Aug 2018 20:32:08 +0000 (20:32 +0000)]
Make 'device crypto' lines more consistent.

- In configurations with a pseudo devices section, move 'device crypto'
  into that section.
- Use a consistent comment.  Note that other things common in kernel
  configs such as GELI also require 'device crypto', not just IPSEC.

Reviewed by: rgrimes, cem, imp
Differential Revision: https://reviews.freebsd.org/D16775

5 years agoFix casts between 64-bit physical addresses and pointers in EFI.
John Baldwin [Sat, 18 Aug 2018 20:28:25 +0000 (20:28 +0000)]
Fix casts between 64-bit physical addresses and pointers in EFI.

Compiling FreeBSD/i386 with modern GCC triggers warnings for various
places that convert 64-bit EFI_ADDRs to pointers and vice versa.
- Cast pointers to uintptr_t rather than to uint64_t when assigning
  to a 64-bit integer.
- Cast 64-bit integers to uintptr_t before a cast to a pointer.

Reviewed by: kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16586

5 years agoUse 'bool' instead of 'int' for various boolean flags.
John Baldwin [Sat, 18 Aug 2018 20:23:53 +0000 (20:23 +0000)]
Use 'bool' instead of 'int' for various boolean flags.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16611

5 years agores_find: Fix fallback logic
Kyle Evans [Sat, 18 Aug 2018 19:45:56 +0000 (19:45 +0000)]
res_find: Fix fallback logic

The fallback logic was broken if hints were found in multiple environments.
If we found a hint in either the loader environment or the static
environment, fallback would be incremented excessively when we returned to
the environment-selection bits. These checks should have also been guarded
by the fbacklvl checks. As a result, fbacklvl could quickly get to a point
where we skip either the static environment and/or the static hints
depending on which environments contained valid hints.

The impact of this bug is minimal, mostly affecting mips boards that use
static hints and may have hints in either the loader environment or the
static environment.

There may be better ways to express the searchable environments and
describing their characteristics (immutable, already searched, etc.) but
this may be revisited after 12 branches.

Reported by: Dan Nelson <dnelson_1901@yahoo.com>
Triaged by: Dan Nelson <dnelson_1901@yahoo.com>
MFC after: 3 days

5 years agoFix LORs between vn_start_write() and vn_lock() in nfsrv_copymr().
Rick Macklem [Sat, 18 Aug 2018 19:14:06 +0000 (19:14 +0000)]
Fix LORs between vn_start_write() and vn_lock() in nfsrv_copymr().

When coding the pNFS server, I added vn_start_write() calls in nfsrv_copymr()
done while the vnodes were locked, not realizing I had introduced LORs and
possible deadlock when an exported file system on the MDS is suspended.
This patch fixes the LORs by moving the vn_start_write() calls up to before
where the vnodes are locked. For "tvp", the vn_start_write() probaby isn't
necessary, because NFS mounts can't be suspended. However, I think doing
so is harmless.
Thanks go to kib@ for letting me know that I had introduced these LORs.
This patch only affects the behaviour of the pNFS server when pnfsdscopymr(8)
is used to recover a mirrored DS.

5 years agoEliminate the arena parameter to kmem_malloc_domain(). It is redundant.
Alan Cox [Sat, 18 Aug 2018 18:33:50 +0000 (18:33 +0000)]
Eliminate the arena parameter to kmem_malloc_domain().  It is redundant.
The domain and flags parameters suffice.  In fact, the related functions
kmem_alloc_{attr,contig}_domain() don't have an arena parameter.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D16713

5 years agoPrint L1D FLUSH feature.
Konstantin Belousov [Sat, 18 Aug 2018 12:17:05 +0000 (12:17 +0000)]
Print L1D FLUSH feature.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agobsnmpd(8): fix and optimize interface description processing
Eugene Grosbein [Sat, 18 Aug 2018 10:58:44 +0000 (10:58 +0000)]
bsnmpd(8): fix and optimize interface description processing

* correctly prepare a buffer to obtain interface description from a kernel and
  truncate long description instead of dropping it altogether and
  spamming logs;
* skip calling strlen() for each description and each SNMP request
  for MIB-II/ifXTable's ifAlias.
* teach bsnmpd to allocate memory dynamically for interface descriptions
  to decrease memory usage for common case and not to break
  if long description occurs;

PR: 217763
Reviewed by: harti and others
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16459

5 years agoWorkaround ECAPMODE for kernels between revision [331280, 337999)
Xin LI [Sat, 18 Aug 2018 08:32:21 +0000 (08:32 +0000)]
Workaround ECAPMODE for kernels between revision [331280, 337999)
where getrandom(2) is not available in capability mode.

5 years agoRegen after r337998.
Xin LI [Sat, 18 Aug 2018 06:33:51 +0000 (06:33 +0000)]
Regen after r337998.

5 years agogetrandom(2) should not be restricted in capability mode.
Xin LI [Sat, 18 Aug 2018 06:31:49 +0000 (06:31 +0000)]
getrandom(2) should not be restricted in capability mode.

5 years agoSplit arc4random_uniform into it's own file and sync with OpenBSD.
Xin LI [Sat, 18 Aug 2018 06:20:45 +0000 (06:20 +0000)]
Split arc4random_uniform into it's own file and sync with OpenBSD.

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

5 years agocxgbe(4): Replace T4_PKT_TIMESTAMP with something slightly less hackish.
Navdeep Parhar [Sat, 18 Aug 2018 04:23:51 +0000 (04:23 +0000)]
cxgbe(4): Replace T4_PKT_TIMESTAMP with something slightly less hackish.

5 years agolibbe(3): Move build goop back out of cddl/
Kyle Evans [Sat, 18 Aug 2018 03:20:59 +0000 (03:20 +0000)]
libbe(3): Move build goop back out of cddl/

Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.

5 years agolibbe(3): Remove -v from LDFLAGS
Kyle Evans [Sat, 18 Aug 2018 03:08:54 +0000 (03:08 +0000)]
libbe(3): Remove -v from LDFLAGS

-v is clearly not needed for linking, and it adds extra verbose information
that is not necessary.

5 years agobectl(8): Allow running a custom command in the 'jail' subcommand
Kyle Evans [Sat, 18 Aug 2018 01:12:44 +0000 (01:12 +0000)]
bectl(8): Allow running a custom command in the 'jail' subcommand

Instead of always running /bin/sh, allow the user to specify the command
to run. The jail is not removed when the command finishes. Meaning,
`bectl unjail` will still need to be run.

For example:

```
bectl jail newBE pkg upgrade
bectl ujail newBE
```

Submitted by: Shawn Webb
Obtained from: HardenedBSD (8b451014ab)

5 years agoPOSIX compliance improvements in the pthread(3) functions.
Pedro F. Giffuni [Sat, 18 Aug 2018 01:05:38 +0000 (01:05 +0000)]
POSIX compliance improvements in the pthread(3) functions.

This basically adds makes use of the C99 restrict keyword, and also
adds some 'const's to four threading functions: pthread_mutexattr_gettype(),
pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and
pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018.

Hinted by: DragonFlyBSD

Relnotes: yes
MFC after: 1 month
Differential Revision: D16722

5 years agoMETALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG
Bjoern A. Zeeb [Fri, 17 Aug 2018 21:19:18 +0000 (21:19 +0000)]
METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG

In the create-world-packages target we manually piece this together (unless
it is undefined), without the DISTDIR.  Normally DISTDIR is empty (unset) and
no one notices.  Now DISTDIR is a well known long-standing PORTS environment
variable and if that is set in the local environment the path to METALOG
is wrong as it no longer is ${DESTDIR}/METALOG.

Long-term we should start to avoid "publicly well known" names for global
variables, for now just piece ${DISTDIR} in as well.  This allows
create-world-packages to continue if DISTDIR is set in the env.

5 years agoFix LORs between vn_start_write() and vn_lock() in the pNFS server.
Rick Macklem [Fri, 17 Aug 2018 21:12:16 +0000 (21:12 +0000)]
Fix LORs between vn_start_write() and vn_lock() in the pNFS server.

When coding the pNFS server, I added several vn_start_write() calls done
while the vnode was locked, not realizing I had introduced LORs and
possible deadlock when an exported file system on the MDS is suspended.
This patch fixes this by removing the added vn_start_write() calls and
modifying the code so that the extant vn_start_write() call before the
NFS RPC/operation is done when needed by the pNFS server.
Flags are changed so that LayoutCommit and LayoutReturn now get a
vn_start_write() done for them.
When the pNFS server is enabled, the code now also changes the flags for
Getattr, so that the vn_start_write() is done for Getattr, since it may
need to do a vn_set_extattr(). The nfs_writerpc flag array was made global
to the NFS server and renamed nfsrv_writerpc, which is consistent naming
for globals in the NFS server.
Thanks go to kib@ for reporting that doing vn_start_write() while the vnode is
locked results in a LOR.
This patch only affects the behaviour of the pNFS server.

5 years agoCopy the boot loader from the new location for the co-existing
Warner Losh [Fri, 17 Aug 2018 20:41:50 +0000 (20:41 +0000)]
Copy the boot loader from the new location for the co-existing
loaders.

Reviewed by: gjb@

5 years agocxgbe(4): Adjust ntids to account for nhptids in the TOE case too.
Navdeep Parhar [Fri, 17 Aug 2018 20:28:31 +0000 (20:28 +0000)]
cxgbe(4):  Adjust ntids to account for nhptids in the TOE case too.
This should have been part of r337538.

5 years agocxgbe/tom: Put the ifnet or VLAN's PCP value in the 802.1Q tag of frames
Navdeep Parhar [Fri, 17 Aug 2018 19:22:46 +0000 (19:22 +0000)]
cxgbe/tom: Put the ifnet or VLAN's PCP value in the 802.1Q tag of frames
generated by the TOE.  Works with vid 0 (no VLAN, just priority) too.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoFix sys/netipsec/tunnel tests after r337736
Alan Somers [Fri, 17 Aug 2018 18:37:22 +0000 (18:37 +0000)]
Fix sys/netipsec/tunnel tests after r337736

Originally, these tests accidentally used broadcast addresses when they
should've used unicast addresses.  That the tests passed prior to r337736
was accidental.

Submitted by: ae
Reviewed by: olivier
MFC after: 2 weeks

5 years agoAdd pthread_get_name_np(3).
Konstantin Belousov [Fri, 17 Aug 2018 18:34:07 +0000 (18:34 +0000)]
Add pthread_get_name_np(3).

The function retrieves the thread name previously set by
pthread_set_name_np(3). The name is cached in the process memory.

Requested by: Willem Jan Withagen <wjw@digiware.nl>
Man page update: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: ian (previous version)
Discussed with: arichardson, bjk (man page)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16702

5 years agoReorder alphabetically.
Konstantin Belousov [Fri, 17 Aug 2018 18:24:11 +0000 (18:24 +0000)]
Reorder alphabetically.

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

5 years agoAdd a man page for ratecheck(9) and ppsratecheck(9).
Dag-Erling Smørgrav [Fri, 17 Aug 2018 17:16:38 +0000 (17:16 +0000)]
Add a man page for ratecheck(9) and ppsratecheck(9).

5 years agoRework rtld's TLS Variant I implementation to match r326794
Brooks Davis [Fri, 17 Aug 2018 16:19:47 +0000 (16:19 +0000)]
Rework rtld's TLS Variant I implementation to match r326794

The above commit fixed handling overaligned TLS segments in libc's
TLS Variant I implementation, but rtld provides its own implementation
for dynamically-linked executables which lacks these fixes.  Thus,
port these changes to rtld.

Submitted by: James Clarke
Reviewed by: kbowling
Testing byL kbowling (powerpc64), br (riscv), kevans (armv7)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16510

5 years agoTypo.
Mark Johnston [Fri, 17 Aug 2018 16:07:06 +0000 (16:07 +0000)]
Typo.

X-MFC with: r337974

5 years agoAdd INVARIANTS-only fences around lockless vnode refcount updates.
Mark Johnston [Fri, 17 Aug 2018 15:41:01 +0000 (15:41 +0000)]
Add INVARIANTS-only fences around lockless vnode refcount updates.

Some internal KASSERTs access the v_iflag field without the vnode
interlock held after such a refcount update.  The fences are needed for
the assertions to be correct in the face of store reordering.

Reported and tested by: jhibbits
Reviewed by: kib, mjg
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16756

5 years agoAdd Modbus Application Protocol to /etc/services
Alan Somers [Fri, 17 Aug 2018 15:18:57 +0000 (15:18 +0000)]
Add Modbus Application Protocol to /etc/services

IANA reassigned ports 502 and 802 on 2014-06-10

PR: 213276
Submitted by: Mark.Martinec@ijs.si
MFC after: 2 weeks

5 years ago9751 Allocation throttling misplacing ditto blocks
Alexander Motin [Fri, 17 Aug 2018 15:17:09 +0000 (15:17 +0000)]
9751 Allocation throttling misplacing ditto blocks

Relax allocation throttling for ditto blocks.  Due to random imbalances
in allocation it tends to push block copies to one vdev, that looks
slightly better at the moment.  Slightly less strict policy allows both
improve data security and surprisingly write performance, since we don't
need to touch extra metaslabs on each vdev to respect the min distance.

Sponsored by: iXsystems, Inc.

5 years agopf tests: Verify that pf limits the number of fragments per packet
Kristof Provost [Fri, 17 Aug 2018 15:02:58 +0000 (15:02 +0000)]
pf tests: Verify that pf limits the number of fragments per packet

Test the limitation on number of frames per packet introduced in pf in r337969.

Sponsored by: Klara Systems

5 years ago9738 Fix third block copy allocations, broken at 9112.
Alexander Motin [Fri, 17 Aug 2018 15:00:41 +0000 (15:00 +0000)]
9738 Fix third block copy allocations, broken at 9112.

Use METASLAB_WEIGHT_CLAIM weight to allocate tertiary blocks.
Previous use of METASLAB_WEIGHT_SECONDARY for that caused errors
later on metaslab_activate_allocator() call, leading to massive
load of unneeded metaslabs and write freezes.

Reviewed by: Paul Dagnelie <pcd@delphix.com>

5 years agopf: Limit the maximum number of fragments per packet
Kristof Provost [Fri, 17 Aug 2018 15:00:10 +0000 (15:00 +0000)]
pf: Limit the maximum number of fragments per packet

Similar to the network stack issue fixed in r337782 pf did not limit the number
of fragments per packet, which could be exploited to generate high CPU loads
with a crafted series of packets.

Limit each packet to no more than 64 fragments. This should be sufficient on
typical networks to allow maximum-sized IP frames.

This addresses the issue for both IPv4 and IPv6.

MFC after: 3 days
Security: CVE-2018-5391
Sponsored by: Klara Systems

5 years agoConsistently use NULL to terminate the argv; no functional changes.
Edward Tomasz Napierala [Fri, 17 Aug 2018 14:57:13 +0000 (14:57 +0000)]
Consistently use NULL to terminate the argv; no functional changes.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoGPT is standard in x86 and arm64 land. Add it to DEFAULTS with the
Warner Losh [Fri, 17 Aug 2018 14:47:21 +0000 (14:47 +0000)]
GPT is standard in x86 and arm64 land. Add it to DEFAULTS with the
others.

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

5 years agoFix style nits.
Mariusz Zaborski [Fri, 17 Aug 2018 14:37:13 +0000 (14:37 +0000)]
Fix style nits.

5 years agocapsicum: allow the setproctitle(3) function in capability mode
Mariusz Zaborski [Fri, 17 Aug 2018 14:35:10 +0000 (14:35 +0000)]
capsicum: allow the setproctitle(3) function in capability mode

Capsicum in past allowed to change the process title.
This was broken with r335939.

PR: 230584
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
Reported by: ian@niw.com.au
MFC after: 1 week

5 years agodtc(1): Update to 97d2d5715eeb45108cc60367fdf6bd5b2046b050
Kyle Evans [Fri, 17 Aug 2018 13:24:48 +0000 (13:24 +0000)]
dtc(1): Update to 97d2d5715eeb45108cc60367fdf6bd5b2046b050

Notable fixes:
- Overlays may now be generated properly without -@
- /__local_fixups__ were not including unit address in their structure
- The error reporting a magic token was misleading, reporting
  "Bad magic token in header.  Got d00dfeed expected 0xd00dfeed"
  if the token was missing. This has been split out into a separate message.

MFC after: 1 week

5 years agoDon't set a file's size for the MDS file of a pNFS service.
Rick Macklem [Fri, 17 Aug 2018 12:32:38 +0000 (12:32 +0000)]
Don't set a file's size for the MDS file of a pNFS service.

When a pNFS service is running, the size of the files created on the MDS
are normally 0, since the data is written to the data files on the DS(s).
However, without this patch, if a Setattr with a non-zero size was done by
a client, the MDS file was set to that size.  This was thought to be benign,
but it turns out that files with a non-zero size plus extended attributes
can cause a "ffs_truncate3" panic in UFS. Although the exact cause of this
panic() has not been isolated, this patch avoids the panic() and leaves
the MDS files in a consistent state of always having a size == 0.
Note that these MDS files never store data. The patch also includes an
unnecessary initialization of savsize in case some compiler or static
analyser complains it might not be initialized.
This patch only affects the NFS server when pNFS is enabled via the "-p"
command line option on nfsd.

5 years agoAdd the possibility to mark packets urgent based on their length.
Nick Hibma [Fri, 17 Aug 2018 10:18:45 +0000 (10:18 +0000)]
Add the possibility to mark packets urgent based on their length.

This allows preferring small (e.g. ACK) packets, in upload heavy
environments.

It was already possible to mark packets urgent based on destination
port. This option piggy backs on that feature.

5 years agobuild: skip the database check when generating install media
Roger Pau Monné [Fri, 17 Aug 2018 07:27:15 +0000 (07:27 +0000)]
build: skip the database check when generating install media

There are several scripts and targets solely used to generate install
media, make sure DB_FROM_SRC is used in that case in order to prevent
checking the host database, which is irrelevant when generating
install binaries.

Sponsored by: Citrix Systems R&D
PR: 230459
Reviewed by: gjb
Differential revision: https://reviews.freebsd.org/D16638

5 years agocryptosoft: Reduce generality of supported algorithm composition
Conrad Meyer [Fri, 17 Aug 2018 04:40:01 +0000 (04:40 +0000)]
cryptosoft: Reduce generality of supported algorithm composition

Fix a regression introduced in r336439.

Rather than allowing any linked list of algorithms, allow at most two
(typically, some combination of encrypt and/or MAC).  Removes a WAITOK
malloc in an unsleepable context (classic LOR) by placing both software
algorithm contexts within the OCF-managed session object.

Tested with 'cryptocheck -a all -d cryptosoft0', which includes some
encrypt-and-MAC modes.

PR: 230304
Reported by: sef@

5 years agoAdd efidev(4)/efirt(9)
Kyle Evans [Fri, 17 Aug 2018 04:17:51 +0000 (04:17 +0000)]
Add efidev(4)/efirt(9)

Document efidev(4), provider of userland access to EFI Runtime Services. A link is created to efirtc(4), which handles the time-of-day clock side.

efirt(9) is the kernel side of this.

Reviewed by: imp, kib (earlier version)
Differential Revision: https://reviews.freebsd.org/D16696

5 years agols(1): Add --color=when
Kyle Evans [Fri, 17 Aug 2018 04:15:51 +0000 (04:15 +0000)]
ls(1): Add --color=when

--color may be set to one of: 'auto', 'always', and 'never'.

'auto' is the default behavior- output colors only if -G or COLORTERM are
set, and only if stdout is a tty.

'always' is a new behavior- output colors always. termcap(5) will be
consulted unless TERM is unset or not a recognized terminal, in which case
ls(1) will fall back to explicitly outputting ANSI escape sequences.

'never' to turn off any environment variable and -G usage.

Reviewed by: cem, 0mp (both modulo last-minute manpage changes
Differential Revision: https://reviews.freebsd.org/D16741

5 years agorandom: Add PowerPC 'darn' instruction entropy source
Justin Hibbits [Fri, 17 Aug 2018 03:49:07 +0000 (03:49 +0000)]
random: Add PowerPC 'darn' instruction entropy source

Summary:
PowerISA 3.0 adds a 'darn' instruction to "deliver a random number".  This
driver was modeled after (rather, copied and gutted of) the Ivy Bridge
rdrand driver.

This uses the "Conditional Random Number" behavior to remove input bias.

From the ISA reference the 'darn' instruction, and the random number
generator backing it, conforms to the NIST SP800-90B and SP800-90C
standards, compliant to the extent possible at the time the hardware was
designed, and guarantees a minimum 0.5 bits of entropy per bit returned.

Reviewed By: markm, secteam (delphij)
Approved by: secteam (delphij)
Differential Revision: https://reviews.freebsd.org/D16552

5 years agosubr_prf: Don't write kern.boot_tag if it's empty
Kyle Evans [Fri, 17 Aug 2018 03:42:57 +0000 (03:42 +0000)]
subr_prf: Don't write kern.boot_tag if it's empty

This change allows one to set kern.boot_tag="" and not get a blank line
preceding other boot messages. While this isn't super critical- blank lines
are easy to filter out both mentally and in processing dmesg later- it
allows for a mode of operation that matches previous behavior.

I intend to MFC this whole series to stable/11 by the end of the month with
boot_tag empty by default to make this effectively a nop in the stable
branch.

5 years agobectl(8): Add batch mode to jail subcommand
Kyle Evans [Fri, 17 Aug 2018 01:59:19 +0000 (01:59 +0000)]
bectl(8): Add batch mode to jail subcommand

Adding batch mode to the jail `bectl(8)` subcommand enables jailing of
ZFS Boot Environments in a scriptable fashion.

Submitted by: Shawn Webb
Obtained from: HardenedBSD (9e72d1c59a and ef7b6d9e1c with minor edit)

5 years agoRiscv: Include crypto for IPSec
Conrad Meyer [Fri, 17 Aug 2018 01:08:22 +0000 (01:08 +0000)]
Riscv: Include crypto for IPSec

Similar to r337944.  I think this is the last configuration that includes IPsec
but not crypto.

5 years agoarm: Define crypto option on platforms that include IPsec
Conrad Meyer [Fri, 17 Aug 2018 01:04:02 +0000 (01:04 +0000)]
arm: Define crypto option on platforms that include IPsec

Missed in r337940.

(It's not like there are any crypto files IPsec doesn't pull in, so it is
unclear what not defining the crypto option was supposed to achieve.)

Reported by: np@

5 years agoif_vlan(4): A VLAN always has a PCP and its ifnet's if_pcp should be set
Navdeep Parhar [Fri, 17 Aug 2018 01:03:23 +0000 (01:03 +0000)]
if_vlan(4): A VLAN always has a PCP and its ifnet's if_pcp should be set
to the PCP value in use instead of IFNET_PCP_NONE.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoAdd test cases for Poly1305 from RFC 7539
Conrad Meyer [Fri, 17 Aug 2018 00:32:00 +0000 (00:32 +0000)]
Add test cases for Poly1305 from RFC 7539

5 years agocrypto(4): Add cryptosoft, cryptodev support for Poly-1305
Conrad Meyer [Fri, 17 Aug 2018 00:31:06 +0000 (00:31 +0000)]
crypto(4): Add cryptosoft, cryptodev support for Poly-1305

5 years agoAdd xform-conforming auth_hash wrapper for Poly-1305
Conrad Meyer [Fri, 17 Aug 2018 00:30:04 +0000 (00:30 +0000)]
Add xform-conforming auth_hash wrapper for Poly-1305

The wrapper is a thin shim around libsodium's Poly-1305 implementation.  For
now, we just use the C algorithm and do not attempt to build the
SSE-optimized variant for x86 processors.

The algorithm support has not yet been plumbed through cryptodev, or added
to cryptosoft.

5 years agoBring in compatibility glue for libsodium
Conrad Meyer [Fri, 17 Aug 2018 00:27:56 +0000 (00:27 +0000)]
Bring in compatibility glue for libsodium

The idea is untouched upstream sources live in sys/contrib/libsodium.

sys/crypto/libsodium are support routines or compatibility headers to allow
building unmodified upstream code.

This is not yet integrated into the build system, so no functional change.

5 years agoBring in libsodium to sys/contrib
Conrad Meyer [Fri, 17 Aug 2018 00:23:50 +0000 (00:23 +0000)]
Bring in libsodium to sys/contrib

Bring in https://github.com/jedisct1/libsodium at
461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified.

libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl
("Networking and Cryptography Library," pronounced "salt") software library.
At the risk of oversimplifying, libsodium primarily exists to make it easier
to use NaCl.  NaCl and libsodium provide high quality implementations of a
number of useful cryptographic concepts (as well as the underlying
primitics) seeing some adoption in newer network protocols.

I considered but dismissed cleaning up the directory hierarchy and
discarding artifacts of other build systems in favor of remaining close to
upstream (and easing future updates).

Nothing is integrated into the build system yet, so in that sense, no
functional change.

5 years agoRename head from ALPHA1 to ALPHA2 in preparation for the next set
Glen Barber [Thu, 16 Aug 2018 23:58:22 +0000 (23:58 +0000)]
Rename head from ALPHA1 to ALPHA2 in preparation for the next set
of snapshot builds.

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

5 years agoFix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0
Alan Somers [Thu, 16 Aug 2018 23:49:56 +0000 (23:49 +0000)]
Fix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0

Two of these testcases require software crypto to be enabled. Curiously, it
isn't by default.

PR: 230671
Reported by: Jenkins
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16755

5 years agoAdd the ability to look up the 3b PCP of a VLAN interface. Use it in
Navdeep Parhar [Thu, 16 Aug 2018 23:46:38 +0000 (23:46 +0000)]
Add the ability to look up the 3b PCP of a VLAN interface.  Use it in
toe_l2_resolve to fill up the complete vtag and not just the vid.

Reviewed by: kib@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D16752

5 years agoSpecify DB_FROM_SRC=yes when doing any installation target.
Warner Losh [Thu, 16 Aug 2018 22:13:43 +0000 (22:13 +0000)]
Specify DB_FROM_SRC=yes when doing any installation target.

We want to use the UIDs from the installed system, not the host
system, when installing things.

Sponsored by: Netflix

5 years agoRevert r337929
Alan Somers [Thu, 16 Aug 2018 22:04:00 +0000 (22:04 +0000)]
Revert r337929

FreeBSD's mkstemp sets the temporary file's permissions to 600, and has ever
since mkstemp was added in 1987.  Coverity's warning is still relevant for
portable programs since OpenGroup does not require that behavior, and POSIX
didn't until 2008.  But none of these programs are portable.

5 years agoFix Coverity warnings about mkstemp in tests
Alan Somers [Thu, 16 Aug 2018 21:36:19 +0000 (21:36 +0000)]
Fix Coverity warnings about mkstemp in tests

umask(2) should always be used prior to mkstemp(3) so the temporary file
won't be created with insecure permissions.

Reported by: Coverity
CID: 1331605 1347173 1375366 1339800 1331604 1296056 1296060
CID: 1296057 1296062
MFC after: 2 weeks

5 years agoFix build after r337852: Don't rebuild moduli based on unrelated moduli.c
Bryan Drewery [Thu, 16 Aug 2018 19:48:07 +0000 (19:48 +0000)]
Fix build after r337852: Don't rebuild moduli based on unrelated moduli.c

Reported by: many, delphij (moduli.c issue)