]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 months agoossl: Add a VAES-based AES-GCM implementation for amd64
Mark Johnston [Fri, 2 Jun 2023 15:58:29 +0000 (11:58 -0400)]
ossl: Add a VAES-based AES-GCM implementation for amd64

aes-gcm-avx512.S is generated from OpenSSL 3.1 and implements AES-GCM.
ossl_x86.c detects whether the CPU implements the required AVX512
instructions; if not, the ossl(4) module does not provide an AES-GCM
implementation.  The VAES implementation increases throughput for all
buffer sizes in both directions, up to 2x for sufficiently large
buffers.

The "process" implementation is in two parts: a generic OCF layer in
ossl_aes.c that calls a set of MD functions to do the heavy lifting.
The intent there is to make it possible to add other implementations for
other platforms, e.g., to reduce the diff required for D37421.

A follow-up commit will add a fallback path to legacy AES-NI, so that
ossl(4) can be used in preference to aesni(4) on all amd64 platforms.
In the long term we would like to replace aesni(4) and armv8crypto(4)
with ossl(4).

Note, currently this implementation will not be selected by default
since aesni(4) and ossl(4) return the same probe priority for crypto
sessions, and the opencrypto framework selects the first registered
implementation to break a tie.  Since aesni(4) is compiled into the
kernel, aesni(4) wins.  A separate change may modify ossl(4) to have
priority.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Reviewed by: jhb
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D39783

13 months agoossl: Expose more CPUID bits in OPENSSL_ia32cap_P
Mark Johnston [Fri, 2 Jun 2023 15:57:38 +0000 (11:57 -0400)]
ossl: Expose more CPUID bits in OPENSSL_ia32cap_P

This is needed to let OpenSSL 3.1 routines detect VAES and VPCLMULQDQ
extensions.  The intent is to import ASM routines which implement
AES-GCM using VEX-prefixed AES-NI instructions.

No functional change intended.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D39782

13 months agonetlink: fix compilation withous INET6
Gleb Smirnoff [Fri, 2 Jun 2023 16:09:55 +0000 (09:09 -0700)]
netlink: fix compilation withous INET6

Fixes: a77facd27368f618520d25391cfce11149879a41

13 months agoarm64: Fix the definition of ID_AA64DFR1_EL1
Andrew Turner [Fri, 2 Jun 2023 15:23:47 +0000 (16:23 +0100)]
arm64: Fix the definition of ID_AA64DFR1_EL1

13 months agoAdd more arm64 ID registers
Andrew Turner [Fri, 2 Jun 2023 14:59:46 +0000 (15:59 +0100)]
Add more arm64 ID registers

These will be used by bhyve to emulate these registers.

Sponsored by: Arm Ltd

13 months agoarm64: Correct a pmap unlock in pmap_stage2_fault
Andrew Turner [Fri, 2 Jun 2023 09:58:56 +0000 (10:58 +0100)]
arm64: Correct a pmap unlock in pmap_stage2_fault

This is used by bhyve so was not an issue as it is still in development.
Sponsored by: Arm Ltd

13 months agopf: fix log message
Kristof Provost [Tue, 30 May 2023 19:29:24 +0000 (21:29 +0200)]
pf: fix log message

Use __func__ so we log the correct function name.

Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agopf: carry over rule actions from route-to rules
Kristof Provost [Tue, 30 May 2023 19:17:54 +0000 (21:17 +0200)]
pf: carry over rule actions from route-to rules

If we route-to (or dup-to/reply-to) we re-run pf_test(), which will also
create states for the connection.
This means that we may end up matching a different (i.e. not the state
that was created by the route-to rule) state, without the attributes
(such as dummynet pipes/queues) set by the route-to rule.

Address this by inheriting the pf_rule_actions from the route-to rule
while evaluating the connection again in pf_test(). That is, we set
default pf_rule_actions based on the route-to rule for the new
evaluation. The new rule may still overrule these, but if it does not
have such actions the route-to actions are applied.

Do the same for IPv6 rules in pf_test6()/pf_route6().

See also: https://redmine.pfsense.org/issues/14039
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40340

13 months agodumpon: Request the OpenSSL 1.1 API
Pierre Pronchery [Thu, 25 May 2023 17:09:27 +0000 (19:09 +0200)]
dumpon: Request the OpenSSL 1.1 API

OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.

A future update may migrate to use the OpenSSL 3.0 APIs.

PR: 271615
Pull request: https://github.com/freebsd/freebsd-src/pull/757
Sponsored by: The FreeBSD Foundation

