Commit Graph

21056 Commits

Author SHA1 Message Date
Mark Johnston
420d30f5bd kasan.9: A couple of fixups
- Mention GENERIC-KASAN.
- Note that the runtime was ported from NetBSD.

Sponsored by:	The FreeBSD Foundation
2021-04-29 12:26:37 -04:00
Cy Schubert
8e435de92c src.libnames.mk: Remove redundant am-utils library definition
r358821 (13f7dbe822) retired amd(8).
This commit cleans up an artifact left in src.libnames.mk.

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D29914
2021-04-29 07:07:29 -07:00
Baptiste Daroussin
a4b5f7ba3e pci_vendors: update to 2021.04.26 2021-04-29 06:46:26 +02: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
Ceri Davies
f33f2365ee geom_uzip(4): fix a typo
While I was there, also fixed a whitespace issue reported by mandoc
-Tlint.

PR:		254338
MFC after:	3 days
2021-04-28 00:59:03 -04:00
Michael Tuexen
6096814d31 tcp: fix man page
Reviewed by:		gbe, rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D29963
2021-04-24 22:40:34 +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
Ka Ho Ng
4ce1ba6523 sndstat: nvlist schema and API definition changes
- SNDSTAT_LABEL_* are renamed to SNDST_DSPS_*, and SNDSTAT_LABEL_DSPS
  becomes SNDST_DSPS.
- Centralize channel number/rate/formats into a single nvlist
  The above nvlist is named "info_play" and "info_rec"
- Expose only encoding format in pfmts/rfmts. Userland has no direct
  access to AFMT_ENCODING/CHANNEL/EXTCHANNEL macros, thus it serves no
  meaning to expose too much information through this pair of labels.
  However pminrate/rminrate, pmaxrate/rmaxrate, pfmts/rfmts are
  deprecated and will be removed in future.

This commit keeps ioctls ABI compatibility with __FreeBSD_version
1400006 for now. In future the compat ABI with 1400006 will be removed
once audio/virtual_oss is rebuilt.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D29770
2021-04-21 16:19:15 +08:00
Ka Ho Ng
3dbd5ecfe8 Add myself (khng) as src committer.
Approved by:	lwhsu (mentor), philip (mentor)
2021-04-20 19:33:36 +08:00
Faraz Vahedi
33f8d79d76 assert.3: Document static_assert and _Static_assert
Reviewed by:	imp, 0mp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29833
2021-04-20 11:17:44 +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
Alex Richardson
ba1182e263 bsd.compiler.mk: detect Apple Clang for cross-builds
Apple clang uses a different versioning scheme, so if we enable or
disable certain warnings for Clang 11+, those might not be supported
in Apple Clang 11+. This adds 'apple-clang' to COMPILER_FEATURES, so that
bootstrap tools Makefiles can avoid warnings on macOS.

Reviewed By:	imp
Differential Revision: https://reviews.freebsd.org/D29680
2021-04-20 01:46:36 +01:00
Mateusz Piotrowski
22b2ba4e22 Fix a typo in Gordon's login
It's gbe, not bge.

Fixes:	bffc3fb3c0 Add metor -> mentee information (docs)
2021-04-19 15:48:05 +02:00
Kristof Provost
42ec75f83a pf: Optionally attempt to preserve rule counter values across ruleset updates
Usually rule counters are reset to zero on every update of the ruleset.
With keepcounters set pf will attempt to find matching rules between old
and new rulesets and preserve the rule counters.

MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29780
2021-04-19 14:31:47 +02:00
Michael Tuexen
9e644c2300 tcp: add support for TCP over UDP
Adding support for TCP over UDP allows communication with
TCP stacks which can be implemented in userspace without
requiring special priviledges or specific support by the OS.
This is joint work with rrs.

Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D29469
2021-04-18 16:16:42 +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
40277af7f2 spigen.4: Fix typos
MFC after:	3 days
2021-04-18 10:20:10 +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
Richard Scheffenegger
d1de2b05a0 tcp: Rename rfc6675_pipe to sack.revised, and enable by default
As full support of RFC6675 is in place, deprecating
net.inet.tcp.rfc6675_pipe and enabling by default
net.inet.tcp.sack.revised.

