1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
Commit Graph

293590 Commits

Author SHA1 Message Date
Zhenlei Huang
aac6c41d4b tests: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:21 +08:00
Zhenlei Huang
66c35a6675 krping: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:21 +08:00
Zhenlei Huang
7bcb122855 LinuxKPI: 802.11: Stop checking for failures from malloc(M_WAITOK)
As a consequence lkpi_ieee80211_ifalloc() now does not fail. Remove
unneeded NULL check.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:21 +08:00
Zhenlei Huang
7a720bf67d xdr: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:20 +08:00
Zhenlei Huang
6e50988cf8 netsmb: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:20 +08:00
Zhenlei Huang
5b00557330 pf: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:20 +08:00
Zhenlei Huang
07b16b1e2a if_vlan: Stop checking for failures from malloc(M_WAITOK)
Fixes:	b08d611de8 fix vlan locking to permit sx acquisition in ioctl calls
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:19 +08:00
Zhenlei Huang
2a11988663 altq: Stop checking for failures from malloc(M_WAITOK)
While here, prefer malloc(M_ZERO) over bzero().

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:19 +08:00
Zhenlei Huang
3feb35dc46 udf: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:18 +08:00
Zhenlei Huang
8e6dd41858 ctl: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:18 +08:00
Zhenlei Huang
99e3bb555c subr_bus: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:17 +08:00
Zhenlei Huang
f444db950e boottrace: Stop checking for failures from realloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:17 +08:00
Zhenlei Huang
6a2a385507 kern_fail: Stop checking for failures from fp_malloc(M_WAITOK)
`fp_malloc` is defined as a macro that redirects to `malloc`.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:16 +08:00
WHR
bac98f86c9 mfiutil: Handle potential ioctl(2) failures in mfi_flash.c
The return value of function 'mfi_dcmd_command' should always be checked for
the potential ioctl(2) failure.

PR:		281158
MFC after:	1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1403
2024-09-02 22:46:51 -07:00
Bram Ton
c7dd97ec99 vmstat: Add root element to libxo output
Current libxo output does not have a root element. Valid XML requires a single
root element. This commit adds this root element.

The libxo output version bumped accordingly.

PR:		254635
MFC after:	1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1330
2024-09-02 18:22:14 -07:00
Jessica Clarke
b162fc3f30 gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID
This is a platform-independent UUID, and this is the name U-Boot uses.

MFC after:	1 week
2024-09-02 23:21:18 +01:00
Ed Maste
1a19741860 UPDATING: remove 20240813 DMAR entry
The associated commit has been reverted and DMAR is not enabled by
default any longer.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46474
2024-09-02 16:44:55 -04:00
Helge Oldach
209905ec38 ndp: Fix libxo formatting for the header of neighbor cache
PR:		272749
Reviewed by:	zlei
Fixes:		e1c7783e22 ndp(8): add structured output formatting via libxo
Fixes:		91fbe0819b ndp: convert ndp(8) to netlink
MFC after:	3 days
2024-09-02 18:15:15 +08:00
Wolfram Schneider
9867b4af50 Makefile.inc1: show time for `make installworld'
For years we display the time in seconds how long it takes to
run `make buildworld' (see PR 224433). Now we will display the
time for "installworld" and "installkernel" as well.

e.g.:
--------------------------------------------------------------
>>> Installing everything completed on Sun Jul  7 16:11:37 UTC 2024
>>> Install world completed in 110 seconds, ncpu: 2, make -j2
--------------------------------------------------------------

This is an improved version of commit e5a0202f96

PR: 280187
Differential Revision: https://reviews.freebsd.org/D45912
2024-09-02 09:55:10 +00:00
Zhenlei Huang
3e76d05231 kernel: Add defination of .init_array and .fini_array for all other platforms
Currently these sections are not used but defined only for amd64 and
i386. Added them for all other platforms to keep all platforms in sync.
There should be no functional change.

This change is extracted from a bigger patch [1] of hselasky, with
additional fix for the order of .fini_array section.

1. https://reviews.freebsd.org/D40467

