]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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)

13 months agovfs cache: restore sorted order of CACHE_FPL_SUPPORTED_CN_FLAGS
Mateusz Guzik [Tue, 30 May 2023 13:17:45 +0000 (13:17 +0000)]
vfs cache: restore sorted order of CACHE_FPL_SUPPORTED_CN_FLAGS

13 months agoCirrus-CI: add amd64 and arm64 Clang/LLVM 16 jobs
Ed Maste [Fri, 26 May 2023 12:14:51 +0000 (08:14 -0400)]
Cirrus-CI: add amd64 and arm64 Clang/LLVM 16 jobs

Reviewed by: lwhsu (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40286

13 months agoCirrus-CI: move arch and toolchain to beginning of task names
Ed Maste [Fri, 26 May 2023 17:58:04 +0000 (13:58 -0400)]
Cirrus-CI: move arch and toolchain to beginning of task names

This is the key difference between the tasks, so make it the most
prominent.

Sponsored by: The FreeBSD Foundation

13 months agoamd64: zero-pad register dumps on panic
Mateusz Guzik [Tue, 23 May 2023 13:20:46 +0000 (13:20 +0000)]
amd64: zero-pad register dumps on panic

de gustibus and so on

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

13 months agosplit(1): add '-c' to continue creating files
Jan Schaumann [Tue, 30 May 2023 13:13:16 +0000 (16:13 +0300)]
split(1): add '-c' to continue creating files

Currently, split(1) will clobber any existing output files:

$ split file; ls
xaa xab xac xad
$ split second-file; ls
xaa xab xac xad xae xaf

This patch adds a flag "-c" (mnemonic "create, don't overwrite" or
"continue where you left off"):

$ split file; ls
xaa xab xac xad
$ split -c second-file; ls
xaa xab xac xad xae xaf xag xah xai xaj

Reviewed by: christos
Approved by: kevans
Different Revision: https://reviews.freebsd.org/D38553

13 months agosplit(1): auto-extend suffix length if required
Jan Schaumann [Tue, 30 May 2023 12:55:38 +0000 (15:55 +0300)]
split(1): auto-extend suffix length if required

If the input cannot be split into the number of files resulting from the
default suffix length, automatically extend the suffix length rather
than bailing out with 'too many files'.

Suffixes are extended such that the resulting files continue to sort
lexically and "cat *" would reproduce the input. For example, splitting
a 1M lines file into (default) 1000 lines per file would yield files
named 'xaa', 'xab', ..., 'xyy', 'xyz', 'xzaaa', 'xzaab', ..., 'xzanl'.

If '-a' is specified, the suffix length is not auto-extended.

This behavior matches GNU sort(1) since around version 8.16.

Reviewed by: christos
Approved by: kevans
Different Revision: https://reviews.freebsd.org/D38279

13 months agopfctl: Add missing state parameters in DIOCGETSTATESV2
Kajetan Staszkiewicz [Mon, 29 May 2023 19:35:58 +0000 (21:35 +0200)]
pfctl: Add missing state parameters in DIOCGETSTATESV2

Reviewed by: kp
Sponsored by: InnoGames GmbH
Different Revision: https://reviews.freebsd.org/D40259

13 months agopf: make contents of struct pfsync_state configurable
Kajetan Staszkiewicz [Mon, 29 May 2023 13:47:23 +0000 (15:47 +0200)]
pf: make contents of struct pfsync_state configurable

Make struct pfsync_state contents configurable by sending out new
versions of the structure in separate subheader actions. Both old and
new version of struct pfsync_state can be understood, so replication of
states from a system running an older kernel is possible. The version
being sent out is configured using ifconfig pfsync0 … version XXXX. The
version is an user-friendly string - 1301 stands for FreeBSD 13.1 (I
have checked synchronization against a host running 13.1), 1400 stands
for 14.0.

A host running an older kernel will just ignore the messages and count
them as "packets discarded for bad action".

Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D39392

13 months agosrc.conf.5: regen after readd of NETLINK option
Baptiste Daroussin [Tue, 30 May 2023 11:36:11 +0000 (13:36 +0200)]
src.conf.5: regen after readd of NETLINK option

13 months agogenl: add new command to list genetlink(4)
Baptiste Daroussin [Tue, 30 May 2023 11:31:04 +0000 (13:31 +0200)]
genl: add new command to list genetlink(4)

This commands list genetlink protocols and its operations and
capabilities

Name: nlctrl
ID: 0x10, Version: 00, header size: 2, max attributes: 10
supported operations:
 - ID: 0x3, Capabilities: 0xe (can modify; can get/dump;
has policy)
multicast groups:
 - ID: 0x30, Name: notify
Name: carp
ID: 0x11, Version: 00, header size: 2, max attributes: 2
supported operations:
 - ID: 0x1, Capabilities: 0xe (can modify; can get/dump;
has policy)
 - ID: 0x2, Capabilities: 0xb (requires admin permission;
can modify; has policy)

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D40330

13 months agosiftr: convert this tval.tv_sec to type intmax_t to print across platforms
Cheng Cui [Mon, 29 May 2023 20:17:29 +0000 (16:17 -0400)]
siftr: convert this tval.tv_sec to type intmax_t to print across platforms

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

13 months agoopen(2): fix typo
Konstantin Belousov [Tue, 30 May 2023 09:17:26 +0000 (12:17 +0300)]
open(2): fix typo

__aLC_aclcheck_fd -> acl_aclcheck_fd

Reported by: Peter Eriksson  <pen@lysator.liu.se>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

13 months agoavx_sig: Adapt avx_sig test for Aarch64
Dmitry Chagin [Tue, 30 May 2023 08:19:40 +0000 (11:19 +0300)]
avx_sig: Adapt avx_sig test for Aarch64

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40309

13 months agoavx_sig: Prepare to add arm64 neon test
Dmitry Chagin [Tue, 30 May 2023 08:18:57 +0000 (11:18 +0300)]
avx_sig: Prepare to add arm64 neon test

Move inlined asm code to a separate source and rename x86 specific xmm
names to more general simd names.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40312

13 months ago__acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors
Konstantin Belousov [Mon, 29 May 2023 15:07:18 +0000 (18:07 +0300)]
__acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors

PR: 271704
Reported by: Peter Eriksson  <pen@lysator.liu.se>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40318

13 months agoffs: restore backward compatibility of newfs and makefs with older binaries
Chuck Silvers [Tue, 30 May 2023 02:26:28 +0000 (19:26 -0700)]
ffs: restore backward compatibility of newfs and makefs with older binaries

The previous change to CGSIZE had the unintended side-effect of allowing
newfs and makefs to create file systems that would fail validation when
examined by older commands and kernels, by allowing newfs/makefs to pack
slightly more blocks into a CG than those older binaries think is valid.
Fix this by having newfs/makefs artificially restrict the number of blocks
in a CG to the slightly smaller value that those older binaries will accept.
The validation code will continue to accept the slightly larger value
that the current newfs/makefs (before this change) could create.

Fixes: 0a6e34e950cd5889122a199c34519b67569be9cc
Reviewed by: mckusick
MFC after: 3 days
Sponsored by: Netflix

13 months agoreapkill: handle possible pid reuse after the pid was recorded as signalled
Konstantin Belousov [Fri, 12 May 2023 22:36:52 +0000 (01:36 +0300)]
reapkill: handle possible pid reuse after the pid was recorded as signalled

Nothing prevents the signalled process from exiting, and then other
process among eligible for signalling to reuse the exited process pid.
In this case, presence of the pid in the 'pids' unr set prevents it from
getting the deserved signal.

Handle it by marking each process with the new flag P2_REAPKILLED when
we are about to send the signal.  If the process pid is present in the
pids unr, but the struct proc is not marked with P2_REAPKILLED, we must
send signal to the pid again.

The use of the flag relies on the global sapblk preventing parallel
reapkills.

The pids unr must be used to clear the flags to all signalled processes.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agounr(9): document iterators
Konstantin Belousov [Sun, 14 May 2023 01:40:08 +0000 (04:40 +0300)]
unr(9): document iterators

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agounr(9) iterator: add naive test
Konstantin Belousov [Sat, 13 May 2023 01:32:25 +0000 (04:32 +0300)]
unr(9) iterator: add naive test

To use, compile userspace code e.g. into the subr_unit binary, then do
$ while ./subr_unit -iv >|/tmp/subr_unit.log ; do :; done
The loop should be left run for as long as possible.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agounr(9): add 'show unrhdr_iter' command
Konstantin Belousov [Thu, 25 May 2023 18:09:27 +0000 (21:09 +0300)]
unr(9): add 'show unrhdr_iter' command

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agounr(9): add iterator interface
Konstantin Belousov [Fri, 12 May 2023 22:49:29 +0000 (01:49 +0300)]
unr(9): add iterator interface

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agounr(9): add 'show unrhdr' ddb command
Konstantin Belousov [Thu, 25 May 2023 11:14:19 +0000 (14:14 +0300)]
unr(9): add 'show unrhdr' ddb command

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agounr(9): document clean_unrhdr()
Konstantin Belousov [Sun, 14 May 2023 00:43:54 +0000 (03:43 +0300)]
unr(9): document clean_unrhdr()

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agosubr_unit.c: explain first/last special ranges
Konstantin Belousov [Sun, 14 May 2023 23:11:17 +0000 (02:11 +0300)]
subr_unit.c: explain first/last special ranges

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agokern/subr_unit.c: more uses for is_bitmap()
Konstantin Belousov [Fri, 12 May 2023 22:39:35 +0000 (01:39 +0300)]
kern/subr_unit.c: more uses for is_bitmap()

To facilitate it, move the is_bitmap() definition earlier.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agokern/subr_unit.c: some style
Konstantin Belousov [Fri, 12 May 2023 22:37:35 +0000 (01:37 +0300)]
kern/subr_unit.c: some style

Use NBBY instead of spelling '8' literally.
Put space into the type specifier.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40089

13 months agosetkey(8): document NAT-T and NAT-T MTU extensions syntax
Konstantin Belousov [Sat, 27 May 2023 06:00:24 +0000 (09:00 +0300)]
setkey(8): document NAT-T and NAT-T MTU extensions syntax

Reviewed by: ae
Discussed with: bz
Sponsored by: NVidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40300

13 months agosetkey(8): NAT-T manual configuration support
Konstantin Belousov [Thu, 25 May 2023 10:41:15 +0000 (13:41 +0300)]
setkey(8): NAT-T manual configuration support

This is needed for testing of offload capabilities.

Reviewed by: ae
Discussed with: bz
Sponsored by: NVidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40300

13 months agosetkey(8): extract prefixlen calculation info helper
Konstantin Belousov [Thu, 25 May 2023 12:20:00 +0000 (15:20 +0300)]
setkey(8): extract prefixlen calculation info helper

While there, hide AF_INET case under #ifdef INET.

Reviewed by: ae
Discussed with: bz
Sponsored by: NVidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40300

13 months agoFix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Mon, 29 May 2023 21:58:20 +0000 (14:58 -0700)]
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

