Commit Graph

1081 Commits

Author SHA1 Message Date
Mark Johnston
2188152717 security.7: Minor fixes for ASLR sysctl descriptions
Reviewed by:	debdrup, danfe, emaste
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33908
2022-01-17 16:12:43 -05:00
Mark Johnston
1811c1e957 exec: Reimplement stack address randomization
The approach taken by the stack gap implementation was to insert a
random gap between the top of the fixed stack mapping and the true top
of the main process stack.  This approach was chosen so as to avoid
randomizing the previously fixed address of certain process metadata
stored at the top of the stack, but had some shortcomings.  In
particular, mlockall(2) calls would wire the gap, bloating the process'
memory usage, and RLIMIT_STACK included the size of the gap so small
(< several MB) limits could not be used.

There is little value in storing each process' ps_strings at a fixed
location, as only very old programs hard-code this address; consumers
were converted decades ago to use a sysctl-based interface for this
purpose.  Thus, this change re-implements stack address randomization by
simply breaking the convention of storing ps_strings at a fixed
location, and randomizing the location of the entire stack mapping.
This implementation is simpler and avoids the problems mentioned above,
while being unlikely to break compatibility anywhere the default ASLR
settings are used.

The kern.elfN.aslr.stack_gap sysctl is renamed to kern.elfN.aslr.stack,
and is re-enabled by default.

PR:		260303
Reviewed by:	kib
Discussed with:	emaste, mw
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33704
2022-01-17 16:12:36 -05:00
John Baldwin
8f35841f1f crypto: Add support for the XChaCha20-Poly1305 AEAD cipher.
This cipher is a wrapper around the ChaCha20-Poly1305 AEAD cipher
which accepts a larger nonce.  Part of the nonce is used along with
the key as an input to HChaCha20 to generate a derived key used for
ChaCha20-Poly1305.

This cipher is used by WireGuard.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33523
2022-01-11 14:16:41 -08:00
Warner Losh
ca1e55df24 hier: Remove mips and sparc64
These have been removed from the kernel, so should be removed here.

Sponsored by:		Netflix
2022-01-05 14:38:05 -07:00
Edward Tomasz Napierala
57976b7af3 hier(7): add some new Xrs, remove some unrelated ones
Reviewed By:	debdrup, imp, 0mp
Differential Revision:	https://reviews.freebsd.org/D33386
2021-12-18 11:50:34 +00:00
Ed Maste
9c983ad791 arch.7: update applicable FreeBSD versions to 12.0 and later
Information in this document is unchanged between 11.x and 12.x, but
this is intended to be a quick reference for supported architectures.
Also bump .Dd to cover recent changes including MIPS deprecation.

Sponsored by:	The FreeBSD Foundation
2021-11-25 20:08:21 -05:00
Ed Maste
9c943f7a03 arch.7: move discontinued CPU archs to own table
With MIPS' retirement we now have more discontinued architectures than
supported ones, making the table somewhat unclear.  Split the table in
two.

Reviewed by:	allanjude
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33110
2021-11-25 12:54:06 -05:00
Warner Losh
a721ac948e Document that 13.x is the end of the line for FreeBSD/mips
MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:	brooks, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D32852
2021-11-18 21:22:55 -07:00
Edward Tomasz Napierala
e03813c3e1 development(7): Use a more common architecture for examples 2021-11-03 08:59:26 +00:00
John Baldwin
42dcd39528 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.
This is useful for WireGuard which uses a nonce of 8 bytes rather
than the 12 bytes used for IPsec and TLS.

Note that this also fixes a (should be) harmless bug in ossl(4) where
the counter was incorrectly treated as a 64-bit counter instead of a
32-bit counter in terms of wrapping when using a 12 byte nonce.
However, this required a single message (TLS record) longer than 64 *
(2^32 - 1) bytes (about 256 GB) to trigger.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32122
2021-10-06 14:08:49 -07:00
John Baldwin
ae18720d27 crypto: Support multiple nonce lengths for AES-CCM.
Permit nonces of lengths 7 through 13 in the OCF framework and the
cryptosoft driver.  A helper function (ccm_max_payload_length) can be
used in OCF drivers to reject CCM requests which are too large for the
specified nonce length.