13 months agonetlink: use netlink mbufs in the mbuf chains.
Alexander V. Chernikov [Fri, 2 Jun 2023 13:04:03 +0000 (13:04 +0000)]
netlink: use netlink mbufs in the mbuf chains.

Continue D40356 and switch the remaining parts of mbuf-related
code to the Netlink mbufs.

Reviewed By: gallatin
Differential Revision: https://reviews.freebsd.org/D40368
MFC after: 2 weeks

13 months agonlsysevent: add default command to the events
Baptiste Daroussin [Fri, 2 Jun 2023 12:19:17 +0000 (14:19 +0200)]
nlsysevent: add default command to the events

13 months agonlsysevent: deduplicate the code and split into smaller functions
Baptiste Daroussin [Fri, 2 Jun 2023 08:19:27 +0000 (10:19 +0200)]
nlsysevent: deduplicate the code and split into smaller functions

No functional changes intended

Suggested by: melifaro

13 months agonlsysevent: rename variables for clarity of the code
Baptiste Daroussin [Fri, 2 Jun 2023 07:58:24 +0000 (09:58 +0200)]
nlsysevent: rename variables for clarity of the code

Suggested by: melifaro

13 months agonlsysevent: specify all netlink header the same way
Baptiste Daroussin [Fri, 2 Jun 2023 07:55:42 +0000 (09:55 +0200)]
nlsysevent: specify all netlink header the same way

13 months agogpart(8): Improve manual page syntax
Tom Hukins [Fri, 2 Jun 2023 02:41:28 +0000 (20:41 -0600)]
gpart(8): Improve manual page syntax

Fix various warnings from `mandoc -Tlint lib/geom/part/gpart.8`.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agogpart(8): Refer to a related manual page
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
gpart(8): Refer to a related manual page

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agocamcontrol(8): Use simpler language
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
camcontrol(8): Use simpler language

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agocamcontrol(8): Add manual page cross references
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
camcontrol(8): Add manual page cross references

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agocam(3): Add a manual page cross reference
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
cam(3): Add a manual page cross reference

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agoports(7): '*-list' targets: Add/fix doc on whether they are recursive
Olivier Certner [Fri, 2 Jun 2023 02:36:54 +0000 (20:36 -0600)]
ports(7): '*-list' targets: Add/fix doc on whether they are recursive

Signed-off-by: Olivier Certner <olce.freebsd@certner.fr>
Reviewed-by: imp
Pull-request: https://github.com/freebsd/freebsd-src/pull/691

13 months agomfiuitl: Spell acquire correctly
Warner Losh [Thu, 1 Jun 2023 23:49:41 +0000 (17:49 -0600)]
mfiuitl: Spell acquire correctly

13 months agozfsd: Fix typo in comment
Elyes Haouas [Fri, 3 Mar 2023 10:58:17 +0000 (11:58 +0100)]
zfsd: Fix typo in comment

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoiovctl: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:53:33 +0000 (07:53 +0100)]
iovctl: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agofstyp: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:53:13 +0000 (07:53 +0100)]
fstyp: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomfiutil: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:52:47 +0000 (07:52 +0100)]
mfiutil: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomakefs: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:35 +0000 (17:41 -0600)]
makefs: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomld6query: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
mld6query: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoefidp: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
efidp: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocron/lib: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
cron/lib: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agofsck_ffs: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
fsck_ffs: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomountd: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
mountd: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoipfw/ipfw2: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
ipfw/ipfw2: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoroute6d: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
route6d: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocdcontrol: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
cdcontrol: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobsnmpd/modules/snmp_lm75: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
bsnmpd/modules/snmp_lm75: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agorpc.lockd: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
rpc.lockd: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agowlandebug: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
wlandebug: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoipf: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
ipf: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoifconfig: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
ifconfig: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocamcontrol: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
camcontrol: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agonvmecontrol: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
nvmecontrol: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoipf/ipfstat: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
ipf/ipfstat: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agolpr: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
lpr: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agohastd: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
hastd: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocxgbetool: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
cxgbetool: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobsnmpd/tools/libbsnmptools: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
bsnmpd/tools/libbsnmptools: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agopmcstat: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
pmcstat: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobsnmpd/modules/snmp_hostres: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:31 +0000 (17:41 -0600)]
bsnmpd/modules/snmp_hostres: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobsnmpd/modules/snmp_bridge: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:31 +0000 (17:41 -0600)]
bsnmpd/modules/snmp_bridge: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobluetooth: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:31 +0000 (17:41 -0600)]
bluetooth: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobhyve: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:31 +0000 (17:41 -0600)]
bhyve: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoipf/libipf: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:30 +0000 (17:41 -0600)]
ipf/libipf: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agodumpon: update OpenSSL initialization call
Ed Maste [Wed, 31 May 2023 16:25:58 +0000 (12:25 -0400)]
dumpon: update OpenSSL initialization call