Reviewed By: #transport, kbowling, rrs
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D28702
2021-04-17 14:59:45 +02:00
Gleb Smirnoff
77a84a305e syncache.4: fix mandoc in cb8d7c44d6
Noticed by:	brueffer
2021-04-15 15:50:01 -07:00
Gleb Smirnoff
cb8d7c44d6 tcp_syncache: add net.inet.tcp.syncache.see_other sysctl
A security feature from c06f087ccb appeared to be a huge bottleneck
under SYN flood. To mitigate that add a sysctl that would make
syncache(4) globally visible, ignoring UID/GID, jail(2) and mac(4)
checks. When turned on, we won't need to call crhold() on the listening
socket credential for every incoming SYN packet.

Reviewed by:	bz
2021-04-15 15:26:48 -07:00
Mark Johnston
aabe13f145 uma: Introduce per-domain reclamation functions
Make it possible to reclaim items from a specific NUMA domain.

- Add uma_zone_reclaim_domain() and uma_reclaim_domain().
- Permit parallel reclamations.  Use a counter instead of a flag to
  synchronize with zone_dtor().
- Use the zone lock to protect cache_shrink() now that parallel reclaims
  can happen.
- Add a sysctl that can be used to trigger reclamation from a specific
  domain.

Currently the new KPIs are unused, so there should be no functional
change.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29685
2021-04-14 13:03:34 -04:00
Mark Johnston
29bb6c19f0 domainset: Define additional global policies
Add global definitions for first-touch and interleave policies.  The
former may be useful for UMA, which implements a similar policy without
using domainset iterators.

No functional change intended.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29104
2021-04-14 13:03:33 -04:00
Gordon Bergling
b1ab802ce4 ossl(4): Install the man page also for arm64
In 22bd0c9731 ossl(4) was ported to arm64. The manual page was
adapted, but never installed since the ossl(4) manual page was
i386 / amd64 only.

Reviewed by:	mhorne
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29762
2021-04-14 18:32:56 +02:00
Mark Johnston
38da497a4d Add the KASAN runtime
KASAN enables the use of LLVM's AddressSanitizer in the kernel.  This
feature makes use of compiler instrumentation to validate memory
accesses in the kernel and detect several types of bugs, including
use-after-frees and out-of-bounds accesses.  It is particularly
effective when combined with test suites or syzkaller.  KASAN has high
CPU and memory usage overhead and so is not suited for production
environments.

The runtime and pmap maintain a shadow of the kernel map to store
information about the validity of memory mapped at a given kernel
address.

The runtime implements a number of functions defined by the compiler
ABI.  These are prefixed by __asan.  The compiler emits calls to
__asan_load*() and __asan_store*() around memory accesses, and the
runtime consults the shadow map to determine whether a given access is
valid.

kasan_mark() is called by various kernel allocators to update state in
the shadow map.  Updates to those allocators will come in subsequent
commits.

The runtime also defines various interceptors.  Some low-level routines
are implemented in assembly and are thus not amenable to compiler
instrumentation.  To handle this, the runtime implements these routines
on behalf of the rest of the kernel.  The sanitizer implementation
validates memory accesses manually before handing off to the real
implementation.

The sanitizer in a KASAN-configured kernel can be disabled by setting
the loader tunable debug.kasan.disable=1.

Obtained from:	NetBSD
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29416
2021-04-13 17:42:20 -04:00
Dmitry Chagin
86887853c3 Remove reference to the pfctlinput2() from domain(9) after 237c1f932b.
Reviewed by:		glebius
MFC After:		1 week
Differential Revision:	https://reviews.freebsd.org/D29751
2021-04-14 00:40:20 +03:00
Kurosawa Takahiro
2aa21096c7 pf: Implement the NAT source port selection of MAP-E Customer Edge
MAP-E (RFC 7597) requires special care for selecting source ports
in NAT operation on the Customer Edge because a part of bits of the port
numbers are used by the Border Relay to distinguish another side of the
IPv4-over-IPv6 tunnel.

PR:		254577
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D29468
2021-04-13 10:53:18 +02:00
John Baldwin
76681661be OCF: Remove support for asymmetric cryptographic operations.
There haven't been any non-obscure drivers that supported this
functionality and it has been impossible to test to ensure that it
still works.  The only known consumer of this interface was the engine
in OpenSSL < 1.1.  Modern OpenSSL versions do not include support for
this interface as it was not well-documented.

