Commit Graph

235748 Commits

Author SHA1 Message Date
Kyle Evans
e10ba80063 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
2018-08-17 04:15:51 +00:00
Justin Hibbits
b14959dacc 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
2018-08-17 03:49:07 +00:00
Kyle Evans
45625675e7 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.
2018-08-17 03:42:57 +00:00
Kyle Evans
b509cad4fe 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)
2018-08-17 01:59:19 +00:00
Conrad Meyer
08d77c0178 Riscv: Include crypto for IPSec
Similar to r337944.  I think this is the last configuration that includes IPsec
but not crypto.
2018-08-17 01:08:22 +00:00
Conrad Meyer
923d206149 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@
2018-08-17 01:04:02 +00:00
Navdeep Parhar
32a52e9e39 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
2018-08-17 01:03:23 +00:00
Conrad Meyer
1e7bbbc54c Add test cases for Poly1305 from RFC 7539 2018-08-17 00:32:00 +00:00
Conrad Meyer
25b7033b73 crypto(4): Add cryptosoft, cryptodev support for Poly-1305 2018-08-17 00:31:06 +00:00
Conrad Meyer
01d5de8fca 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.
2018-08-17 00:30:04 +00:00
Conrad Meyer
f36e41e20b 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.
2018-08-17 00:27:56 +00:00
Conrad Meyer
0ac341f145 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.
2018-08-17 00:23:50 +00:00
Glen Barber
9dae4c97a0 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
2018-08-16 23:58:22 +00:00
Alan Somers
3c5ba95ad1 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
2018-08-16 23:49:56 +00:00
Navdeep Parhar
32d2623ae2 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
2018-08-16 23:46:38 +00:00
Warner Losh
6ba33ab591 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
2018-08-16 22:13:43 +00:00
Alan Somers
88fa3a7649 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.
2018-08-16 22:04:00 +00:00
Alan Somers
76f2606181 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
2018-08-16 21:36:19 +00:00
Bryan Drewery
b749a1b999 Fix build after r337852: Don't rebuild moduli based on unrelated moduli.c
Reported by:	many, delphij (moduli.c issue)
2018-08-16 19:48:07 +00:00
Warner Losh
bd7c104abf Add ashldi3 and ashrdi3 to mips.
Now that we're using -Os, mips needs these routines.
2018-08-16 19:39:02 +00:00
Mark Johnston
f0af0b312f Add partial documentation for dtrace(1)'s -x configuration options.
Some options are still missing descriptions, but they can be filled in
over time.