ERR_load_crypto_strings() was deprecated in OpenSSL 1.1.0, and explicit
initialization is generally not reqiured.  In the case of dumpon however
we initialize prior to entering capability mode, so replace with an
OPENSSL_init_crypto call.

Reviewed by: def, Pierre Pronchery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40353

13 months agontp: Update version string
Cy Schubert [Thu, 1 Jun 2023 21:40:00 +0000 (14:40 -0700)]
ntp: Update version string

Chase a466cc55373f, updating the version string in the local config.h.

Reported by:  Trond Endrestol <Trond.Endrestol@ximalas.info>
Fixes: a466cc55373f
MFC after: immediately

13 months agocpuset(3): Add unit tests
Baptiste Daroussin [Thu, 1 Jun 2023 21:26:57 +0000 (23:26 +0200)]
cpuset(3): Add unit tests

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

13 months agocron: fix build without LOGIN_CAP
Eric van Gyzen [Thu, 1 Jun 2023 21:23:29 +0000 (16:23 -0500)]
cron: fix build without LOGIN_CAP

Fixes: fe590ffe40f49fe09d8275fbf29f0d46c5b99dc7
MFC after: on demand
Sponsored by: Dell EMC Isilon

13 months agosysarch: Add includes required for ktrcapfail() calls to be compiled
Mark Johnston [Thu, 1 Jun 2023 21:13:09 +0000 (17:13 -0400)]
sysarch: Add includes required for ktrcapfail() calls to be compiled

Reported by: jfree
MFC after: 1 week

13 months agoktrace: Make the data lengths table const
Mark Johnston [Thu, 1 Jun 2023 21:12:42 +0000 (17:12 -0400)]
ktrace: Make the data lengths table const

No functional change intended.

MFC after: 1 week

13 months agosignal: Make the signal disposition table const
Mark Johnston [Thu, 1 Jun 2023 21:11:55 +0000 (17:11 -0400)]
signal: Make the signal disposition table const

No functional change intended.

MFC after: 1 week

13 months agoktrace: Make sys/ktrace.h self-contained
Mark Johnston [Thu, 1 Jun 2023 21:10:44 +0000 (17:10 -0400)]
ktrace: Make sys/ktrace.h self-contained

MFC after: 2 weeks

13 months agocpuset(3): Move cpuset's parselist function into libutil
Baptiste Daroussin [Thu, 1 Jun 2023 21:16:01 +0000 (23:16 +0200)]
cpuset(3): Move cpuset's parselist function into libutil

In order to allow to add cpuset(2) functionality to more utilities than just
 cpuset(1) move the parselist code into libutil

While here, make the code a little more "library" friendly, by returning a range
of various errors so that the consumer can check for them and report appropriate
error message to the users

(One of the planed usage is the jail(8) utility)

Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D12873

13 months agonlsysevent: add a genetlink(4) module to report kernel events
Baptiste Daroussin [Thu, 1 Jun 2023 21:02:06 +0000 (23:02 +0200)]
nlsysevent: add a genetlink(4) module to report kernel events

Hooked to devctl_notify, this allows consumers to received events
by subscribing to a system over a generic netlink protocol

Reviewed by: imp, melifaro
Differential Revision: https://reviews.freebsd.org/D37574

13 months agodevctl: allow to register a hook to receive the events
Baptiste Daroussin [Thu, 1 Jun 2023 21:01:40 +0000 (23:01 +0200)]
devctl: allow to register a hook to receive the events

In preparation for netlink sysvent add a function that allow
registering a function to hook the events and also send it via
another kernel module (nlsysvent will be that module).

Prepare a static list of known existing events in the kernel that
will be used to prepopulate nlsysvent multicast group (one per event)

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D37573

13 months agobsdinstall: remove sendmail hardening option
Baptiste Daroussin [Thu, 1 Jun 2023 20:37:06 +0000 (22:37 +0200)]
bsdinstall: remove sendmail hardening option

sendmail is fully disabled in 14.0 by default

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D40367

13 months agonfsuserd.8: Substitute server for slave terminology
Rick Macklem [Thu, 1 Jun 2023 20:49:04 +0000 (13:49 -0700)]
nfsuserd.8: Substitute server for slave terminology