Reviewed by:	sef
Sponsored by:	Chelsio Communications, The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32111
2021-10-06 14:08:47 -07:00
Mark Johnston
805c3af898 build.7: Describe the default value for LOCAL_MODULES
Suggested by:	jhb
MFC after:	1 week
2021-08-10 21:18:34 -04:00
Mark Johnston
e7a13643b1 build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR
Reviewed by:	0mp, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31461
2021-08-10 11:43:02 -04:00
Piotr Kubaj
8f642f797a share/man/man7/arch.7: bump date 2021-08-10 17:04:51 +02:00
Piotr Kubaj
ecb3f90dd1 share/man/man7/arch.7: powerpc64 support appeared in 9.0-RELEASE
Differential revision:	https://reviews.freebsd.org/D31013
Approved by:	eadler, 0mp
2021-08-10 16:33:29 +02:00
Ceri Davies
b578d2a77e man/man7/development.7: correct typo in manpage. 2021-07-22 16:43:46 +01:00
Baptiste Daroussin
d6ed0d3d31 ports.7: catchup with the package extension name since pkg 1.17
MFC After:	3 days
2021-07-22 10:50:19 +02:00
Li-Wen Hsu
8dfb002457
man7: Update FreeBSD.org URLs
MFC after:	3 days
2021-07-04 22:07:23 +08:00
Ceri Davies
1f7d11e636 build.7: remove documentation of "make update"
update target was removed in e290182bcf
2021-07-01 16:52:32 +01:00
Fernando Apesteguía
49ddfdec19 ports(7): Add install-missing-packages to target list
It is already used in the EXAMPLES section.