When loading the root directory ensure that it is a directory
and has a size greater than the minimum directory size. If an
invalid root directory is found, fall back to full fsck.

Reported-by: Robert Morris
PR:           271414
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
13 months agoCleanups to fsck_ffs(8).
Kirk McKusick [Mon, 29 May 2023 21:54:52 +0000 (14:54 -0700)]
Cleanups to fsck_ffs(8).

When checking an inode ensure that it does not have a negative size.
Stop scaning a directory when an unallocated block is found.
Fully clear an inode when it is first allocated.
Ensure that an inode is marked dirty whenever it is updated and that
it has a correct check hash when it is released.

MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
13 months agonfsuserd: Improve failure message when running in a jail
Rick Macklem [Mon, 29 May 2023 20:38:07 +0000 (13:38 -0700)]
nfsuserd: Improve failure message when running in a jail

If a jail is not correctly configured to run nfsd(8)
in the jail, nfsuserd(8) cannot run.
This patch improves the failure message for this case.

MFC after: 2 weeks

13 months agosiftr: sync-up man page with recent code changes, and cleanup code
Cheng Cui [Mon, 29 May 2023 14:53:11 +0000 (10:53 -0400)]
siftr: sync-up man page with recent code changes, and cleanup code

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

13 months agosiftr: fix a build error for powerpc and arm platforms
Cheng Cui [Mon, 29 May 2023 13:33:09 +0000 (09:33 -0400)]
siftr: fix a build error for powerpc and arm platforms