Commit 33906122e1ff replaced the use of "slave" with "server"
for nfsuserd.c.  This patch does the same for nfsuserd.8.

Discussed with: karels
Differential Revision: https://reviews.freebsd.org/D39877

13 months agorpc.tls[serv|clnt]d.c: Clean up code for OpenSSL3
Rick Macklem [Thu, 1 Jun 2023 20:43:00 +0000 (13:43 -0700)]
rpc.tls[serv|clnt]d.c: Clean up code for OpenSSL3

There were several function calls that are deprecated for
OpenSSL1.1.1.  These have been removed.
There was also a function call deprecated for OpenSSL3 and
that one has been #ifdef'd on OPENSSL_VERSION_NUMBER.

Reviewed by: emaste, ngie
Differential Revision: https://reviews.freebsd.org/D40275

13 months agoImport vixie cron 4.0
Eric van Gyzen [Thu, 1 Jun 2023 19:14:07 +0000 (14:14 -0500)]
Import vixie cron 4.0

Specifically, import the diff from commit e745bd4c10ab to
commit 83563783cc2 in https://github.com/vixie/cron.git

My sole motivation is changing to the common MIT license.
The old license, especially the "buildable source" clause,
is unfriendly for commercial users of this code.  Simply
changing the license without importing [most of] the code
accompanying that license seemed legally dubious.

The most regrettable change is losing Paul's uucp path.
I partially atone for this loss by restoring the upstream
$Id$ tags, since $FreeBSD$ is no longer useful.

This is [intended to be] a complete list of the functional
changes in this commit.  Some changes were made so that we
could consider vixie cron to be our upstream and reduce our
diffs against it, while others were simply a good idea.

- main() - use putenv instead of setenv for PATH
- open_pidfile no longer needs snprintf to build pidfile
- crontab main() - abort() on impossible errors
- check for truncation when building strings with snprintf
- getdtablesize() -> sysconf(_SC_OPEN_MAX)

These changes were not taken from upstream's 4.0 diff because
they [could] actually change behavior.  Some of them might be
beneficial, but should be taken separately.

- config.h - sendmail args: remove -oi and add -or0s
- call setlocale(LC_ALL, "") at the top of main()
- acquire_daemonlock - we already use pidfile
- cast getpid(), uid_t, and gid_t to long for printf
- remove unnecessary braces - I consider them beneficial
- BSDi support
- glue_strings() - use snprintf(), as we often already did

MFC after: on demand
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D40260

13 months agolibpmc: expand PMC_OP* defines
Mitchell Horne [Thu, 1 Jun 2023 18:19:22 +0000 (15:19 -0300)]
libpmc: expand PMC_OP* defines

When performing the syscall, specify the full name of the desired
operation. This improves grep-ability.

No functional change.

Reviewed by: jkoshy
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40334

13 months agocc_cubic: Use units of micro seconds (usecs) instead of ticks in rtt.
Cheng Cui [Thu, 1 Jun 2023 11:48:07 +0000 (07:48 -0400)]
cc_cubic: Use units of micro seconds (usecs) instead of ticks in rtt.

This improves TCP friendly cwnd in cases of low latency high drop rate
networks. Tests show +42% and +37% better performance in 1Gpbs and 10Gbps
cases.

Reported by: Bhaskar Pardeshi from VMware.
Reviewed By: rscheff, tuexen
Approved by: rscheff (mentor), tuexen (mentor)

13 months agontp: import ntp-4.2.8p16
Cy Schubert [Thu, 1 Jun 2023 14:04:37 +0000 (07:04 -0700)]
ntp: import ntp-4.2.8p16

Security:       NtpBUg3767, NtpBug3808, NtpBug3807 (CVE-2023-26555)
MFC after: immediately

13 months agontp: import ntp-4.2.8p16
Cy Schubert [Thu, 11 May 2023 18:17:53 +0000 (11:17 -0700)]
ntp: import ntp-4.2.8p16

Security: NtpBug3767, NtpBug3808, NtpBug3807 (CVE-2023-26555)

13 months agonetinet6: make IPv6 fragment TTL per-VNET configurable.
Alexander V. Chernikov [Thu, 1 Jun 2023 12:04:49 +0000 (12:04 +0000)]
netinet6: make IPv6 fragment TTL per-VNET configurable.

Having it configurable adds more flexibility, especially
 for the systems with low amount of memory.
Additionally, it allows to speedup frag6/ tests execution.