Reviewed by:	cem
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D29736
2021-04-12 14:28:43 -07:00
Mitchell Horne
2816bd8442 rmlock(9): add an RM_DUPOK flag
Allows for duplicate locks to be acquired without witness complaining.
Similar flags exists already for rwlock(9) and sx(9).

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
NetApp PR:	52
Differential Revision:	https://reviews.freebsd.org/D29683n
2021-04-12 11:42:21 -03:00
Mark Johnston
dfff37765c Rename struct device to struct _device
types.h defines device_t as a typedef of struct device *.  struct device
is defined in subr_bus.c and almost all of the kernel uses device_t.
The LinuxKPI also defines a struct device, so type confusion can occur.

This causes bugs and ambiguity for debugging tools.  Rename the FreeBSD
struct device to struct _device.

Reviewed by:	gbe (man pages)
Reviewed by:	rpokala, imp, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29676
2021-04-12 09:32:30 -04:00
Yuri Pankov
970ffdcefe acpi(4): mention NONE as possible setting for hw.acpi.power_button_state
Reviewed by:	manpages (gbe)
Differential Revision:	https://reviews.freebsd.org/D29577
2021-04-11 23:17:06 +03:00
Ka Ho Ng
b77f5f5553 vnode_pager_setsize.9: Some clarifications on the manpage
A number of changes:
- Clarifies the locking rules when calling the routine.
- Correct the description regarding the content range to be purged.
- Document the effects on page fault handler.

MFC after:	3 days
MFC with:	86a52e262a
Sponsored by:	The FreeBSD Foundation
Reviewed by:	bcr, kib
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D29637
2021-04-11 14:47:40 +08:00
Kristof Provost
0d71f9f36e pfctl: Move ioctl abstraction functions into libpfctl
Introduce a library to wrap the pf ioctl interface.

MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29562
2021-04-10 11:16:02 +02:00
Ed Maste
041c504942 Regen src.conf.5 after 9d178c925f 2021-04-09 22:24:08 -04:00
Gordon Bergling
46c9952807 sysctl.conf(5): Mention sysctl.conf.local in the sysctl.conf(5) manual page
The possibility of using a sysctl.conf.local on a machine that has a shared
sysctl.conf(5) isn't documented. So mention the sysctl.conf.local in the
manual page.

PR:	254901
Submitted by:	Jose Luis Duran <jlduran at gmail dot com>
Reported by:	Jose Luis Duran <jlduran at gmail dot com>
Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29673
2021-04-09 17:28:18 +02:00
Dmitry Chagin
f2400e6e83 Removed the reference to the deprecated splx API from ifnet(9).
Reviewed by:		emaste, markj
PR:			254880
MFC After:		1 week
Differential Revision:	https://reviews.freebsd.org/D29666
2021-04-09 17:22:12 +03:00
Gordon Bergling
9048d9a933 sed(1): Add a reference for a 4.4BSD manual document
Obtained from:	OpenBSD
MFC after:	1 week
2021-04-08 21:07:31 +02:00
Richard Scheffenegger
b878ec024b tcp: Use jenkins_hash32() in hostcache
As other parts of the base tcp stack (eg.
tcp fastopen) already use jenkins_hash32,
and the properties appear reasonably good,
switching to use that.

Reviewed By: tuexen, #transport, ae
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29515
2021-04-08 20:29:19 +02:00
Ka Ho Ng
86a52e262a Document vnode_pager_setsize(9)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Reviewed by:	bcr
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D29408
2021-04-07 19:11:26 +08: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
Cy Schubert
e2b247fac2 Remove bt.4 man page.
r339568 (a1db7455b7) removed bt(4).
This revision removes the man page

Reviewed by:		emaste (previous version)
Differential Revision:	https://reviews.freebsd.org/D29480
2021-04-01 19:09:54 -07:00
Konstantin Belousov
baacf70137 vxlan: correct interface MTU when using hw offloads
Otherwise it breaks when offloading like checksum or TSO are used,
because second (encapsulated) ip_output() processing passes fragments of
the encapsulated packet down to the hardware interface.

Diagnosed by:	hselasky
Reviewed by:	np
Sponsored by:	Nvidia Networking / Mellanox Technologies
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D29501
2021-03-31 14:38:26 +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
Lawrence Stewart
dbbf3e3f37 random(9): Restore historical [0,2^31-1] output range and related man
documention.