Summary: This is introduced by commit aa61cff4249c.

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

13 months agobcm2835_gpio: Handle BCM2711 pin configuration
Tetsuya Uemura [Sun, 28 May 2023 12:56:21 +0000 (09:56 -0300)]
bcm2835_gpio: Handle BCM2711 pin configuration

Add support for GPIO internal pull up/down configuration on RPi4 family.

BCM2711 SoC on 4th generation Raspberry Pi changed the way to configure
its GPIO pins' internal pull up/down resistors. NetBSD already have
support for this change, and port it to FreeBSD is trivial.

This patch, based on the NetBSD commit adds the appropriate method for
BCM2711 and now we can properly configure the GPIO pins' pull status.

PR: 256372
Reviewed by: mhorne
Obtained from: NetBSD bb88cfa64ad8
Pull Request: https://github.com/freebsd/freebsd-src/pull/746

13 months agolibpcap: Update PACKAGE_VERSION definition to 1.10.4
Joseph Mingrone [Mon, 29 May 2023 17:28:15 +0000 (14:28 -0300)]
libpcap: Update PACKAGE_VERSION definition to 1.10.4

Reviewed by:    kp
Fixes: 6f9cba8f8b5e (libpcap: Update to 1.10.3)
Fixes: dd744a896be3 (libpcap: Update to 1.10.4)
Sponsored by:   The FreeBSD Foundation