Approved by:	bcr@ (manpages)
Differential Revision: https://reviews.freebsd.org/D30044
2021-06-10 14:58:24 +02:00
Ceri Davies
c1a148873d sys/*/conf/*, docs: fix links to handbook
While here, fix all links to older en_US.ISO8859-1 documentation
in the src/ tree.

PR:             255026
Reported by:    Michael Büker <freebsd@michael-bueker.de>
Reviewed by:    dbaio
Approved by:    blackend (mentor), re (gjb)
MFC after:      10 days
Differential Revision: https://reviews.freebsd.org/D30265
2021-05-20 09:27:10 +01:00
Mitchell Horne
7fbc0c98a8 build(7): use a more relevant example for PORTS_MODULES
emulators/kqemu-kmod no longer exists in the ports tree.

Reviewed by:	imp, bcr
Differential Revision:	https://reviews.freebsd.org/D30261
2021-05-15 11:15:25 -03:00
Li-Wen Hsu
164d49a584
Correct the link of external mirrors
Reported by:	0mp
Fixes:		8ef03ce6db
MFC after:	1 day
2021-04-29 03:39:18 +08:00
Fernando Apesteguía
e444a4c677 build(7): fix references to svn(1) and svnlite(1)
Replace them with references to Git.

PR:	254937
Reported by:	m.bueker@berlin.de
Approved by:	0mp (mentor)
Differential Revision:	https://reviews.freebsd.org/D29949
2021-04-28 16:38:27 +02:00
Fernando Apesteguía
2e5929a756 stats.7: Add dwatch(1) to the list
PR:	255303
Approved by: 0mp (mentor)
Differential Revision: https://reviews.freebsd.org/D29924
2021-04-22 19:33:12 +02:00
Mateusz Piotrowski
ef0ba6bcce c.7: Fix some typos
Those misspellings were not picked up by igor because they are not
present in its list of common spelling errors.

Reported by:	rpokala
2021-04-20 10:33:34 +02:00
Faraz Vahedi
136f6b6c0c c.7: Describe more recent C standards
Also, add some MLINKS and fix some typos.

Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D28441
2021-04-18 16:36:13 +02:00
Mateusz Piotrowski
d25f7d324a ports.7: Document DEBUG_FLAGS and the process of debugging ports
Loosely based on https://wiki.freebsd.org/BenWoods/DebuggingPorts.

Reviewed by:	crees
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27296
2021-04-17 22:53:39 +02:00
Mateusz Piotrowski
c0e41dff70 ports.7: Add an example of setting variables for selected ports
Reviewed by:	crees
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28202
2021-04-17 22:17:38 +02:00
Rene Ladan
11f47f17e1 ports(7): update instructions for git
Reviewed by:	gjb, imp, lwhsu, mat
Differential Revision:	https://reviews.freebsd.org/D29502
2021-04-06 22:26:03 +02:00
Konstantin Belousov
2d223ccdae Remove kgmon(8)
Follow-up to the removal of the mcov from kernel.

Noted by:	mckusick
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D29563
2021-04-04 00:50:28 +03:00
Piotr Pawel Stefaniak
4233882f4e security.7: fix typo in sysctl name
It is machdep.syscall_ret_flush_l1d.
2021-03-26 22:24:31 +01:00
Warner Losh
29dd5e7a87 build.7: Use proper .Dd date from this year 2021-03-25 01:48:12 -06:00
Warner Losh
def657b825 build.7: Document SYSDIR variable
Add a description of the SYSDIR variable.
2021-03-25 01:45:21 -06:00
Evgeniy Khramtsov
8ef03ce6db
development(7): mention the Git mirror list in the manual page
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29234
2021-03-19 20:52:21 +08:00
Li-Wen Hsu
53844d3ea4
Clarify that the new STABLE branch is branched off CURRENT, not renamed
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D29317
2021-03-18 17:16:16 +08:00
Edward Tomasz Napierala
d28cbb7944 development(7): update to reflect Git transition
Reviewed By:	debdrup, imp (earlier version)
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D28939
2021-03-11 20:07:53 +00:00
Glen Barber
fa04db4762 release: fix VMSIZE following 1ca8842f3a
truncate(1) is not case-sensitive with regard to setting the size
of a file.  makefs(8), however, does not honor upper-case values.
Update release-specific files and the release(7) manual page to
reflect this.

MFC with:	1ca8842f3a
Submitted by:	ehem_freebsd_m5p.com (original)
Differential Review:	https://reviews.freebsd.org/D28979
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-03-04 08:43:02 -05:00
John Baldwin
a899ce4ba4 The ChaCha20 counter is little endian, not big endian.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28755
2021-03-03 15:20:57 -08:00
Alan Somers
de415e663c release.7: describe the NOGIT option
It was added in 91ce469984 (svn r365638)

MFC after:	7 days
Sponsored by:	Axcient
Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D29027
2021-03-02 19:39:57 -07:00
Evgeniy Khramtsov
907023b454 security(7): mention new W^X sysctls in the manual page
Reviewed by:	emaste, gbe
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28986
2021-03-02 19:52:22 +01:00
Daniel Ebdrup Jensen
ef1a1fc7e8 release(7) Fix mistake noted in review
I missed this when doing the final pass.

Fixes: f695e960 release(7): Remove stray references to DOC* variables
2021-02-23 19:11:54 +01:00
Daniel Ebdrup Jensen
f695e96067 release(7): Remove stray references to DOC* variables
We now live in the world of git, and release(7) should reflect that.

As of the commit referenced below, release images also no longer
include (stale) documentation, as the documentation has moved to
AsciiDoctor. This means that a few environment variables no longer
make sense, so remove them from their sections and mention them in
the compatibility section instead.

While here, also pet mandoc.

PR: 253615
MFC after: 3 days
MFC with: f61e92ca5a release: permanently remove the 'reldoc'
target and associates

Reviewed by:	gjb, lwhsu, yuripv
Differential Revision:	https://reviews.freebsd.org/D28881
2021-02-23 19:06:36 +01:00
Robert Wing
5ce2d4a1c2 bhyve/snapshot: drop mkdir when creating the unix domain socket
Add /var/run/bhyve/ to BSD.var.dist so we don't have to call mkdir when
creating the unix domain socket for a given bhyve vm.

The path to the unix domain socket for a bhyve vm will now be
/var/run/bhyve/vmname instead of /var/run/bhyve/checkpoint/vmname

Move BHYVE_RUN_DIR from snapshot.c to snapshot.h so it can be shared
to bhyvectl(8).

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28783
2021-02-22 11:31:07 -09:00
Daniel Ebdrup Jensen
248a47a4c2 ports(7): Update instructions for package target
Packages default to ending up in a different location compared to the
documentation, so catch up to the implementation by referring to the
location where packages can usually be found if no environment variables
have been set.

While here, also update the mention of the file extension to match the
txz format that packages use.

PR:		253179, 224370
Reported by:	rwatson, jeromer at fastmail dotnet
2021-02-19 13:42:16 +01:00
John Baldwin
fc8fc743d8 Add an OCF algorithm for ChaCha20-Poly1305 AEAD.
Note that this algorithm implements the mode defined in RFC 8439.

Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27836
2021-02-18 09:26:00 -08:00
Ed Maste
4f9548640d arch.7: update 11.x to 11.4 as the last FreeBSD 11 release
armeb and pc98 were both discontinued after FreeBSD 11.  FreeBSD 11.4
is now known to be the final 11.x release, so update to the specific
version.
2021-01-28 15:03:25 -05:00
John Baldwin
4a6cd37b75 Restructure the crypto(7) manpage and add authentication algorithms.
Add separate sections for authentication algorithms, block ciphers,
stream ciphers, and AEAD algorithms.  Describe properties commmon to
algorithms in each section to avoid duplication.

Use flat tables to list algorithm properties rather than nested
tables.

List implemented authentication algorithms.

Reviewed by:	gbe (manpages)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27833
2021-01-20 16:40:03 -08:00
Marius Strobl
f83a5c2382 hier.7/wlan.4: remove reference to wi(4)
The latter has been removed in a21def4d56.
2021-01-16 23:53:12 +01:00
Warner Losh
936440560b sysctl: implement debug.kdb.panic_str
This is just like debug.kdb.panic, except the string that's passed in
is reported in the panic message. This allows people with automated
systems to collect kernel panics over a large fleet of machines to
flag panics better. Strings like "Warner look at this hang" or "see
JIRA ABC-1234 for details" allow these automated systems to route the
forced panic to the appropriate engineers like you can with other
types of panics. Other users are likely possible.

Relnotes: Yes
Sponsored by: Netflix
Reviewed by: allanjude (earlier version)
Suggestions from review folded in by: 0mp, emaste, lwhsu
Differential Revision: https://reviews.freebsd.org/D28041
2021-01-08 14:30:28 -07:00
Alex Richardson
7fa2f2a62f Rename NO_WERROR -> MK_WERROR=no
As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D27601
2021-01-07 09:31:03 +00:00
Yuri Pankov
c5426ce3a6 security(7): fix copy/paste error and correct aslr oids
Submitted by:	Mina Galić <me_igalic.co>
Differential Revision:	https://reviews.freebsd.org/D27408
2020-11-29 16:29:40 +00:00
Edward Tomasz Napierala
cacb6b26c2 Assorted tweaks to hier(7): punctuation, some .Xr's, clarify wording.
Reviewed by:	0mp, bcr, imp
MFC after:	2 weeks
Sponsored by:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D27248
2020-11-23 14:26:59 +00:00
Bryan Drewery
80cedb809f Add lists for customizing legacy and bootstrap-tools.
Reviewed by:	arichardson
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D27200
2020-11-20 20:11:59 +00:00
Daniel Ebdrup Jensen
c78a221821 intro.7: Add missing manual page
Section 7 of the manual pages contain lots of very useful information, but
finding the pages is not always obvious - to assist people in finding the
information, add missing cross-references.

Reviewed by:	0mp (mentor), mhorne, yuripv
Approved by:	0mp (mentor
Differential Revision:	https://reviews.freebsd.org/D27284
2020-11-19 16:57:45 +00:00
Mateusz Piotrowski
ddafd46c88 Do not document MOTIFLIB in ports(7)
Perhaps it made sense in 1998 (r32836), but now it feels a bit out of
place.  We tend to avoid documenting non-essential ports variables in
the manual page (we try to document them in the Porter's Handbook instead).

MFC after:	1 week
2020-11-10 11:32:01 +00:00
Mateusz Piotrowski
664eefe222 build.7: Mention etcupdate(8) alongside mergemaster(8)
MFC after:	3 days
2020-11-03 18:13:42 +00:00
Mateusz Piotrowski
23788e6c4a Fix a typo in the description of WITH_DEBUG_PORTS
For each origin listed in WITH_DEBUG_PORTS, the ports framework sets
WITH_DEBUG instead of WITH_DEBUG_PORTS.

MFC after:	3 days
2020-11-03 18:02:02 +00:00
Mateusz Piotrowski
fcdfe01616 Document how to set ports options via make.conf(5)
This patch is based on:
- https://lists.freebsd.org/pipermail/freebsd-ports-announce/2013-June/000062.html
- current content of /usr/ports/Mk/bsd.options.mk

PR:		194306
Reported by:	Daan K. <daanknip__hotmail_com>
MFC after:	2 weeks
2020-11-03 13:26:00 +00:00
Mateusz Piotrowski
758dde0614 Do not document default locations of the OpenBSD and NetBSD ports trees
Our own Ports Collection is not targeting those systems at the moment,
so let's stop documenting bits specific to OpenBSD and NetBSD in the ports
documentation. Especially, that it might bit rot one day.

MFC after:	1 week
2020-11-01 20:54:02 +00:00
Mateusz Piotrowski
76d2af50b5 Document how to use sudo for SU_CMD
It is rather common for the ports users to replace su(1) with sudo(8)
within the SU_CMD variable. Let's document it in the manual page (so far
it's been hidden in a comment within bsd.commands.mk).

MFC after:	2 weeks
2020-11-01 17:27:48 +00:00
Edward Tomasz Napierala
bce7ee9d41 Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@.  It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by:	emaste, imp, gbe (manpages)
Differential Revision:	https://reviews.freebsd.org/D26980
2020-10-28 13:46:11 +00:00
Brandon Bergren
1bdb1aa426 arch(7): PowerPC64LE architecture definition
Document the new powerpc64le arch's initial specifications.

Certain things are subject to change while this is experimental. The most
likely change is that long double may switch to quad, dependent on POWER8
emulation assistance for __float128 being set up in the compiler (as
POWER8 does not have IEEE-compatible 128-bit hardware float, unlike POWER9.)

Sponsored by:	Tag1 Consulting, Inc.
2020-09-23 03:12:58 +00:00
Gordon Bergling
182ae6ca30 crypto(7): Correct Sections out of conventional order error
Event:		September 2020 Bugathon
MFC after:	1 week
2020-09-19 15:08:57 +00:00
Gordon Bergling
60365150ae arch(7): Some markup fixes
- no blank before trailing delimiter

MFC after:	3 days
2020-09-17 21:24:11 +00:00
Gordon Bergling
e6ca69017c Improvements for the src.conf(5) and build(7) man pages
PR:		203863 (based on)
Submitted by:	Russell Haley <russ dot haley at gmail dot com>
Reviewed by:	bcr, imp
Approved by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26343
2020-09-11 18:09:49 +00:00
Ed Maste
55c9a224e2 release.7: update for current context
It's no longer unusual to be able to build a release with a single
command, so drop "actually" that hints at a surprise.  Also just use
"network install directory" instead of referencing FTP; it's more
likely to be HTTP now.

Reviewed by:	gjb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26260
2020-09-01 15:30:40 +00:00
Mateusz Piotrowski
0dfb59ab75 Cross-reference development.7 and tests.7
MFC after:	7 days
2020-08-19 13:09:31 +00:00
Gordon Bergling
6d34415f67 environ(7): Update the description and include some more environment variables
- Add a better introduction to the DESCRIPTION section
- Add a description for MANPATH and POSIXLY_CORRECT
- Asorted improvements for the usage of some macros

PR:		43823
Submitted by:	Lyndon Nerenberg <lyndon at orthanc dot ab dot ca>
Reviewed by:	0mp, bcr
Approved by:	0mp, bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25912
2020-08-05 11:41:41 +00:00
Mateusz Piotrowski
b9615c3c00 Do not describe portsnap(8) as a way to manage /usr/ports 2020-08-05 11:26:14 +00:00
Mateusz Piotrowski
8c72577900 Do not mention portsnap(8) in ports.7
As we are moving away from portsnap,
let's not recommend it in the manual page.

Reviewed by:	bcr (manpages), mat (portmgr)
Differential Revision:	https://reviews.freebsd.org/D25847
2020-08-03 13:12:07 +00:00
Piotr Pawel Stefaniak
c6a2e9a7ae Promote use of unprivileged users for building ports by documenting SU_CMD.
Phrasing by Daniel O'Connor.

Reviewed by:	0mp
MFC after:	14 days
Differential Revision:	https://reviews.freebsd.org/D25433
2020-07-17 06:33:20 +00:00
Sergio Carlavilla Delgado
45b34f2cce Add orders man page
PR:		239020
Submitted by:	gbe@
Approved by:	imp@
Obtained from:	NetBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24293
2020-07-11 18:27:05 +00:00
Li-Wen Hsu
97a4bf8062 Update tests(7) as kyua(1) was imported to base in r359260
PR:		247151
Reported by:	0mp
Reviewed by:	0mp, asomers, bcr, emaste, markj
Suggested from:	brooks, ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25339
2020-06-25 11:41:28 +00:00
Mitchell Horne
c4ef7cdb4d arch(7): small corrections for RISC-V
Document that RISC-V supports multiple page sizes: 4K, 2M, and 1G.

RISC-V's long double is always 128-bits wide, therefore quad precision.

Mention __riscv_float_abi_soft, which can be used to differentiate between
riscv64 and riscv64sf in userland code.

MFC after:	3 days
2020-06-23 17:17:13 +00:00
Li-Wen Hsu
5af5819d29 Mention CI system information in development(7)
Approved by:	0mp, bcr
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25340
2020-06-23 11:40:11 +00:00
Konstantin Belousov
17edf152e5 Control for Special Register Buffer Data Sampling mitigation.
New microcode update for Intel enables mitigation for SRBDS, which
slows down RDSEED and related instructions.  The update also provides
a control to limit the mitigation to SGX enclaves, which should
restore the speed of random generator by the cost of potential
cross-core bufer sampling.

See https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling

GIve the user control over it.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25221
2020-06-12 22:14:45 +00:00
Yuri Pankov
d0b8ad1e6c stats(7): fix bad Xr references and lint noise
Reviewed by:	bjk, debdrup
Differential Revision:	https://reviews.freebsd.org/D25166
2020-06-06 17:48:55 +00:00
John Baldwin
82785a3cc8 Update crypto(7) to list current ciphers.
Add descriptions of AES-CCM, Camellia-CBC, and Chacha20.

Reviewed by:	cem (previous version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24963
2020-06-04 22:16:19 +00:00
John Baldwin
723d87648e Improve support for stream ciphers in the software encryption interface.
Add a 'native_blocksize' member to 'struct enc_xform' that ciphers can
use if they support a partial final block.  This is particular useful
for stream ciphers, but can also apply to other ciphers.  cryptosoft
will only pass in native blocks to the encrypt and decrypt hooks.  For
the final partial block, 'struct enc_xform' now has new
encrypt_last/decrypt_last hooks which accept the length of the final
block.  The multi_block methods are also retired.

Mark AES-ICM (AES-CTR) as a stream cipher.  This has some interesting
effects on IPsec in that FreeBSD can now properly receive all packets
sent by Linux when using AES-CTR, but FreeBSD can no longer
interoperate with OpenBSD and older verisons of FreeBSD which assume
AES-CTR packets have a payload padded to a 16-byte boundary.  Kornel
has offered to work on a patch to add a compatiblity sysctl to enforce
additional padding for AES-CTR in esp_output to permit compatibility
with OpenBSD and older versions of FreeBSD.

AES-XTS continues to use a block size of a single AES block length.
It is possible to adjust it to support partial final blocks by
implementing cipher text stealing via encrypt_last/decrypt_last hooks,
but I have not done so.

Reviewed by:	cem (earlier version)
Tested by:	Kornel Dulęba <mindal@semihalf.com> (AES-CTR with IPsec)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D24906
2020-05-22 16:29:09 +00:00
Konstantin Belousov
ea6020830c amd64: Add a knob to flush RSB on context switches if machine has SMEP.
The flush is needed to prevent cross-process ret2spec, which is not handled
on kernel entry if IBPB is enabled but SMEP is present.
While there, add i386 RSB flush.

Reported by:	Anthony Steinhauser <asteinhauser@google.com>
Reviewed by:	markj, Anthony Steinhauser
Discussed with:	philip
admbugs:	961
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-05-20 22:00:31 +00:00
Benedict Reuschling
9367806da8 Add new stats(7) man page and hook it up to the build.
This man page contains stat utilities that are available in
the base system. This is a better approach than looking them
up via "apropos stat" or similar commands.

Thanks to Daniel Ebdrup Jensen for writing the original page
and incorporating the feedback given.

Submitted by:	Daniel Ebdrup Jensen
Reviewed by:	0mp, allanjude, brueffer, bcr
Approved by:	bcr
MFC after:	3 days
Relnotes:	yes (new stats(7) man page)
Differential Revision:	https://reviews.freebsd.org/D24417
2020-05-14 09:18:50 +00:00
Benedict Reuschling
95baab0dac Add references for the most important man7
pages worth reading to intro(7).

Submitted by:	Gordon Bergling gbergling_gmail.com
Approved by:	bcr
Differential Revision:	https://reviews.freebsd.org/D24649
2020-05-03 10:35:36 +00:00
Benedict Reuschling
55ed6718c2 Fix various, mostly minor errors in man pages like:
- Abbreviated month name in .Dd
- position of HISTORY section
- alphabetical ordering within SEE ALSO section
- adding .Ed before .Sh DESCRIPTION
- remove trailing whitespaces
- Line break after a sentence stop
- Use BSD OS macros instead of hardcoded strings

No .Dd bumps as there was no actual content change made
in any of these pages.

Submitted by:	Gordon Bergling gbergling_gmail.com
Approved by:	bcr
Differential Revision:	https://reviews.freebsd.org/D24591
2020-05-03 10:15:58 +00:00
Benedict Reuschling
59e11f398e Add HISTORY sections to build(7), crypto(7),
ffs(7), growfs(7), and diskless(8).

Submitted by:	Gordon Bergling gbergling_gmail.com
Approved by:	bcr
Differential Revision:	https://reviews.freebsd.org/D24271
2020-05-03 09:54:19 +00:00
Richard Scheffenegger
d7ca3f780d Reduce default TCP delayed ACK timeout to 40ms.
Reviewed by:	kbowling, tuexen
Approved by:	tuexen (mentor)
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D23281
2020-04-16 15:59:23 +00:00
Warner Losh
e1b9162f48 Document universe better
Document the kernels and worlds targets. Document the TARGETS and EXTRA_TARGETS
variables.

Reviewed by: brooks, bdrewery, emaste (LGTM)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D24212
2020-03-31 22:41:53 +00:00
Warner Losh
a7783b5a72 Make universe configuration more consistent with rest of system
Add 'WITHOUT_WORLDS' and 'WITHOUT_KERNELS' as aliases for the inconsistently
named MAKE_JUST_KERNELS and MAKE_JUST_WORLDS respectively. I always forget the
MAKE_ part (or is it BUILD_), and it's inconsistent with everything
else. Document the new things, but leave speculation of any eventual MAKE_JUST_*
deprecation out of the manuals and comments.

Reviewed by: brooks, bdrewery, emaste (LGTM)
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D24212
2020-03-31 22:41:43 +00:00
Ed Maste
e6f6c36ce3 arch.7: update Default Tool Chain section
All architectures use Clang, lld, and ELF Tool Chain now.
2020-03-28 15:35:47 +00:00
John Baldwin
c034143269 Refactor driver and consumer interfaces for OCF (in-kernel crypto).
- The linked list of cryptoini structures used in session
  initialization is replaced with a new flat structure: struct
  crypto_session_params.  This session includes a new mode to define
  how the other fields should be interpreted.  Available modes
  include:

  - COMPRESS (for compression/decompression)
  - CIPHER (for simply encryption/decryption)
  - DIGEST (computing and verifying digests)
  - AEAD (combined auth and encryption such as AES-GCM and AES-CCM)
  - ETA (combined auth and encryption using encrypt-then-authenticate)

  Additional modes could be added in the future (e.g. if we wanted to
  support TLS MtE for AES-CBC in the kernel we could add a new mode
  for that.  TLS modes might also affect how AAD is interpreted, etc.)

  The flat structure also includes the key lengths and algorithms as
  before.  However, code doesn't have to walk the linked list and
  switch on the algorithm to determine which key is the auth key vs
  encryption key.  The 'csp_auth_*' fields are always used for auth
  keys and settings and 'csp_cipher_*' for cipher.  (Compression
  algorithms are stored in csp_cipher_alg.)

- Drivers no longer register a list of supported algorithms.  This
  doesn't quite work when you factor in modes (e.g. a driver might
  support both AES-CBC and SHA2-256-HMAC separately but not combined
  for ETA).  Instead, a new 'crypto_probesession' method has been
  added to the kobj interface for symmteric crypto drivers.  This
  method returns a negative value on success (similar to how
  device_probe works) and the crypto framework uses this value to pick
  the "best" driver.  There are three constants for hardware
  (e.g. ccr), accelerated software (e.g. aesni), and plain software
  (cryptosoft) that give preference in that order.  One effect of this
  is that if you request only hardware when creating a new session,
  you will no longer get a session using accelerated software.
  Another effect is that the default setting to disallow software
  crypto via /dev/crypto now disables accelerated software.

  Once a driver is chosen, 'crypto_newsession' is invoked as before.

- Crypto operations are now solely described by the flat 'cryptop'
  structure.  The linked list of descriptors has been removed.

  A separate enum has been added to describe the type of data buffer
  in use instead of using CRYPTO_F_* flags to make it easier to add
  more types in the future if needed (e.g. wired userspace buffers for
  zero-copy).  It will also make it easier to re-introduce separate
  input and output buffers (in-kernel TLS would benefit from this).

  Try to make the flags related to IV handling less insane:

  - CRYPTO_F_IV_SEPARATE means that the IV is stored in the 'crp_iv'
    member of the operation structure.  If this flag is not set, the
    IV is stored in the data buffer at the 'crp_iv_start' offset.

  - CRYPTO_F_IV_GENERATE means that a random IV should be generated
    and stored into the data buffer.  This cannot be used with
    CRYPTO_F_IV_SEPARATE.

  If a consumer wants to deal with explicit vs implicit IVs, etc. it
  can always generate the IV however it needs and store partial IVs in
  the buffer and the full IV/nonce in crp_iv and set
  CRYPTO_F_IV_SEPARATE.

  The layout of the buffer is now described via fields in cryptop.
  crp_aad_start and crp_aad_length define the boundaries of any AAD.
  Previously with GCM and CCM you defined an auth crd with this range,
  but for ETA your auth crd had to span both the AAD and plaintext
  (and they had to be adjacent).

  crp_payload_start and crp_payload_length define the boundaries of
  the plaintext/ciphertext.  Modes that only do a single operation
  (COMPRESS, CIPHER, DIGEST) should only use this region and leave the
  AAD region empty.

  If a digest is present (or should be generated), it's starting
  location is marked by crp_digest_start.

  Instead of using the CRD_F_ENCRYPT flag to determine the direction
  of the operation, cryptop now includes an 'op' field defining the
  operation to perform.  For digests I've added a new VERIFY digest
  mode which assumes a digest is present in the input and fails the
  request with EBADMSG if it doesn't match the internally-computed
  digest.  GCM and CCM already assumed this, and the new AEAD mode
  requires this for decryption.  The new ETA mode now also requires
  this for decryption, so IPsec and GELI no longer do their own
  authentication verification.  Simple DIGEST operations can also do
  this, though there are no in-tree consumers.

  To eventually support some refcounting to close races, the session
  cookie is now passed to crypto_getop() and clients should no longer
  set crp_sesssion directly.

- Assymteric crypto operation structures should be allocated via
  crypto_getkreq() and freed via crypto_freekreq().  This permits the
  crypto layer to track open asym requests and close races with a
  driver trying to unregister while asym requests are in flight.

- crypto_copyback, crypto_copydata, crypto_apply, and
  crypto_contiguous_subsegment now accept the 'crp' object as the
  first parameter instead of individual members.  This makes it easier
  to deal with different buffer types in the future as well as
  separate input and output buffers.  It's also simpler for driver
  writers to use.

- bus_dmamap_load_crp() loads a DMA mapping for a crypto buffer.
  This understands the various types of buffers so that drivers that
  use DMA do not have to be aware of different buffer types.

- Helper routines now exist to build an auth context for HMAC IPAD
  and OPAD.  This reduces some duplicated work among drivers.

- Key buffers are now treated as const throughout the framework and in
  device drivers.  However, session key buffers provided when a session
  is created are expected to remain alive for the duration of the
  session.

- GCM and CCM sessions now only specify a cipher algorithm and a cipher
  key.  The redundant auth information is not needed or used.

- For cryptosoft, split up the code a bit such that the 'process'
  callback now invokes a function pointer in the session.  This
  function pointer is set based on the mode (in effect) though it
  simplifies a few edge cases that would otherwise be in the switch in
  'process'.

  It does split up GCM vs CCM which I think is more readable even if there
  is some duplication.

- I changed /dev/crypto to support GMAC requests using CRYPTO_AES_NIST_GMAC
  as an auth algorithm and updated cryptocheck to work with it.

- Combined cipher and auth sessions via /dev/crypto now always use ETA
  mode.  The COP_F_CIPHER_FIRST flag is now a no-op that is ignored.
  This was actually documented as being true in crypto(4) before, but
  the code had not implemented this before I added the CIPHER_FIRST
  flag.

- I have not yet updated /dev/crypto to be aware of explicit modes for
  sessions.  I will probably do that at some point in the future as well
  as teach it about IV/nonce and tag lengths for AEAD so we can support
  all of the NIST KAT tests for GCM and CCM.

- I've split up the exising crypto.9 manpage into several pages
  of which many are written from scratch.

- I have converted all drivers and consumers in the tree and verified
  that they compile, but I have not tested all of them.  I have tested
  the following drivers:

  - cryptosoft
  - aesni (AES only)
  - blake2
  - ccr

  and the following consumers:

  - cryptodev
  - IPsec
  - ktls_ocf
  - GELI (lightly)

  I have not tested the following:

  - ccp
  - aesni with sha
  - hifn
  - kgssapi_krb5
  - ubsec
  - padlock
  - safe
  - armv8_crypto (aarch64)
  - glxsb (i386)
  - sec (ppc)
  - cesa (armv7)
  - cryptocteon (mips64)
  - nlmsec (mips64)

Discussed with:	cem
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D23677
2020-03-27 18:25:23 +00:00
Brandon Bergren
a04ec978b3 [PowerPC] Switch powerpc and powerpcspe to lld
Now that LLD 10 is out, and required patches have landed, we are now ready
to finally switch away from the ancient in-tree ld.bfd.

Special thanks to Fangrui Song for many hours of work on getting the
32-bit powerpc lld ready for prime-time.

Reviewed by:	emaste (earlier revision), jhibbits
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D24111
2020-03-27 01:00:03 +00:00
Ed Maste
1fc78b7e60 arch.7: remove Default Tool Chain footnote about xtoolchain
MIPS was the last arch to use external toolchain by default but uses
in-tree Clang and lld as of r359233, and now no table entries reference
the footnote.
2020-03-23 18:17:56 +00:00
Ed Maste
ce0d5fb489 arch.7: update Default Tool Chain intro text
All FreeBSD archs now use an in-tree toolchain - Clang and ELF Tool
Chain everywhere, and lld everywhere but 32-bit PowerPC (which still
uses ld.bfd).  No archs use external toolchain by default.

Sponsored by:	The FreeBSD Foundation
2020-03-23 18:14:04 +00:00
Alex Richardson
647d4c51df Update arch.7 .Dd for r359233
Suggested by:	lwhsu
2020-03-23 17:51:39 +00:00
Alex Richardson
4a4c9a0f9e Use Clang and LLD as the default toolchain for MIPS
Now that we have updated the in-tree version of LLVM to 10.0, we have all the
necessary LLVM changes to use Clang+LLD as the default toolchain for MIPS.

Relnotes:	yes
Reviewed By:	emaste, jhb, brooks, kevans
Differential Revision: https://reviews.freebsd.org/D23204
2020-03-23 10:36:32 +00:00
Ed Maste
ddc9d6e55a arch.7: remove extraneous markup from header table sizing
Reported by:	0mp (in response to r358891)
2020-03-11 20:40:24 +00:00
Ed Maste
3823477b39 arch.7: remove note about GCC 4.2.1 removal date
GCC 4.2.1 was removed in r358454.

Sponsored by:	The FreeBSD Foundation
2020-03-08 21:30:55 +00:00
Ed Maste
1458fa16a2 arch.7: remove sparc64 references
sparc64 was removed from the tree, so remove references here (except
for the supported release table).

Sponsored by:	The FreeBSD Foundation
2020-03-08 21:25:36 +00:00
Conrad Meyer
fd1efedc79 Add extremely useful calendar(1) application to FreeBSD
It does extremely useful things like execute sendmail and spew dubiously
accurate factoids.

From the feedback, it seems like it is an essential utility in a modern unix
and not at all a useless bikeshed.  How do those Linux people live without it?
Reverts r358561.
2020-03-03 00:20:08 +00:00
Conrad Meyer
3c565de33f Fix typo in r278616
FreeBSD isn't an encyclopedia.
2020-03-02 23:37:47 +00:00