Submitted by:	raichoo <raichoo@googlemail.com>
Reviewed by:	0mp (previous version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16671
2018-08-16 19:28:44 +00:00
Jamie Gritton
c542c43ef1 Revert r337922, except for some documention-only bits. This needs to wait
until user is changed to stop using jail(2).

Differential Revision:	D14791
2018-08-16 19:09:43 +00:00
Kyle Evans
5b7803a993 libbe(3): Impose dataset length restrictions on boot env name validation
Previously, we only validated names for character restrictions. This is
helpful, but we should've also checked length restrictions- dataset names
must be restricted to MAXNAMELEN.

While here, move validation before doing a bunch of concatenations and fix
error handling in be_rename. It was previously setting the error state based
on return value from a libzfs function, which is wrong: libzfs errors don't
necessarily match cleanly to libbe errors. This would cause the assertion in
be_error to hit when the error was printed.
2018-08-16 18:58:34 +00:00
Alexander Motin
6d14f2c48f Make vfs.zfs.zio.dva_throttle_enabled sysctl writable.
Not sure what I thought originally, but as I see now runtime changes are
working fine, and the code seems like even designed for this.
2018-08-16 18:44:50 +00:00
Jamie Gritton
284001a222 Put jail(2) under COMPAT_FREEBSD11. It has been the "old" way of creating
jails since FreeBSD 7.

Along with the system call, put the various security.jail.allow_foo and
security.jail.foo_allowed sysctls partly under COMPAT_FREEBSD11 (or
BURN_BRIDGES).  These sysctls had two disparate uses: on the system side,
they were global permissions for jails created via jail(2) which lacked
fine-grained permission controls; inside a jail, they're read-only
descriptions of what the current jail is allowed to do.  The first use
is obsolete along with jail(2), but keep them for the second-read-only use.

Differential Revision:	D14791
2018-08-16 18:40:16 +00:00
Kyle Evans
a8e44f4da0 libbe(3): Prefer safer versions of strcat/strcpy
Or, in the activate case, just use snprintf since that's effectively what
we're doing anyways.
2018-08-16 18:37:47 +00:00
Pedro F. Giffuni
43daed4774 Revert r337419.
The fix is only partial and causes an asymmetry which breaks a test in
multi_test.sh.

We should consider both parts of the issue found in OpenBSD[1], but for now
just revert the change.

[1] http://undeadly.org/cgi?action=article;sid=20180728110010

Reported by: asomers
2018-08-16 18:35:39 +00:00
Jamie Gritton
07ebf3dd69 security.jail.enforce_statfs is handled by jail_set(2), so handling it in
userspace jail(8) is redundant.

Differential Revision:	D14791
2018-08-16 18:30:49 +00:00
Kyle Evans
25eeb3ea95 bectl(8): Kit-kat bar 2018-08-16 18:27:43 +00:00
Kyle Evans
a9c660b0d5 bectl(8): Implement the 'create a snapshot' variant of create 2018-08-16 18:26:43 +00:00
Kyle Evans
9491dcf564 bectl(8): Appease clang-scan
Use strlcpy instead of a plain strcpy
2018-08-16 17:59:49 +00:00
Kyle Evans
55b0e92b89 libbe(3)/bectl(8): Hit rewind on a bunch of off-by-ones
While here, use sizeof() in some places that it makes sense to reduce room
for error and prefer strlcpy to strncpy
2018-08-16 17:56:03 +00:00
Warner Losh
4ad3fab635 Install links for loader.efi.
Submitted by: ben wilber
2018-08-16 16:30:23 +00:00
Doug Ambrisko
3991dbf3fa Fix a module Makefile error on amd64 so the IPMI HW interfaces are built.
When the module is being unloaded and no HW interfaces were created don't
clean up.  This was exposed by the amd64 module build issue.
2018-08-16 15:59:02 +00:00
Alan Somers
670e1da043 Fix the sys/opencrypto/runtests test when aesni(4) is already loaded
Apparently kldstat requires the full module name, including busname

Reported by:	Jenkins
MFC after:	2 weeks
2018-08-16 15:44:48 +00:00
Edward Tomasz Napierala
78b9f0095b Fix typo.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-08-16 14:46:49 +00:00
Kyle Evans
4b2cc4d121 build(7): Document KERNCONFDIR - directory in which KERNCONF resides
MFC after:	1 week
2018-08-16 13:42:08 +00:00
Mateusz Piotrowski
3d04377b2f Tidy up the ports.7 manual page.
- Use "Dq Li" for inline commands as we do in other manuals.
  - Pet "igor" and "mandoc -Tlint".
  - Reword some parts for clarity.
  - Add missing Xr macros.
  - Reformat SEE ALSO to make the section more readable.

Reviewed by:	eadler, krion, mat
Approved by:	krion (mentor), mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D15350
2018-08-16 13:29:23 +00:00
Bjoern A. Zeeb
8489ecae84 Allow the use of TCP instead of UDP for queries by setting options usevc
in resolv.conf which sets RES_USEVC.

Reviewed by:	ume
MFC after:	17 days
Differential Revision:	https://reviews.freebsd.org/D16607
2018-08-16 13:18:40 +00:00
Andrew Turner
a24d3c094e Remove the L1 and L2 xscale page defines and rename the generic macros to
the common name. While here move the macros to check these into pmap-v4.c
as they're only used there.

Sponsored by:	DARPA, AFRL
2018-08-16 10:00:51 +00:00
Ed Maste
663664046e src.conf.5: regen after r337899 WITH_LLD_IS_LD on armv7 2018-08-16 09:36:59 +00:00
Andrey V. Elsukov
8065bd0bca Properly initialize IP version in IPv6 header. This was missed in r334673.
Reported by:	Lars Schotte <lars at gustik dot eu>
2018-08-16 09:19:06 +00:00
Ed Maste
113025767e Enable LLD_IS_LD by default on armv7
lld should now be a usable linker for armv7, and is already used as the
bootstrap linker (for linking the kernel and userland).  Also enable as
the system linker now (/usr/bin/ld) for further testing and evaluation.
(This change will be reverted in case of unexpected fallout.)

Approved by:	manu
Sponsored by:	The FreeBSD Foundation
2018-08-16 09:11:34 +00:00
Eitan Adler
ea8946ebdc [pci_vendors] Update pci_vendors to 2018.08.12 2018-08-16 07:34:10 +00:00
Toomas Soome
e7da951ee5 libi386: bd_io_workaround() is to be called for reads only
bd_io() can perform either reads or writes, we only need bd_io_workaround()
for reads.
2018-08-16 07:13:36 +00:00
Toomas Soome
8000f383bb libi386: small style updates in biosdisk
Use break instead of return in for loop, as done earlier. Insert and remove
some blank lines. No functional changes intended.
2018-08-16 06:50:53 +00:00
Marcelo Araujo
ec89307fb1 Fix a resource leak when using strdup(3) and also fix few style(9).
Reported by:	Coverity
CID:		1394929
MFC after:	1 week
Sponsored by:	iXsystems Inc.
2018-08-16 06:38:01 +00:00
Marcelo Araujo
3955e1c03a Remove duplicated code.
Reported by:	Coverity
CID:		1394893
MFC after:	1 week
Sponsored by:	iXsystems Inc.
2018-08-16 06:35:44 +00:00
Marcelo Araujo
9e59a2e8ce Add a comment explaining how the PSN works and why there is no need for
a null terminator. Also mark CID 1394825 as intentional.

Reported by:	Coverity
CID:		1394825
MFC after:	1 week
Sponsored by:	iXsystems Inc.
2018-08-16 06:31:54 +00:00
Marcelo Araujo
e30993c2a6 Increase the mask from 15 to 255 or otherwise NVME_FEAT_SOFTWARE_PROGRESS
will never be reached.

Discussed with:	Leon Dang and Darius Mihai <dariusmihaim@gmail.com>
MFC after:	1 week.
Sponsored by:	iXsystems Inc.
2018-08-16 06:20:25 +00:00