13 months agoarm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation
Alan Cox [Mon, 29 May 2023 06:01:37 +0000 (01:01 -0500)]
arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation

The prior implementation of VM_PAGE_TO_PV_LIST_LOCK() performed a
linear-time search of the vm_phys_segs[] array.  However, in contrast to
PHYS_TO_PV_LIST_LOCK(), that search is unnecessary because every (non-
fictitious) vm_page contains the index of the vm_phys_seg in which it
resides.

Change most of the remaining uses of CHANGE_PV_LIST_LOCK_TO_PHYS() and
PHYS_TO_PV_LIST_LOCK() to CHANGE_PV_LIST_LOCK_TO_VM_PAGE() and
VM_PAGE_TO_PV_LIST_LOCK(), respectively.

Collectively, these changes also reduce the size of a GENERIC-NODEBUG
kernel's pmap.

Before:

  text   data    bss     dec       hex   filename
 70144   3200   2248   75592   0x12748   pmap.o

After:

  text   data    bss     dec       hex   filename
 69192   3200   2248   74640   0x12390   pmap.o

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

13 months agoApply clang fixes for crashes compiling ARM/AArch64 CRC intrinsics
Dimitry Andric [Mon, 29 May 2023 14:27:58 +0000 (16:27 +0200)]
Apply clang fixes for crashes compiling ARM/AArch64 CRC intrinsics

Merge commit 069ecd0c6e2c from llvm-project (by Fangrui Song):

  [ARM] Check target feature support for __builtin_arm_crc*

  `__builtin_arm_crc*` requires the target feature crc which is available on armv8
  and above. Calling the fuctions for armv7 leads to a SelectionDAG crash.

  ```
  % clang -c --target=armv7-unknown-linux-gnueabi -c a.c
  fatal error: error in backend: Cannot select: intrinsic %llvm.arm.crc32b
  PLEASE submit a bug report to ...
  ```

  Add `TARGET_BUILTIN` and define required features for these builtins to
  report an error in `CodeGenFunction::checkTargetFeatures`. The problem is quite widespread.
  I will add `TARGET_BUILTIN` for more builtins later.

  Fix https://github.com/llvm/llvm-project/issues/57802

  Differential Revision: https://reviews.llvm.org/D134127

Merge commit b2d7a0dcf1ff from llvm-project (by Fangrui Song):

  [AArch64] Check target feature support for __builtin_arm_crc*

  This is the AArch64 counterpart of D134127.
  Daniel Kiss will change more `BUILTIN` to `TARGET_BUILTIN`.

  Fix #57802

Note that programs attempting to use ARM/AArch64 CRC intrinsics, when
they are not supported by the targeted CPU, will still receive a regular
compilation error (instead of a fatal backend error) similar to:

  7zCrc.c:4:10: error: '__builtin_arm_crc32b' needs target feature crc
    return __builtin_arm_crc32b(a, b);
           ^

Reported by: Alastair Hogge <agh@riseup.net>
PR: 271624
MFC after: 3 days

13 months agosiftr: three changes that improve performance
Cheng Cui [Sat, 27 May 2023 09:02:11 +0000 (05:02 -0400)]
siftr: three changes that improve performance

Summary:
(1) use inp_flowid or a new packet hash for a flow identification
(2) cache constant connection info into struct flow_hash_node
(3) use compressed notation for IPv6 address representation

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