Reviewed by: kp, markj, bz
Differential Revision: https://reviews.freebsd.org/D35755
MFC after: 2 weeks

13 months agoifconfig: fix warnings #2
Alexander V. Chernikov [Thu, 1 Jun 2023 11:54:02 +0000 (11:54 +0000)]
ifconfig: fix warnings #2

Fix all -Wparameter-unused and cast alignment

Differential Revision: https://reviews.freebsd.org/D40303
MFC after: 2 weeks

13 months agoifnet: consistently call hooks when the interface gets up.
Alexander V. Chernikov [Thu, 1 Jun 2023 11:44:15 +0000 (11:44 +0000)]
ifnet: consistently call hooks when the interface gets up.

Some context on the current IPv6 interface setup & address management:

There are two data path for IPv6 initialisation in context of assigning
 LL addresses:
1) Userland explicitly requests IFF_UP for the interface w/o any addresses.
if_up() then calls in6_if_up(), which calls in6_ifattach().
The latter sets up some initial ND/IN6 state and disables IPv6 for the
interface if it’s not loopback. If the interface is loopback, then it
adds ::1/128 and LL addresses via in6_ifattach_loopback().
Then, devd notification is generated (if the VNET is the default one),
which triggers rc.network ifconfig_up(), causing ifdisabled to be removed
via SIOCSIFINFO_IN6 from ifconfig. The kernel SIOCSIFINFO_IN6 handler
calls in6_if_up() once again and it assigns the interface link-local address.

2) Userland adds IPv4 or IPv6 address to the interface. SIOCAIFADDR[_IN6]
kernel handler calls IPv4/IPv6 protocol handler to add the address.
Both then call if_ioctl() with SIOCSIFADDR. Ethernet/loopback ioctl handlers
silently sets IFF_UP for the interface. Finally, if.c:ifioctl() wrapper code
compares old and new interface flags and, if IFF_UP is added, it explicitly
calls in6_if_up(), which adds link-local address if either the original
address is IPv6 or the interface is loopback.

In the latter case, “formal” interface-up notifications are missing.
The kernel does not trigger event handler event, does not call carp hook
and does not provide any userland notification.

This diff unifies the event handling in both scenarios, providing the
necessary notifications to the kernel and userland.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40332
MFC after: 2 weeks

13 months agonetlink: add support for decoding genl ops/groups in pytest
Alexander V. Chernikov [Thu, 1 Jun 2023 10:45:29 +0000 (10:45 +0000)]
netlink: add support for decoding genl ops/groups in pytest

MFC after: 2 weeks

13 months agobridge: fix lookup for untagged packets in bridge_transmit()
Ben Wilber [Thu, 1 Jun 2023 09:29:36 +0000 (11:29 +0200)]
bridge: fix lookup for untagged packets in bridge_transmit()

b0e38a1373 improved if_bridge's ability to cope with different VLANs,
but it failed to update bridge_transmit() to cope with the new rule that
untagged packets are treated as having VLAN ID 0 (rather than 1, as used
to be the case).

Fix that oversight.

PR: 270559
Reviewed by: kp

13 months agonetlink: use custom uma zone for the mbuf storage.
Alexander V. Chernikov [Wed, 31 May 2023 18:02:49 +0000 (18:02 +0000)]
netlink: use custom uma zone for the mbuf storage.

Netlink communicates with userland via sockets, utilising
 MCLBYTES-sized mbufs to append data to the socket buffers.
These mbufs are never transmitted via logical or physical network.

It may be possible that the 2k mbuf zone is temporary exhausted
 due to the DDoS-style traffic, leading to Netlink failure to
 respond to the requests.

To address it, this change introduces a custom Netlink-specific
 zone for the mbuf storage. It has the following benefits:
* no precious memory from UMA_ZONE_CONTIG zones is utilized for Netlink
* Netlink becomes (more) independent from the traffic spikes and
 other related network "corner" conditions.
* Netlink allocations are now isolated within a specific zone, making it
 easier to track Netlink mbuf usage and attribute mbufs.

Reviewed by: gallatin, adrian
Differential Revision: https://reviews.freebsd.org/D40356
MFC after: 2 weeks

13 months agotcp: Refactor tcp_get_srtt()
Jonathan T. Looney [Wed, 31 May 2023 19:16:20 +0000 (19:16 +0000)]
tcp: Refactor tcp_get_srtt()

Refactor tcp_get_srtt() into its two component operations: unit
conversion and shifting. No functional change is intended.

Reviewed by: cc, tuexen
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40304

