Commit Graph

285928 Commits

Author SHA1 Message Date
Kyle Evans 8ed0ecf802 caroot: regenerate the root bundle with OpenSSL 3
No functional change intended.
2023-08-25 20:16:36 -05:00
Kyle Evans 65fd80909e caroot: update the root bundle
Summary:
- Six (6) new roots
- Four (4) distrusted roots

Note that this was intentionally generated with OpenSSL 1.1.1 to avoid
mixing updates and non-functional changes -- there will be some churn
with OpenSSL 3.  The next commit will update the current batch of
trusted certs with the format OpenSSL 3 produces, which I've tested
against OpenSSL 1.1.1 to be sure that that doesn't hurt us in older
branches.
2023-08-25 20:16:36 -05:00
Kyle Evans 3f84d4b0fe caroot: drop the VERSION tag from already-processed certs
An update is imminent; drop these now to make it easier to audit the
results.
2023-08-25 20:16:36 -05:00
Kyle Evans bbc8585ef5 caroot: drop VERSION tags from certs
With this change, we'll drop the "with $FreeBSD$" lines from trusted/
certs in the next update. untrusted/ will need to be done manually, but
I'll likely just do them all manually, commit, then run the script and
commit any legitimate updates after confirming the output matches what
I did manually.

Reported by:	imp
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41597
2023-08-25 20:16:35 -05:00
John Baldwin 023ef8015e OptionalObsoleteFiles.inc: Add libprivate{cbor,fido2}_p.a
Two more profile libraries that should be removed by WITHOUT_PROFILE.
Found when upgrading a stable/13 VM to stable/14.
2023-08-25 16:22:01 -07:00
Warner Losh e8f2e3b6dd Two more $FreeBSD$ stragglers 2023-08-25 15:14:19 -06:00
Warner Losh 67dd7233be pccarddevs2h.awk: Remove
pccard support was removed in 31b35400cf77on Dec 14, 2021, but this
wasn't.  Belatedly remove it.

MFC After: 1 week
Sponsored by: Netflix
2023-08-25 15:12:44 -06:00
Domagoj Stolfa 7a3af0a59b dtrace: Remove $FreeBSD$ from genmakefiles.sh.
$FreeBSD$ is gone in head, so this should be removed as well.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41595
2023-08-25 14:55:59 -06:00
Mike Karels b4ef09b9eb clk_fixed: reduce and clarify messages due to missing clk-frequency
The current dts for Raspberry 3B+ and 4B have 2 disabled fixed-clock
nodes which have no clock-frequency value.  Such nodes are non-standard.
This results in about 150 messages during autoconfiguration:

    clk_fixed2: <Fixed clock> disabled on ofwbus0
    clk_fixed2: Cannot FDT parameters.
    device_attach: clk_fixed2 attach returned 6

Defensively check for clock-frequency in the probe routine, and if
none, return an error with a more direct error message (1 line per
occurrence, 50 lines total):

    clk_fixed2: clock-fixed has no clock-frequency

Based on a patch by manu.

MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D41594
2023-08-25 15:11:46 -05:00
John Baldwin 7aec088cbc nehemiah RNG: Switch to using FPU_KERN_NOCTX
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D41583
2023-08-25 12:34:16 -07:00
John Baldwin 3b0e353fe6 padlock: Switch to using FPU_KERN_NOCTX
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D41582
2023-08-25 12:34:05 -07:00
John Baldwin 8173fa60dd efirt: Move comment about fpu_kern_enter to where it is called
Reviewed by:	imp, kib, andrew, markj
Differential Revision:	https://reviews.freebsd.org/D41576
2023-08-25 12:33:00 -07:00
Robert Clausecker 3d8ef251aa lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code
When the buffer is immediately preceeded by the character we
are looking for and begins with one higher than that character,
and the buffer is misaligned, a match was errorneously detected
in the first character.  Fix this by changing the way we prevent
matches before the buffer from being detected: instead of
removing the corresponding bit from the 0x80..80 mask, set the
LSB of bytes before the buffer after xoring with the character we
look for.

The bug only affects amd64 with ARCHLEVEL=scalar (cf. simd(7)).
The change comes at a 2% performance impact for short strings
if ARCHLEVEL is set to scalar.  The default configuration is not
affected.

os: FreeBSD
arch: amd64
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
        │ strchrnul.scalar.0.out │       strchrnul.scalar.2.out       │
        │         sec/op         │   sec/op     vs base               │
Short                57.89µ ± 2%   59.08µ ± 1%  +2.07% (p=0.030 n=20)
Mid                  19.24µ ± 0%   19.73µ ± 0%  +2.53% (p=0.000 n=20)
Long                 11.03µ ± 0%   11.03µ ± 0%       ~ (p=0.547 n=20)
geomean              23.07µ        23.43µ       +1.53%

        │ strchrnul.scalar.0.out │       strchrnul.scalar.2.out        │
        │          B/s           │     B/s       vs base               │