Obtained from:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45214
2024-09-02 12:26:48 +08:00
Zhenlei Huang
e15b5ba77d kernel: Fix defining of .init_array and .fini_array sections
These input sections can have decimal numbers as the priority suffix.
Clang emits the '%u' form, while SORT is an alias for SORT_BY_NAME,
hence will result in wrong order of constructors / destructors in
output sections. Fix by using the correct sorting command
SORT_BY_INIT_PRIORITY instead [1].

The functions referenced by section .fini_array is in the normal order,
but been executed in the reverse order. The order is same with
.init_array section.

Currently these sections are not used, there should be no functional
change.

Note: As for the .ctors and .dtors sections, both Clang and GCC emit
the priority suffix in the form of '%05u', so there is no semantic
difference between SORT_BY_NAME and SORT_BY_INIT_PRIORITY for those
sections [2].

This fix is extracted from a bigger patch [3] of hselasky, with
additional fix for .fini_array section.

1. https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html
2. https://reviews.llvm.org/D91187
3. https://reviews.freebsd.org/D40467

Reviewed by:	imp (previous version)
Obtained from:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45194
2024-09-02 12:26:47 +08:00
Kristof Provost
0578fe4922 pf: rework pf_icmp_state_lookup() failure mode
If pf_icmp_state_lookup() finds a state but rejects it for not matching the
expected direction we should unlock the state (and NULL out *state). This
simplifies life for callers, and also ensures there's no confusion about what a
non-NULL returned state means.

Previously it could have been left in there by the caller, resulting in callers
unlocking the same state twice.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-01 17:05:29 +02:00
Kristof Provost
3da3eb6081 pf: be less strict about icmp state checking for sloppy state tracking
Sloppy state tracking renders ICMP direction check useless
and harmful as we might see only half of the connection in
the asymmetric setups but ignore the state match.  The bug
was reported and fix was verified by Insan Praja <insan ()
ims-solusi ! com>.  Thanks!  OK mcbride, henning

MFC after:	1 week
Obtained from:	OpenBSD, mikeb <mikeb@openbsd.org>, 538596657140
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-01 17:05:29 +02:00
Kristof Provost
b8cd169efa pf: try to lookup the icmp state based on a correct packet descriptor
MFC after:	1 week
Obtained from:	OpenBSD, mikeb <mikeb@openbsd.org>, e467ea25dcd3
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-01 17:05:28 +02:00
Kristof Provost
d154dc2113 pf tests: ensure that neighbour discovery works as expected
Also check repeated calls.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-01 17:05:28 +02:00
Kristof Provost
5ab1e5f7e5 pf: improve the ICMPv6 direction check
Following bluhm's advice this changes the way we setup state keys and
perform state lookups for ICMPv6 Neighbor Discovery packets:
  - replace the NS-dst with ND target address;
  - replace the NA-src with ND target address;
  - replace the NA-dst with unspecified address if it is a multicast.

This allows pf to match Address Resolution, Neighbor Unreachability
Detection and Duplicate Address Detection packets to the corresponding
states without the need to create new ones or match unrelated ones.
As a side effect we're doing now one state table lookup for ND packets
instead of two.

Fixes a bug uncovered by one of the previous commits that virtually
breaks IPv6 connectivity after few minutes of use.

ok stsp henning, with and ok bluhm

PR:		280701
MFC after:	1 week
Obtained from:	OpenBSD, mikeb <mikeb@openbsd.org>, 2633ae8c4c8a
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-01 17:05:28 +02:00
Mark Johnston
61295e0985 dummymbuf: Avoid copyout of uninitialized memory from the sysctl handler
If *rulesp was initially unset, we'll allocate a new buffer and pass it
to sysctl_handle_string(), which copies the existing string out and then
copies in the new string.  We need to make sure the buffer containing
the existing rules is initialized, otherwise we leak kernel memory to
userspace.

Fix some nearby style nits while here.

Reported by:	KMSAN
Reviewed by:	igoro, kp
Fixes:		8aaffd78c0 ("Add dummymbuf module for testing purposes")
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D46493
2024-09-01 14:09:53 +00:00
Mark Johnston
7d508464f5 carp: Fix pullup checks
The conditions used to test whether a pullup is needed were inverted.