13 months agodecryptcore: add OPENSSL_INIT_LOAD_CONFIG to init call
Ed Maste [Wed, 31 May 2023 16:59:39 +0000 (12:59 -0400)]
decryptcore: add OPENSSL_INIT_LOAD_CONFIG to init call

Reported by: def
Reviewed by: Pierre Pronchery
Sponsored by: The FreeBSD Foundation

13 months agodecryptcore: update for OpenSSL 1.1 API
Ed Maste [Wed, 31 May 2023 14:17:52 +0000 (10:17 -0400)]
decryptcore: update for OpenSSL 1.1 API

ERR_load_crypto_strings is deprecated in OpenSSL 1.1, and OpenSSL 1.1
generally does not require explicit initialization.  However, we do need
to ensure that initialization is done before entering capability mode so
call OPENSSL_init_crypto instead.  Also include header needed for
ERR_error_string.

Reviewed by: vangyzen
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40343

13 months agopf: fix pf_nv##_array() size check
Kristof Provost [Mon, 15 May 2023 17:40:32 +0000 (19:40 +0200)]
pf: fix pf_nv##_array() size check

We want to set the maximum number of elements we'll accept, not the
exact number we need.

MFC after: 3 weeks
Sponsored by: Orange Business Services

13 months agotap(4): allow full-duplex and non-zero speed
Alexandre Snarskii [Wed, 31 May 2023 15:50:00 +0000 (09:50 -0600)]
tap(4): allow full-duplex and non-zero speed

tap(4) devices advertise themselves as just 'ethernet autoselect',
without duplex or speed capabilities.
This advertisement makes them unable to be aggregated into lacp-based
lagg(4):
- lacp code requires underlying interfaces to be full-duplex, else
  interface will not participate in lacp at all
- lacp code requires underlying interface to have non-zero speed, else
  this interface can not be selected as active aggregator

PR: 217374
Reported-by: Alexandre Snarskii <snar@snar.spb.ru>
Co-authored-by: Mina Galić <freebsd@igalic.co>
Reviewed-by: imp,karles
Pull-request: https://github.com/freebsd/freebsd-src/pull/745

13 months agogicv3: Use an offset to find the redist registers
Andrew Turner [Thu, 25 May 2023 08:22:03 +0000 (09:22 +0100)]
gicv3: Use an offset to find the redist registers

To find the redistributor registers use the resource we have already
found and add an offset. This removed the need to create a
per-redistributor resource as it can now be a pointer to the resource
found in attach.

While here check the offset is within the bounds of the resource. Some
ACPI tables list each redistributor as a separate memory range, even
if they are physically contiguous. In this case we may not have each
resource virtually contiguous with neighbouring resources. This can
lead to a data abort when reading past the resource range.

Reviewed by: kevans
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40263

13 months agolibunbound: Request the OpenSSL 1.1 API
Pierre Pronchery [Thu, 25 May 2023 05:34:44 +0000 (07:34 +0200)]
libunbound: Request the OpenSSL 1.1 API

OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.

A future update may migrate to use the OpenSSL 3.0 APIs.

PR: 271615
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

13 months agonetlink: fix ifconfig P2P inet ADDR ADDR netmask 255.255.255.255 addition
Alexander V. Chernikov [Wed, 31 May 2023 09:58:15 +0000 (09:58 +0000)]
netlink: fix ifconfig P2P inet ADDR ADDR netmask 255.255.255.255 addition

Adding P2P addresses is complex in both ioctl and Netlink.
In the ioctl interface, "broadcast" field is the same field as the
"peer". In is possible to specify non-p2p address for the p2p
 interface in IPv6, but not in IPv4.
In the Netlink interface, "address" field means "peer" address.
As a result, a common notion for the Netlink users is to submit
 same address/peer for non-P2P interfaces.

This change customises mapping the attribute on per-family basis.
Specifically,
for IPv4 - if the interface is P2P, assume "address" is p2p and
 "local" is the address. If the interfase is non-p2p, use "local"
 attribute as the address. If it's not set, use "address" attribute.
for IPv6 - start with "local" attribute as the address. If it's not set,
 use use "address" attribute. If both are set and both are the same,
 assume non p2p, otherwise add as p2p.

MFC after: 2 weeks
Reported by: jkim

13 months agonetinet*: Fix redirects for connections from localhost
Doug Rabson [Wed, 24 May 2023 13:11:37 +0000 (14:11 +0100)]
netinet*: Fix redirects for connections from localhost