Short               2.011Gi ± 2%   1.970Gi ± 1%  -2.02% (p=0.030 n=20)
Mid                 6.049Gi ± 0%   5.900Gi ± 0%  -2.47% (p=0.000 n=20)
Long                10.56Gi ± 0%   10.56Gi ± 0%       ~ (p=0.547 n=20)
geomean             5.045Gi        4.969Gi       -1.50%

MFC to:		stable/14
MFC after:	3 days
Approved by:	mjg (blanket, via IRC)
Sponsored by:	The FreeBSD Foundation
2023-08-25 21:21:54 +02:00
John Baldwin 247e8662d2 arm unwind: Reject unaligned stack pointers
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D41533
2023-08-25 12:00:37 -07:00
Gleb Smirnoff 6f3947be2a ifconfig: fix 'ifconfig -l link'
The rtnetlink(4) RTM_GETADDR does not list link level addresses, thus
the correct match for interfaces that have a link level address should
be based on what was returned by RTM_GETLINK.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D41586
2023-08-25 10:31:55 -07:00
Gleb Smirnoff 31016aa0be ifconfig: fix 'ifconfig -l ether'
When matching interfaces for being Ethernet, use same trick that
the link module does - pass if_type through convert_iftype().
That restores historicaly behaviour of listing lagg(4) ports.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D41585
2023-08-25 10:31:26 -07:00
Gleb Smirnoff 24a81a968d ifconfig: fix logical error in interface matching for '-l ether'
This affects only ifconfig(8) compiled WITHOUT_NETLINK_SUPPORT, which
is not the default.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D41584
Fixes:			d1cd0344f7
2023-08-25 10:30:25 -07:00
Justin Hibbits b820820ece mac_ipacl: Use IfAPI
Use `if_t` instead of `struct ifnet *`, and if_name() accessor.

Sponsored by:	Juniper Networks, Inc.
2023-08-25 12:50:39 -04:00
Justin Hibbits 2a3716432d IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()
Summary:
These came in the original DrvAPI commits in 2014, and are obsoleted by
bpf_mtap_if() and ether_bpf_mtap_if().  The `_if` suffix, rather than
prefix, conveys that it's operating on the bpf of the interface, instead
than the interface itself.

Reviewed by:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D41146
2023-08-25 12:50:14 -04:00
Warner Losh 8052b01e7e nvme: Add exclusion for ISR
Add a basically uncontended spinlock that we take out while the ISR is
running. This has two effects: First, when we get a timeout, we can
safely call the nvme_qpair_process_completions w/o racing any ISRs.
Second, we can use it to ensure that we don't reset the card while
the ISRs are active (right now we just sleep and hope for the best,
which usually is fine, but not always).

Sponsored by:		Netflix
MFC After:		2 weeks
Reviewed by:		chuck, gallatin
Differential Revision:	https://reviews.freebsd.org/D41452
2023-08-25 10:11:27 -06:00
Warner Losh d4959bfcd1 nvme: Greatly improve error recovery
Next phase of error recovery: Eliminate the REOVERY_START phase, since
we don't need to wait to start recovery. Eliminate the RECOVERY_RESET
phase since it is transient, we now transition from RECOVERY_NORMAL into
RECOVERY_WAITING.

In normal mode, read the status of the controller. If it is in failed
state, or appears to be hot-plugged, jump directly to reset which will
sort out the proper things to do. This will cause all pending I/O to
complete with an abort status before the reset.

When in the NORMAL state, call the interrupt handler. This will complete
all pending transactions when interrupts are broken or temporarily
misbehaving. We then check all the pending completions for timeouts. If
we have abort enabled, then we'll send an abort. Otherwise we'll assume
the controller is wedged and needs a reset. By calling the interrupt
handler here, we'll avoid an issue with the current code where we
transitioned to RECOVERY_START which prevented any completions from
happening. Now completions happen. In addition and follow-on I/O that is
scheduled in the completion routines will be submitted, rather than
queued, because the recovery state is correct. This also fixes a problem
where I/O would timeout, but never complete, leading to hung I/O.

Resetting remains the same as before, just when we chose to reset has
changed.

A nice side effect of these changes is that we now do I/O when
interrupts to the card are totally broken. Followon commits will improve
the error reporting and logging when this happens. Performance will be
aweful, but will at least be minimally functional.

There is a small race when we're checking the completions if interrupts
are working, but this is handled in a future commit.

Sponsored by:		Netflix
MFC After:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D36922
2023-08-25 10:11:15 -06:00
Warner Losh 2a6b7055a9 nvme: Timeout expired transactions
When we went to having a shared timeout routine, failing the timed-out
transaction code was inadvertantly dropped. Reinstate it.