13 months agolinux(4): Regen for linux_execve
Dmitry Chagin [Mon, 29 May 2023 09:18:30 +0000 (12:18 +0300)]
linux(4): Regen for linux_execve

MFC after: 2 month

13 months agolinux(4): Add a dedicated linux_exec_copyin_args()
Dmitry Chagin [Mon, 29 May 2023 09:18:16 +0000 (12:18 +0300)]
linux(4): Add a dedicated linux_exec_copyin_args()

Because Linux allows to exec binaries with 0 argc.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D40148
MFC after: 2 month

13 months agovfs: Retire kern_alternate_path() as unused anymore
Dmitry Chagin [Mon, 29 May 2023 08:19:41 +0000 (11:19 +0300)]
vfs: Retire kern_alternate_path() as unused anymore

From now a non-native ABI should use pwd_altroot() ability to tell
to the namei() its root directory to dynamically reroots lookups.

Differential Revision: https://reviews.freebsd.org/D40093
MFC after: 2 month

13 months agolinux(4): Make linux_emul_path private
Dmitry Chagin [Mon, 29 May 2023 08:19:08 +0000 (11:19 +0300)]
linux(4): Make linux_emul_path private

There is no need to refer to linux_emul_path from outside anymore.

MFC after: 2 month

13 months agolinprocfs: Rework according to the new ABI altroot facility
Dmitry Chagin [Mon, 29 May 2023 08:18:37 +0000 (11:18 +0300)]
linprocfs: Rework according to the new ABI altroot facility

By 3d2fec7d the ABI prefix path added to the struct pwd.
Use it in the mounts, mountinfo filler functions.

Differential revision: https://reviews.freebsd.org/D39438
MFC after: 2 month

13 months agosysentvec: Retire sv_imgact_try as unneeded anymore
Dmitry Chagin [Mon, 29 May 2023 08:18:11 +0000 (11:18 +0300)]
sysentvec: Retire sv_imgact_try as unneeded anymore

The sysentvec sv_imgact_try was used by kern_exec() to allow
non-native ABI to fixup shell path according to ABI root directory.
Since the non-native ABI can now specify its root directory directly
to namei() via pwd_altroot() call this facility is not needed anymore.

Differential Revision: https://reviews.freebsd.org/D40092
MFC after: 2 month

13 months agoBrandinfo: Retire emul_path as unneeded anymore
Dmitry Chagin [Mon, 29 May 2023 08:17:28 +0000 (11:17 +0300)]
Brandinfo: Retire emul_path as unneeded anymore

The Barndinfo emul_path was used by the Elf image activator to fixup
interpreter file name according to ABI root directory. Since the
non-native ABI can now specify its root directory directly to namei()
via pwd_altroot() call this facility is not needed anymore.

Differential Revision: https://reviews.freebsd.org/D40091
MFC after: 2 month

13 months agolinux(4): Use pwd_altroot() to tell namei() about ABI root path
Dmitry Chagin [Mon, 29 May 2023 08:16:46 +0000 (11:16 +0300)]
linux(4): Use pwd_altroot() to tell namei() about ABI root path

PR: 72920
Differential Revision: https://reviews.freebsd.org/D40090
MFC after: 2 month

13 months agonamei: Add the abilty for the ABI to specify an alternate root path
Dmitry Chagin [Mon, 29 May 2023 08:15:28 +0000 (11:15 +0300)]
namei: Add the abilty for the ABI to specify an alternate root path

For now a non-native ABI (i.e., Linux) uses the kern_alternate_path()
facility to dynamically reroot lookups. First, an attempt is made to
lookup the file in /compat/linux/original-path. If that fails, the
lookup is done in /original-path. Thats requires a bit of code in
every ABI syscall implementation where path name translation is needed.
Also our kern_alternate_path() does not properly lookups absolute symlinks
in second attempt, i.e., does not append /compat/linux part to the resolved
link.
The change is intended to avoid this by specifiyng the ABI root directory
for namei(), using one call to pwd_altroot() during exec-time into the ABI.
In that case namei() will dynamically reroot lookups as mentioned above.

PR: 72920
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D38933
MFC after: 2 month

13 months agoavx_sig: Print statistics by interval enstead of by pressing ^T
Dmitry Chagin [Mon, 29 May 2023 08:09:17 +0000 (11:09 +0300)]
avx_sig: Print statistics by interval enstead of by pressing ^T

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40311