Redirect rules use PFIL_IN and PFIL_OUT events to allow packet filter
rules to change the destination address and port for a connection.
Typically, the rule triggers on an input event when a packet is received
by a router and the destination address and/or port is changed to
implement the redirect. When a reply packet on this connection is output
to the network, the rule triggers again, reversing the modification.

When the connection is initiated on the same host as the packet filter,
it is initially output via lo0 which queues it for input processing.
This causes an input event on the lo0 interface, allowing redirect
processing to rewrite the destination and create state for the
connection. However, when the reply is received, no corresponding output
event is generated; instead, the packet is delivered to the higher level
protocol (e.g. tcp or udp) without reversing the redirect, the reply is
not matched to the connection and the packet is dropped (for tcp, a
connection reset is also sent).

This commit fixes the problem by adding a second packet filter call in
the input path. The second call happens right before the handoff to
higher level processing and provides the missing output event to allow
the redirect's reply processing to perform its rewrite. This extra
processing is disabled by default and can be enabled using pfilctl:

pfilctl link -o pf:default-out inet-local
pfilctl link -o pf:default-out6 inet6-local

PR: 268717
Reviewed-by: kp, melifaro
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40256

13 months agounbound: avoid calling deprecated OpenSSL function
Ed Maste [Tue, 30 May 2023 18:28:44 +0000 (14:28 -0400)]
unbound: avoid calling deprecated OpenSSL function