Fixes:			502dc84a8b
Sponsored by:		Netflix
MFC After:		2 weeks
Reviewed by:		chuck, jhb
Differential Revision:	https://reviews.freebsd.org/D36921
2023-08-25 10:10:44 -06:00
Warner Losh 2f06449d64 smartpqi: Fix build issues highlighted by gcc12
Make inline functions defined in a header file as static inline.
Mark inline functions used only in the compilation unit they are
defined in as merely static (the compiler can figure out it these
days).

Sponsored by:		Netflix
2023-08-25 09:46:44 -06:00
Michael Tuexen e40d16ad6e sctp: cleanup
In particular, don't use a socket level flag, use the inp level one.
After adding appropriate locking, this will close a race condition.

MFC after:	1 week
2023-08-25 17:31:19 +02:00
Michael Tuexen f0c8e8118d sctp: cleanup
No functional change intended. Just asserting the conditions when
being called.

MFC after:	1 week
2023-08-25 17:26:58 +02:00
Mateusz Guzik 5eab523053 timerfd: compute fflags before calling falloc
While here dodge list locking in timerfd_adjust if empty.
2023-08-25 15:09:21 +00:00
Mateusz Guzik 02f534b57f timerfd: fix up a memory leak and missing locking
timerfd01 from ltp passes (and some other don't), but none of the tests
crash the kernel.

This is a bare minimum patch to fix up the immediate regression.

Reported by:	yasu
2023-08-25 14:46:48 +00:00
Simon J. Gerraty 1554ba03b6 Add mac_grantbylabel
This module allows controlled privilege escallation via mac labels
securely associated with a process via mac_veriexec.

There are over 700 PRIV_* but we can compress many of them into
a single GBL_* thus constraining the size of gbl labels.

The goal is to allow a daemon to run as an unprivileged process while
still being able a set of privileged operations needed.

We add APIs to libveriexec so that userland processes can check labels
and an exec_script API that allows a suitably labeled process to run
something like a python interpreter directly if necessary;
overcomming the 'indirect' flag applied to the interpreter.

Add -l option to sbin/veriexec to report labels.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D41431
2023-08-24 17:42:11 -07:00
Glen Barber 52c1066f52 UPDATING: add entry for 15.0-CURRENT
Sponsored by:	GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by:	PayPal https://paypal.me/gjbbsd
2023-08-24 19:45:12 -04:00
Glen Barber aee253d8a7 update main to 15
Approved by:	re (implicit)
Sponsored by:	GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by:	PayPal https://paypal.me/gjbbsd
2023-08-24 19:10:35 -04:00
Mateusz Guzik 712806fc4b vfs: retried++ -> retried = true for the boolean
No real changes.

Noted by:	rpokala
2023-08-24 22:50:31 +00:00
Stephen J. Kiernan 30cdbb5833 freebsd32: Remove mac_syscall from the unimpl list
The mac_syscall system call works fine as long as any MAC module
that provides a mpo_syscall method handles compat32 appropriately.

Regenerate system call files for freebsd32.

Reviewed by:	sjg
Obtained from:	Juniper Networks, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41575
2023-08-24 18:45:31 -04:00
Warner Losh 1b7663a03c smartpqi: Use today's date
We don't have any other man pages that uses $Mdocdate$ so just inline
today's date and remove $Id$ while I'm here.
2023-08-24 16:16:18 -06:00
Mateusz Guzik c1d85ac3df vfs: try harder to find free vnodes when recycling
The free vnode marker can slide past eligible entries.

Artificially reducing vnode limit to 300k and spawning 104 workers each
creating a million files results in all of them trying to recycle, which
often fails when it should not have to.

Because of the excessive traffic in this scenario, the trylock to
requeue is virtually guaranteed to fail, meaning nothing gets pushed
forward.

Since no vnodes were found, the most unfortunate sleep for 1 second is
induced (see vn_alloc_hard, the "vlruwk" msleep).

Without the fix the machine is mostly idle with almost everyone stuck
off CPU waiting for the sleep to finish. With the fix it is busy
creating files.

Unrelated to the above problem the marker could have landed in a
similarly problematic spot for because of any failure in vtryrecycle.

Originally reported as poudriere builders stalling in a vnode-count
restricted setup.

Fixes:	138a5dafba ("vfs: trylock vnode requeue")
Reported by:	Mark Millard
2023-08-24 22:12:40 +00:00
Dag-Erling Smørgrav 9b5d724cad libc: Add timespec_getres(3) as per C23.
This also adds support for TIME_MONOTONIC to timespec_get(3).

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D41524
2023-08-24 21:31:54 +00:00
Dag-Erling Smørgrav b8b6bef43f libc: Fix parsing of hexadecimal numbers in strtol() family.
This had previously been partly fixed in 2571c7f720.

MFC after:	1 week
Reviewed by:	imp, allanjude, emaste
Differential Revision:	https://reviews.freebsd.org/D41510
2023-08-24 21:31:54 +00:00
John Hall 7ea28254ec smartpqi: update to version 4410.0.2005
This updates the smartpqi driver to Microsemi's latest code. This will
be the driver for FreeBSD 14 (with updates), but no MFC is planned.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41550
2023-08-24 15:25:09 -06:00
Kevin Bowling 725e4008ef iflib: invert default restart on VLAN changes
In rS360398, a new iflib device method was added to opt out of VLAN
events needing an interface reset.

I am switching the default to not requiring a restart for:
* VLAN events
* unknown events

After fixing various bugs, I do not think this would be a common need
of hardware and it is undesirable from the user's perspective causing
link flaps and much slower VLAN configuration. Currently, there are no
other restart events besides VLAN events, and setting the
ifdi_needs_restart default to false will alleviate the need to churn
every driver if an odd event is added in the future for specific
hardware.

markj points out this could cause churn in the other direction; I will
solve that problem with an event registration system as he mentions in
the review should we need it in the future.

These drivers will opt into restart and need further inspection or work:
* ixv (needs code audit, 61a8231 fixed principal issue; re-init probably
not necessary)
* axgbe (needs code audit; re-init probably not necessary)
* iavf - (needs code audit; interaction with Malicious Driver Detection
mentioned in rS360398)
* mgb - no VLAN functions are currently implemented. Left a comment.

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:48:19 -07:00
Kevin Bowling 14a14e36ae ice: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unnecessary for ice(4).

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:57 -07:00
Kevin Bowling 1d6c12c511 iavf: Add explicit ifdi_needs_reset for VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

iavf(4) was the original need for this, because VLAN filter changes
currently have negative interactions with Malicious Driver Detection.

Add iavf_if_needs_restart and explicitly enable VLAN re-init.

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling fe6c4e214d enic: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for vmxnet3(4).

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling b6b75424c5 vmxnet3: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for vmxnet3(4).

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling f9e0a790ae enetc: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for enetc(4).

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Kevin Bowling bce864d1c2 bnxt: Don't restart on VLAN changes
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This is unintentional for bnxt(4) and is causing another bug in its VLAN
initialization code to affect the common case of adding and removing
VLANs on an existing interface.

PR:		269133
Tested by:	kp
MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:46:56 -07:00
Jake Freeland 8544651dc5 timerfd: Add manual page.
This manual page accompanies the timerfd system calls.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40218
2023-08-24 14:29:06 -06:00
Jake Freeland af93fea710 timerfd: Move implementation from linux compat to sys/kern
Move the timerfd impelemntation from linux compat code to sys/kern. Use
it to implement the new system calls for timerfd. Add a hook to kern_tc
to allow timerfd to know when the system time has stepped. Add kqueue
support to timerfd. Adjust a few names to be less Linux centric.

RelNotes: YES
Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack)
Differential Revision: https://reviews.freebsd.org/D38459
2023-08-24 14:28:56 -06:00
Dmitry Chagin f8bc606aad tests: Handle SIGSEGV in the vm stack mprotect exec test
To exit gracefully handle SIGSEGV and mark the test as failed.