While here:
- Fix a bogus assignment to "iplen": it's already initialized to *offp.
- Use in_cksum_skip() instead of manually adjusting the data pointer.
  Otherwise the mbuf is temporarily in an invalid state, since m_len
  isn't updated to match.

Reported by:	KMSAN
Reviewed by:	kp
Sponsored by:	Klara, Inc.
Fixes:		3711515467 ("carp: support VRRPv3")
Differential Revision:	https://reviews.freebsd.org/D46492
2024-09-01 14:09:53 +00:00
Mark Johnston
cef5f43f81 vmm: Use make_dev_s() to create vmm devices
This avoids creating windows where a device file is accessible but the
device-specific field is not set.

Now that vmmdev_mtx is a sleepable lock, avoid dropping it while
creating devices files.  This makes it easier to handle races and
simplifies some code; for example, the VSC_LINKED flag is no longer
needed.

Suggested by:	jhb
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D46488
2024-09-01 14:09:17 +00:00
Mark Johnston
887c0877a6 vmm: Use an sx lock for vmmdev_mtx
This will make it easier to atomically create the device file and set
its si_drv1 member.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46487
2024-09-01 14:03:16 +00:00
Mark Johnston
4008758105 vmm: Validate credentials when opening a vmmdev
Rather than performing privilege checks after a specific VM's device
file is opened, do it once at the time the device file is opened.  This
means that one can continue to access a VM via its device fd after
attaching to a jail which does not have vmm enabled, but this seems like
a reasonable semantic to have anyway.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46486
2024-09-01 14:03:16 +00:00
Mark Johnston
133a513ddc vmm: Make vmm_dev.h more self-contained
vmm.h is required for VM_MAX_SUFFIXLEN.  vmm_snapshot.h is required for
struct vm_snapshot_meta.

This is a prerequisite for including vmm_dev.h in the headers parsed by
libsysdecode.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46485
2024-09-01 14:03:15 +00:00
Mark Johnston
780675e1be arm64: Fix the VM_MAX_NAMELEN definition
The maximum VM name length has changed since the arm64 vmm code was
forked.  For now, just sync with the amd64 definitions, since they
permit longer VM names.  As arm64/vmm is implemented only in main, I
won't bother dealing with backward compat.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46484
2024-09-01 14:03:15 +00:00
Bjoern A. Zeeb
a800b5bcd1 sdiodevs: add more vendors and devices
Add IDs for Realtek, Atheros (QCA), and Mediatek.
While I am not sure we'll ever support the ath10k and possibly mt76
SDIO devices, rtw88 ones can be found with SoCs (e.g. r2s-plus) and
are actively being worked on.

Update Broadcom/Cypress entries.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46460
2024-08-31 21:38:57 +00:00
Bjoern A. Zeeb
b4ef1b1be7 tools/sdiodevs2h.awk: introduce palias
Some of the defined names are not the direct 1:1 mapping with vendor
and device names used by Linux device drivers.
Introduce a p(roduct)alias so we can map the one device entry I came
across without much extra hassle and generate a name device drivers
know about:
palias BROADCOM_CYPRESS_43439  CYPRESS_43439

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46455
2024-08-31 21:37:53 +00:00
Bjoern A. Zeeb
1847e63d63 LinuxKPI: add no_printk
Add a version of no_printk(), which seems to be there to have format
string checking while never calling the printk.  It seems a very weird
thing and it needs a return code and for some reason my initial
while (0) { } version hadn't worked while porting over new code but
could have been further downstream format string problems.
if (0) seems to do the job though I would have expected that to more
likely simply get optimised out without any futher format checking.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46463
2024-08-31 21:36:01 +00:00
Bjoern A. Zeeb
273cf7d363 LinuxKPI: add eth_hdr()
Add an implementation of eth_hdr() needed by a wireless driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46462
2024-08-31 21:35:02 +00:00
Bjoern A. Zeeb
8adb745dc9 LinuxKPI: add ENAVAIL error code
Used by an updated wireless driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46461
2024-08-31 21:34:01 +00:00
Bjoern A. Zeeb
f29e915bc0 LinuxKPI: add get_random_u8()
Add a get_random_u8() implementation following the u36 and u64 versions.
We'll likely want to macro-ify them in the future and add all the types
which makes sense just to be done.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46464
2024-08-31 21:32:11 +00:00
Jean-François Hren
d7c87526b1 tpm: Register TPM as entropy source
TPM is defined as an entropy and is called every 10 seconds. However it
was not registered and calls were discarded.