Commit SVN r364219 / Git 8a0edc914f changed random(9) to be a shim around
prng32(9) and inadvertently caused random(9) to begin returning numbers in the
range [0,2^32-1] instead of [0,2^31-1], where the latter has been the documented
range for decades.

The increased output range has been identified as the source of numerous bugs in
code written against the historical output range e.g. ipfw "prob" rules and
stats(3) are known to be affected, and a non-exhaustive audit of the tree
identified other random(9) consumers which are also likely affected.

As random(9) is deprecated and slated for eventual removal in 14.0, consumers
should gradually be audited and migrated to prng(9).

Submitted by:		Loic Prylli <lprylli@netflix.com>
Obtained from:		Netflix
Reviewed by:		cem, delphij, imp
MFC after:		1 day
MFC to:			stable/13, releng/13.0
Differential Revision:	https://reviews.freebsd.org/D29385
2021-03-24 16:14:58 +11:00
Ed Maste
0cff00ae68 retire obsolete mn(4) sync serial driver
Approved by:	phk
Relnotes:	yes
2021-03-22 15:06:51 -04:00
Alex Richardson
c8c62548bf Don't add -Winline for WARNS=6
This warning is very rarely useful (inline is a hint and not mandatory).
This flag results in many warnings being printed when compiling C++
code that uses the standard library with GCC.