MFC after:		3 days
2023-08-24 21:02:52 +03:00
Piotr Pawel Stefaniak 5c0a1c15ff ps: add a new option -D to reimplement tree traversal
It takes a non-optional parameter string, one of "up", "down", or "both"
that can request tree traversal in the chosen directions. This adds PIDs
from the paths to the selection of PIDs and can be used together with -d
to draw a subset of the process tree.

Differential Revision:	https://reviews.freebsd.org/D41231
2023-08-24 18:35:56 +02:00
Piotr Pawel Stefaniak f06e32e9b9 Revert "ps: extend the non-standard option -d (tree view) to work with -p"
This reverts commit ca8c0d5e81.

By commiting ca8c0d5e81 I was hoping that the existing option -d
could just be extended to work with -p to implement a feature that was
and I think is still needed, that is to show all descendant processes
of a given process id or a set of process ids.

After a complaint from -current which may represent a wider
dissatisfaction with this change in the program's behavior, I think it
will be better to revert ca8c0d5e81 and reintroduce this feature
using a separate option -D.
2023-08-24 18:35:50 +02:00
Michael Tuexen 847fa61fad sctp: improve handling of socket shutdown for reading
If a socket is marked as cannot read anymore, drop chunks which
should be added to a control element in the receive queue.
This is consistent with dropping control elements instead of
adding them in the same situation.

Reported by:	syzbot+291f6581cecb77097b16@syzkaller.appspotmail.com
MFC after:	1 week
2023-08-24 15:52:55 +02:00