Signed-off-by: Jean-François Hren <jean-francois.hren@stormshield.eu>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1398
2024-08-31 10:53:02 -07:00
Christos Margiolis
e9a30c90d3 ObsoleteFiles.inc: Fix examples path
Fixes:		c3516c6533 ("ObsoleteFiles.inc: Update after sound changes")
Sponsored by:	The FreeBSD Foundation
2024-08-31 19:35:07 +03:00
Gordon Tetlow
86dd740dd7
openssl: Remove fips module from base system.
To comply with FIPS 140 guidance, you must be using a specifically
validated and approved version of the fips module. Currently, only
OpenSSL 3.0.8 and 3.0.9 have been approved by NIST for FIPS 140
validation. As such, we need to stop shipping later versions of the
module in the base system.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D46223
2024-08-31 09:24:30 -07:00
Tom Hukins
a2f53837f0 valectl(8): explicitly mention network switches
Use the term "network switch" instead of the ambiguous term "switch".

Signed-off-by:	Tom Hukins <tom@FreeBSD.org>
Reviewed by:	imp, mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1369
2024-08-30 16:39:56 -03:00
Tom Hukins
9a3fa77585 vale(4): refer to the valectl(8) management tool
Signed-off-by:	Tom Hukins <tom@FreeBSD.org>
Reviewed by:	imp, mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1369
2024-08-30 16:39:56 -03:00
Mitchell Horne
38a08e45f1 arm64: fix L1 pindex calculation in pmap_growkernel()
Use the pmap_l1_pindex() macro which accounts for the NUL2E offset.
While here, use pmap_l2_pindex() macro further down (no change).

Prompted by pull request and commit 2e33abc354, making the change for
the riscv pmap.
2024-08-30 16:39:56 -03:00
Olivier Cochard-Labbé
080c85127e mixer(8) tests: Fix cleanup routine
The tests correctly skip if no snd_dummy neither mixer is found, but the
cleanup is still called with the skip condition, which fails if there is
no mixer.

MFC after:		2 days
Reviewed by:		christos
Differential Revision:	https://reviews.freebsd.org/D46491
2024-08-30 20:23:29 +03:00
Jose Luis Duran
973bbdab47 mk: Add a BTI-report linker feature
Add support for specifying how to report the missing Branch Target
Identification (BTI) linker feature on AArch64.

For:

Kernel:    bti-report on when the linker supports it
Userspace: bti-report on when the linker supports it and
           BTI_REPORT_ERROR is defined

Fixes:	43e8849bc2 ("conf: Enable BTI checking in the arm64 kernel")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1393
2024-08-30 16:03:17 +00:00
Navdeep Parhar
9fdb683d92 cxgbe/iw_cxgbe: Fail early in some callbacks when the RNIC is stopped.
Stop allocating new resources when the RNIC is stopped but continue to
allow previously allocated resources to be freed.  Note that t4_tom's
uld_stop tears down all TOE connections, including those being used for
iWARP, and that triggers the cleanup of iWARP resources.

Fail post_send/post_recv early too to avoid the SQ doorbell.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-30 08:31:45 -07:00
Mark Johnston
28294dc924 Revert "ipsec: Drain async ipsec_offload work when destroying a vnet"
This change can cause a deadlock in some cases, since it's possible for
VNET teardown to happen in the context of taskqueue_thread, and
ipsec_accel_sync() drains taskqueue_thread's work queue.

This reverts commit e196b12f4d.
2024-08-30 15:00:16 +00:00
Olivier Certner
06986e8999
pam_xdg: Fix user xdg runtime directory's descriptor leak
Fixes:          6e69612d5d ("pam: Add pam_xdg module")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2024-08-30 16:08:14 +02:00