This flag was originally added in back in r94332 but the flag is a no-op
in Clang ("This diagnostic flag exists for GCC compatibility, and has no
effect in Clang"). Removing it should make the GCC build output slightly
more readable.

Reviewed By:	jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D29235
2021-03-22 11:55:45 +00:00
Tobias Rehbein
815209920f rc.conf(5): Remove left-over variables
ipv6_ipfilter_rules was obsoleted because of ipfilter was updated, and
rc_parallel_start was reverted to undergo further refinement.

PR:		254398
Fixes:		e2ad10e847, f61831d2e8
2021-03-21 01:08:36 +01: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
Daniel Ebdrup Jensen
794f9f43c8 rc.conf(5): Bump date on .Dd
Pointy hat to:	me
Reported by:	lwhsu
2021-03-19 04:52:26 +01:00
John Baldwin
c853c53d02 Add Chacha20+Poly1035 to the list of AEAD algorithms.
Sponsored by:	Netflix
2021-03-18 13:33:11 -07:00
Tobias Rehbein
c39dda8192 rc.conf(5): Document the 'workstation' firewall_type
Document the workstation ACL ruleset, which uses stateful rules.

While here, add a note about where some of the undocumented variables
can be found. This is not a perfect solution for bug 127359, but it at
at least gives a place to go look, and can be used as a reference for
when bug 127359 gets fixed properly.

PR:		254358, 127359
2021-03-18 18:39:24 +01:00
Baptiste Daroussin
7a758a4cee Revert "terminfo: add terminfo database"
This reverts commit 2a50a9de83.
2021-03-18 10:57:23 +01: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
Kyle Evans
f187d6dfbf base: remove if_wg(4) and associated utilities, manpage
After length decisions, we've decided that the if_wg(4) driver and
related work is not yet ready to live in the tree.  This driver has
larger security implications than many, and thus will be held to
more scrutiny than other drivers.

Please also see the related message sent to the freebsd-hackers@
and freebsd-arch@ lists by Kyle Evans <kevans@FreeBSD.org> on
2021/03/16, with the subject line "Removing WireGuard Support From Base"
for additional context.
2021-03-17 09:14:48 -05:00
Ka Ho Ng
c96151d335 Implement sndstat nvlist-based enumeration ioctls.
These ioctl commands aim to provide easier ways for user space
applications to enumerate existing audio devices and the node they can
potentially use.

The exchange of device lists between user space and kernel is done on
nv(9). Some ioctl commands are added to /dev/sndstat node:
  - SNDSTAT_REFRESH_DEVS
  - SNDSTAT_GET_DEVS
  - SNDSTAT_ADD_USER_DEVS
  - SNDSTAT_FLUSH_USER_DEVS

Bump __FreeBSD_version to reflect the addition of the ioctls.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D26884
2021-03-17 19:05:43 +08:00
Jung-uk Kim
6827435548 pkgbase: Fix building out-of-tree manual pages
c7e6cb9e08 introduced MK_MANSPLITPKG but it was not available for
building out-of-tree manual pages.  For example, x11/nvidia-driver fails
with the following error:

===> doc (all)
make[3]: "/usr/share/mk/bsd.man.mk" line 53: Malformed conditional (${MK_MANSPLITPKG} == "no")
make[3]: Fatal errors encountered -- cannot continue

Move the definition from src.opts.mk to bsd.opts.mk to make it visible.
2021-03-16 14:29:48 -04:00
Emmanuel Vadot
c7e6cb9e08 pkgbase: Add an src.conf option for splitting man pages
Man pages can be big in total, add an options to split man pages
in -man packages so we produce smaller packages.
This is useful for small jails or mfsroot produced of pkgbase.
The option is off by default.

Reviewed by:	bapt, Mina Galić <me@igalic.co>
Differential Revision:	https://reviews.freebsd.org/D29169
MFC after:      2 weeks
2021-03-16 07:13:09 +01:00
Emmanuel Vadot
8a84b3736b bsd.lib.mk: Add a install target for .pc files
That way the files are correctly taggued for pkgbase

Reviewed by:	bapt, emaste (both earlier version)
Differential Revision:	https://reviews.freebsd.org/D29171
MFC after:      2 weeks
2021-03-16 07:13:03 +01:00
Kyle Evans
74ae3f3e33 if_wg: import latest fixup work from the wireguard-freebsd project
This is the culmination of about a week of work from three developers to
fix a number of functional and security issues.  This patch consists of
work done by the following folks:

- Jason A. Donenfeld <Jason@zx2c4.com>
- Matt Dunwoodie <ncon@noconroy.net>
- Kyle Evans <kevans@FreeBSD.org>

Notable changes include:
- Packets are now correctly staged for processing once the handshake has
  completed, resulting in less packet loss in the interim.
- Various race conditions have been resolved, particularly w.r.t. socket
  and packet lifetime (panics)
- Various tests have been added to assure correct functionality and
  tooling conformance
- Many security issues have been addressed
- if_wg now maintains jail-friendly semantics: sockets are created in
  the interface's home vnet so that it can act as the sole network
  connection for a jail
- if_wg no longer fails to remove peer allowed-ips of 0.0.0.0/0
- if_wg now exports via ioctl a format that is future proof and
  complete.  It is additionally supported by the upstream
  wireguard-tools (which we plan to merge in to base soon)
- if_wg now conforms to the WireGuard protocol and is more closely
  aligned with security auditing guidelines

Note that the driver has been rebased away from using iflib.  iflib
poses a number of challenges for a cloned device trying to operate in a
vnet that are non-trivial to solve and adds complexity to the
implementation for little gain.

The crypto implementation that was previously added to the tree was a
super complex integration of what previously appeared in an old out of
tree Linux module, which has been reduced to crypto.c containing simple
boring reference implementations.  This is part of a near-to-mid term
goal to work with FreeBSD kernel crypto folks and take advantage of or
improve accelerated crypto already offered elsewhere.

There's additional test suite effort underway out-of-tree taking
advantage of the aforementioned jail-friendly semantics to test a number
of real-world topologies, based on netns.sh.

Also note that this is still a work in progress; work going further will
be much smaller in nature.

MFC after:	1 month (maybe)
2021-03-14 23:52:04 -05:00
Ryan Libby
3e5e9939cd ddb: enable the use of ^C and ^S/^Q
This lets one interrupt DDB's output, which is useful if paging is
disabled and the output device is slow.

This follows a previous implementation in svn r311952 / git
5fddef7999 which was reverted because it
broke DDB type-ahead.

Now, try this again, but with a 512-byte type-ahead buffer.  While there
is buffer space, control input is handled and non-control input is
buffered.  When the buffer is exhausted, the default is to print a
warning and drop further non-control input in order to continue handling
control input.  sysctl debug.ddb.prioritize_control_input can be set to
0 to instead preserve all input but lose immediate handling of control
input.  This could for example effect pasting of a large script into the
ddb console.

Suggested by:	Anton Rang <rang@acm.org>
Reviewed by:	markj
Discussed with:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D28676
2021-03-14 16:04:27 -07:00
Gordon Bergling
183502d162 Fix a few typos in comments
- trough -> through

MFC after:	1 week
2021-03-13 16:37:28 +01:00
Kristof Provost
51dc8e7f68 Document that uma_zfree_pcpu() allows NULL now
While here also document that for counter_u64_free().

Reviewed by:	rpokala@
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29215
2021-03-12 12:12:35 +01: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
Warner Losh
c22076b528 man: Remove obsolete info from hosts man page
The NIC no longer provides a host database, and hasn't for quite some
time. Remove that paragraph, it's not been relevant for many years. Also, hosts
appeared in 4.1c, not 4.2, so correct that too.

Noticed by: Henry Bent
2021-03-11 11:46:10 -07:00
Warner Losh
e52368365d config_intrhook: provide config_intrhook_drain
config_intrhook_drain will remove the hook from the list as
config_intrhook_disestablish does if the hook hasn't been called.  If it has,
config_intrhook_drain will wait for the hook to be disestablished in the normal
course (or expedited, it's up to the driver to decide how and when
to call config_intrhook_disestablish).

This is intended for removable devices that use config_intrhook and might be
attached early in boot, but that may be removed before the kernel can call the
config_intrhook or before it ends. To prevent all races, the detach routine will
need to call config_intrhook_train.

Sponsored by:		Netflix, Inc
Reviewed by:		jhb, mav, gde (in D29006 for man page)
Differential Revision:	https://reviews.freebsd.org/D29005
2021-03-11 09:45:10 -07:00
Oskar Holmund
7d4a5de84d share/man/man9/pwmbus.9 fix types in arguments
Fix the types of period and duty in share/man/man9/pwmbus.9 to match the one in sys/dev/pmw/pwmbus.c.

Reviewed By: rpokala
Differential Revision: https://reviews.freebsd.org/D29139
MFC after:   3 days
2021-03-11 09:57:04 +01:00
Kyle Evans
ce53f92e6c wg(4): note the persistent-keepalive ifconfig(8) option
MFC after:	3 days
Fixes:	b3dac3913d
2021-03-09 14:21:35 -06:00
John Baldwin
c5a365623f Correct the name of the structure used for TCP socket options.
The structure was renamed while refactoring Netflix's KTLS changes for
upstreaming, but the original name remained in tcp.4 and was
subsequently copied to ktls.4.

PR:		254141
Reported by:	asomers
MFC after:	3 days
2021-03-08 10:46:40 -08:00
Gordon Bergling
f7bfe31019 wg(4): Fix an example in the manual page
The example in the manual page of wg(4) for connecting to a
peer was missing the 'public-key' ifconfig(8) keyword and for the
addressed peer the port must be specified.

PR:	253866
Reported by:	Sergey Akhmatov <sergey at akhmatov dot ru>
Reviewed by:	debdrup
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29115
2021-03-07 20:27:59 +01:00
Mark Murray
fbf8e32452 Remove references to the now-removed bktr(4) driver. 2021-03-07 00:09:22 +00:00
Hans Petter Selasky
c743a6bd4f Implement mallocarray_domainset(9) variant of mallocarray(9).
Reviewed by:	kib @
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-03-06 11:38:55 +01:00
Kristof Provost
b4e3f3c2de pfctl: Add missing 'va' code point name
Add the 'va' (voice-admit, RFC5865) symbolic name.

Reviewed by:	rgrimes, gbe (man page)
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29069
2021-03-06 10:07:55 +01:00
Konstantin Belousov
f5e930b369 atomic(9): note that atomic_interrupt_fence first appeared in 13.0
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-03-06 07:24:18 +02:00
Ryan Moeller
c4ba4aa547 libifconfig: Overhaul ifconfig_media_* interfaces
Define an ifmedia_t type to use for ifmedia words.

Add ifconfig_media_lookup_* functions to lookup ifmedia words by name.

Get media options as an array of option names rather than formatting it
as a comma-delimited list into a buffer.

Sprinkle const on static the static description tables for peace of
mind.

Don't need to zero memory allocated by calloc.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29029
2021-03-05 04:15:55 -05:00
Alex Richardson
172a624f0c Silence annoying and incorrect non-default linker warning with GCC
The CROSS_TOOLCHAIN GCC .mk files include -B${CROSS_BINUTILS_PREFIX}, so
GCC will select the right linker and we don't need to warn.
While here also apply 17b8b8fb5f to kern.mk.

Test Plan:	no more warning printed with CROSS_TOOLCHAIN=mips-gcc6
Reviewed By:	jhb
Differential Revision: https://reviews.freebsd.org/D29015
2021-03-04 18:27:39 +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
78991a93eb ossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28757
2021-03-03 15:20:57 -08:00
John Baldwin
92aecd1e6f ossl: Add ChaCha20 cipher support.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28756
2021-03-03 15:20:57 -08: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
John Baldwin
a079e38b08 ossl: Add Poly1305 digest support.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28754
2021-03-03 15:20:57 -08:00
Mark Johnston
3adf72a36b qat.4: Fix some firmware module names
PR:		252984
MFC after:	1 week
2021-03-03 09:07:53 -05: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
Kyle Evans
13686dffbb Regenerate src.conf(5) after FMTREE removal 2021-03-02 15:22:06 -06:00
Kyle Evans
e4d63c5d5f Remove fmtree(8)
fmtree(8) deprecation was announced on February 12, 2021, and no longer
built by default as of that date.  The deprecation notice was merged
back to stable/12 and stable/13 + releng/13.0.

Continue with the plan by finishing the removal.

Relnotes:	yes
2021-03-02 15:22:05 -06:00
Kyle Evans
ca4e1ea19f Regenerate src.conf(5) after PIE default change 2021-03-02 15:22:05 -06: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
Ka Ho Ng
43afeee2fb share/man/man9: document zero_region(9)
The zero_region() kernel interface was previously undocumented.
Add a new zero_region(9) manual page to document it.

Submitted by:	Ka Ho Ng <khng@freebsdfoundation.org>
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28914
2021-03-02 17:14:06 +08:00
Konstantin Belousov
55eb51ab66 Add VOP_READ_PGCACHE(9)
PR:	253894
Reviewed by:	gbe, rwatson
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28980
2021-03-01 01:38:33 +02:00
Robert Watson
a9f1135503 Add Xrefs to the new VOP_SETLABEL(9) from mac(9) and vnode(9).
MFC after:	3 days
2021-02-27 16:53:53 +00:00
Robert Watson
7bfd84444e Provide a man page for VOP_SETLABEL(9).
MFC after:	3 days
2021-02-27 16:51:13 +00:00
Li-Wen Hsu
655fa04406
Add if_wg.4 MLINK 2021-02-26 00:43:15 +08:00
Baptiste Daroussin
2a50a9de83 terminfo: add terminfo database
Tested by:	manu, jbeich
2021-02-25 14:25:32 +01:00
Baptiste Daroussin
61f66a1f44 ncurses: Add support for terminfo database
Along with the termcap database, ncurses will now lookup for the
terminfo database, note that the terminfo database is being looked
up first and then it fallsback on the termcap one.

While here drop our custom reader for the termcap database, over the
time it is needed maintenance to be able to catchup with changes on ncurses
side.

Install the ncurses tools which are needed to deal with the terminfo
database: tic, infocmp, toe

Replace our termcap only aware tools with the ncurses counterpart:
tput, tabs, tset, clear and reset

In particular they can your the extra capabilities described in the
terminfo database, which does not exist in termcap

Note that to add a new terminfo information to the database from ports
the ports will just need to add their extra information into:
/usr/local/share/site-terminfo/<firstletteroftheterm>/<term>

Tested by:	jbeich, manu
2021-02-25 14:25:11 +01:00
Marcin Wojtas
9a227a2fd6 Enable PIE by default on 64-bit architectures
This patch adds Position Independent Executables (PIE)
flags for building OS. It allows to enable the ASLR
feature based only on the sysctl knobs, without
need to rebuild the image. Tests showed that
no problems with stability / performance degradation
were seen when using PIEs with ASLR disabled.

The change is limited only for 64-bit architectures.

Use bsd.opts.mk instead of the src.opts.mk in order
to satisfy all build dependencies related to MK_PIE.

Reviewed by: emaste, imp
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D28328
2021-02-25 00:26:11 +01:00
Konstantin Belousov
e2494f7561 atomic: add atomic_interrupt_fence()
with the semantic following C11 signal_fence, that is, it establishes
ordering between its place and any interrupt handler executing on the
same CPU.

Reviewed by:	markj, mjg, rlibby
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28909
2021-02-24 22:45:24 +02:00