Commit Graph

284114 Commits

Author SHA1 Message Date
Elyes Haouas
e095cbab2f 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
2023-06-01 20:33:39 -06:00
Elyes Haouas
05d85d7781 lpr: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
2023-06-01 20:33:39 -06:00
Elyes Haouas
136a9bb4e3 hastd: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
2023-06-01 20:33:39 -06:00
Elyes Haouas
34181db8bc cxgbetool: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
2023-06-01 20:33:39 -06:00
Elyes Haouas
8b223768d1 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
2023-06-01 20:33:39 -06:00
Elyes Haouas
b8b97d31bd pmcstat: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
2023-06-01 20:33:39 -06:00
Elyes Haouas
de8b490010 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
2023-06-01 20:33:39 -06:00
Elyes Haouas
8c9946be52 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
2023-06-01 20:33:38 -06:00
Elyes Haouas
66ebda7a04 bluetooth: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
2023-06-01 20:33:38 -06:00
Elyes Haouas
0dc159ced7 bhyve: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
2023-06-01 20:33:38 -06:00
Elyes Haouas
0939cf32c0 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
2023-06-01 20:33:38 -06:00
Ed Maste
79d4d7133f 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
2023-06-01 21:21:23 -04:00
Cy Schubert
4d78061377 ntp: Update version string
Chase a466cc5537, updating the version string in the local config.h.

Reported by:	 Trond Endrestol <Trond.Endrestol@ximalas.info>
Fixes:		a466cc5537
MFC after:	immediately
2023-06-01 14:50:22 -07:00
Baptiste Daroussin
8093646b0b cpuset(3): Add unit tests
Differential Revision:	https://reviews.freebsd.org/D13046
2023-06-01 23:27:45 +02:00
Eric van Gyzen
aee3ee66a1 cron: fix build without LOGIN_CAP
Fixes:		fe590ffe40
MFC after:	on demand
Sponsored by:	Dell EMC Isilon
2023-06-01 16:24:22 -05:00
Mark Johnston
18282c4772 sysarch: Add includes required for ktrcapfail() calls to be compiled
Reported by:	jfree
MFC after:	1 week
2023-06-01 17:18:23 -04:00
Mark Johnston
3080f82b8b ktrace: Make the data lengths table const
No functional change intended.

MFC after:	1 week
2023-06-01 17:18:23 -04:00
Mark Johnston
0d3f1b4f25 signal: Make the signal disposition table const
No functional change intended.

MFC after:	1 week
2023-06-01 17:18:23 -04:00
Mark Johnston
c8a3833968 ktrace: Make sys/ktrace.h self-contained
MFC after:	2 weeks
2023-06-01 17:18:23 -04:00
Baptiste Daroussin
04eeb364d4 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
2023-06-01 23:16:01 +02:00
Baptiste Daroussin
8a2af0b469 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
2023-06-01 23:02:06 +02:00
Baptiste Daroussin
afbb26b58b 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
2023-06-01 23:01:40 +02:00
Baptiste Daroussin
fe06db1817 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
2023-06-01 23:00:22 +02:00
Rick Macklem
c21438cd14 nfsuserd.8: Substitute server for slave terminology
Commit 33906122e1 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
2023-06-01 13:49:04 -07:00
Rick Macklem
88ea962879 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
2023-06-01 13:43:00 -07:00
Eric van Gyzen
fe590ffe40 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
2023-06-01 14:14:07 -05:00
Mitchell Horne
be75e57854 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
2023-06-01 15:20:13 -03:00
Cheng Cui
a3aa6f6529
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)
2023-06-01 07:55:01 -04:00
Cy Schubert
a466cc5537 ntp: import ntp-4.2.8p16
Security:       NtpBUg3767, NtpBug3808, NtpBug3807 (CVE-2023-26555)
MFC after:	immediately
2023-06-01 07:04:37 -07:00
Cy Schubert
26fd3d5616 ntp: import ntp-4.2.8p16
Security:	NtpBug3767, NtpBug3808, NtpBug3807 (CVE-2023-26555)
2023-06-01 06:28:01 -07:00
Alexander V. Chernikov
e32221a15f 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
2023-06-01 12:04:49 +00:00
Alexander V. Chernikov
0c2beef72d ifconfig: fix warnings #2
Fix all -Wparameter-unused and cast alignment

Differential Revision: https://reviews.freebsd.org/D40303
MFC after:	2 weeks
2023-06-01 11:54:25 +00:00
Alexander V. Chernikov
a77facd273 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
2023-06-01 11:44:19 +00:00
Alexander V. Chernikov
54b955f4df netlink: add support for decoding genl ops/groups in pytest
MFC after:	2 weeks
2023-06-01 10:45:29 +00:00
Ben Wilber
fd7edfcdc3 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
2023-06-01 11:31:59 +02:00
Alexander V. Chernikov
d187154750 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
2023-06-01 06:43:39 +00:00
Jonathan T. Looney
4f2cc73f34 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
2023-05-31 19:16:20 +00:00
Ed Maste
eb2b00da56 decryptcore: add OPENSSL_INIT_LOAD_CONFIG to init call
Reported by:	def
Reviewed by:	Pierre Pronchery
Sponsored by:	The FreeBSD Foundation
2023-05-31 13:00:57 -04:00
Ed Maste
8e7a31b65f 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
2023-05-31 12:20:34 -04:00
Kristof Provost
76c8f202a4 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
2023-05-31 18:07:58 +02:00
Alexandre Snarskii
0ec220df52 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
2023-05-31 09:53:48 -06:00
Andrew Turner
ae16cbfdd2 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
2023-05-31 15:10:41 +01:00
Pierre Pronchery
aa4cf5647c 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
2023-05-31 10:05:07 -04:00
Alexander V. Chernikov
4e9a97de01 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
2023-05-31 10:38:38 +00:00
Doug Rabson
5ab151574c 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
2023-05-31 11:11:05 +01:00
Ed Maste
dc10368634 unbound: avoid calling deprecated OpenSSL function
SSL_CTX_set_ecdh_auto is deprecated and has no effect (for reference see
2ecb9f2d18).

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
2023-05-30 19:55:55 -04:00
Jessica Clarke
d6f00fa046 pmc: Bump major version for just-committed breaking changes
Reviewed by:	jkoshy, mhorne, emaste
Differential Revision:	https://reviews.freebsd.org/D40050
2023-05-31 00:23:36 +01:00
Jessica Clarke
94426d21bf 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
2023-05-31 00:20:36 +01:00
Jessica Clarke
659a0041dd 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
2023-05-31 00:15:43 +01:00
Jessica Clarke
53d0b9e438 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
2023-05-31 00:15:34 +01:00