SSL_CTX_set_ecdh_auto is deprecated and has no effect (for reference see
https://github.com/openssl/openssl/commit/2ecb9f2d18614fb7b7b42830a358b7163ed43221).

As unbound's config.h is manually maintained just turn off
HAVE_DECL_SSL_CTX_SET_ECDH_AUTO so that the deprecated function won't
be called.

Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40341

13 months agopmc: Bump major version for just-committed breaking changes
Jessica Clarke [Tue, 30 May 2023 23:23:36 +0000 (00:23 +0100)]
pmc: Bump major version for just-committed breaking changes

Reviewed by: jkoshy, mhorne, emaste
Differential Revision: https://reviews.freebsd.org/D40050

13 months agopmc: Rework PROCEXEC event to support PIEs
Jessica Clarke [Tue, 30 May 2023 23:20:36 +0000 (00:20 +0100)]
pmc: Rework PROCEXEC event to support PIEs

Currently the PROCEXEC event only reports a single address, entryaddr,
which is the entry point of the interpreter in the typical dynamic case,
and used solely to calculate the base address of the interpreter. For
PDEs this is fine, since the base address is known from the program
headers, but for PIEs the base address varies at run time based on where
the kernel chooses to load it, and so pmcstat has no way of knowing the
real address ranges for the executable. This was less of an issue in the
past since PIEs were rare, but now they're on by default on 64-bit
architectures it's more of a problem.

To solve this, pass through what was picked for et_dyn_addr by the
kernel, and use that as the offset for the executable's start address
just as is done for everything in the kernel. Since we're changing this
interface, sanitise the way we determine the interpreter's base address
by passing it through directly rather than indirectly via the entry
point and having to subtract off whatever the ELF header's e_entry is
(and anything that wants the entry point in future can still add that
back on as needed; this merely changes the interface to directly provide
the underlying variables involved).

This will be followed up by a bump to the pmc major version.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D39595

13 months agoimgact: Make et_dyn_addr part of image_params
Jessica Clarke [Tue, 30 May 2023 23:15:43 +0000 (00:15 +0100)]
imgact: Make et_dyn_addr part of image_params

This already gets passed around between various imgact_elf functions, so
moving it removes an argument from all those places. A future commit
will make use of this for hwpmc, though, to provide the load base for
PIEs, which currently isn't available to tools like pmcstat.

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

13 months agopmc: Provide full path to modules from kernel linker
Jessica Clarke [Tue, 30 May 2023 23:15:34 +0000 (00:15 +0100)]
pmc: Provide full path to modules from kernel linker

This unifies the user object and kernel module paths in libpmcstat,
allows modules loaded from non-standard locations (e.g. from a user's
home directory when testing) to be found and, since buffer is what all
the warnings here use (they were never updated when buffer_modules were
added to pick based on where the file was found) has the side-effect of
ensuring the messages are correct.

This includes obsoleting the now-superfluous -k option in pmcstat.

This change breaks the hwpmc ABI and will be followed by a bump to the
pmc major version.

Reviewed by: jhb, jkoshy, mhorne
Differential Revision: https://reviews.freebsd.org/D40048

13 months agopmc: Initialise and check the pm_flags field for CONFIGURELOG
Jessica Clarke [Tue, 30 May 2023 23:15:24 +0000 (00:15 +0100)]
pmc: Initialise and check the pm_flags field for CONFIGURELOG

Whilst the former is not breaking, the latter is, and so this will be
followed by a bump to the pmc major version. This will allow the flags
to actually be usable in future, as otherwise we cannot distinguish
uninitialised stack junk from a deliberately-initialised value.

Reviewed by: jhb, mhorne
Differential Revision: https://reviews.freebsd.org/D40049

13 months agohier(7): alphabetical order
Graham Perrin [Tue, 30 May 2023 19:30:20 +0000 (20:30 +0100)]
hier(7): alphabetical order

Approved by:  mhorne
Pull request: https://github.com/freebsd/freebsd-src/pull/756

13 months agoinpcb: Restore missing validation of local addresses for jailed sockets
Mark Johnston [Tue, 30 May 2023 19:15:48 +0000 (15:15 -0400)]
inpcb: Restore missing validation of local addresses for jailed sockets

When looking up a listening socket, the SMR-protected lookup routine may
return a jailed socket with no local address.  This happens when using
classic jails with more than one IP address; in a single-IP classic
jail, a bound socket's local address is always rewritten to be that of
the jail.

After commit 7b92493ab1d4, the lookup path failed to check whether the
jail corresponding to a matched wildcard socket actually owns the
address, and would return the match regardless.  Restore the omitted
checks.

Fixes: 7b92493ab1d4 ("inpcb: Avoid inp_cred dereferences in SMR-protected lookup")
Reported by: peter
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D40268

13 months agobuf: Make the number of pbufs slightly more dynamic
Mark Johnston [Tue, 30 May 2023 19:11:32 +0000 (15:11 -0400)]
buf: Make the number of pbufs slightly more dynamic

Various subsystems pre-allocate a set of pbufs, allocated to implement
I/O operations.  pbuf allocations are transient, unlike most buf
allocations.

Most subsystems preallocate nswbuf or nswbuf/2 pbufs each.  The
preallocation ensures that pbuf allocation will succeed in low memory
conditions, which might help avoid deadlocks.  Currently we initialize
nswbuf = min(nbuf / 4, 256).

nbuf/4 > 256 on anything but the smallest systems.  For example,
nswbuf is 256 in a VM with 128MB of memory.  In this configuration, a
firecracker VM with one CPU preallocates over 900 pbufs.  This consumes
2MB of RAM and adds several milliseconds to the kernel's (very small)
boot time.

Scale nswbuf by ncpu in the common case.  I think this makes more sense
than scaling by the amount of RAM, since pbuf allocations are transient
and aren't used for caching.  With the change, we get nswbuf=256 with 8
CPUs.  With fewer than 8 CPUs we'll preallocate fewer pbufs than before,
and with more we'll preallocate more.

Event: BSDCan 2023
Reported by: cperciva
Reviewed by: glebius, kib
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D40216

13 months agosiftr: bring back the siftr_pkts_per_log feature
Cheng Cui [Tue, 30 May 2023 11:02:45 +0000 (07:02 -0400)]
siftr: bring back the siftr_pkts_per_log feature

Summary: this missing feature is introduced by commit aa61cff4249c

Test Plan: verified in Emulab.net

Reviewers: rscheff, tuexen
Approved by: tuexen (mentor)
Subscribers: imp, melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D40336

13 months agoOpenSSL: Merge OpenSSL 1.1.1u
Jung-uk Kim [Tue, 30 May 2023 15:14:28 +0000 (11:14 -0400)]
OpenSSL: Merge OpenSSL 1.1.1u

13 months agodtrace: deduplicate some RISC-V functions
Christos Margiolis [Tue, 30 May 2023 15:07:18 +0000 (18:07 +0300)]
dtrace: deduplicate some RISC-V functions

match_opcode() is defined in FBT, kinst, and dtrace_subr.c. The function
prologue-checking functions are defined in FBT and kinst.

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40335

13 months agoOpenSSL: Regen manual pages for OpenSSL 1.1.1u
Jung-uk Kim [Tue, 30 May 2023 15:03:10 +0000 (11:03 -0400)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1u

13 months agoOpenSSL: Merge OpenSSL 1.1.1u
Jung-uk Kim [Tue, 30 May 2023 14:24:15 +0000 (10:24 -0400)]
OpenSSL: Merge OpenSSL 1.1.1u

(cherry picked from commit 8ecb489345f08012fdc92a202a40119891cac330)