Commit graph

293609 commits

Author SHA1 Message Date
Zhenlei Huang
5f97656fa3 ice(4): Stop checking for failures from malloc(M_WAITOK)
As a consequence now ice_alloc_vsi_qmap() does not fail. Remove unneeded
error checks.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:29 +08:00
Zhenlei Huang
92b0370ec6 hptrr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:29 +08:00
Zhenlei Huang
a3ec5d3ee7 hptnr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:29 +08:00
Zhenlei Huang
28e413a699 hpt27xx(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:28 +08:00
Zhenlei Huang
4d47c7ca7b fwip(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:28 +08:00
Zhenlei Huang
d1a89bd9b6 flexspi: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:27 +08:00
Zhenlei Huang
48741f4cec etherswitch: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:27 +08:00
Zhenlei Huang
51971340bd ena(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:26 +08:00
Zhenlei Huang
6dbf3aca4f drm2: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:26 +08:00
Zhenlei Huang
955b380365 cxgbe(4): Stop checking for failures from malloc/mb_alloc_ext_pgs(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:26 +08:00
Zhenlei Huang
bb51f7c8a4 cxgb(4): Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:25 +08:00
Zhenlei Huang
dcd387aaa5 bnxt(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:25 +08:00
Zhenlei Huang
ab0b996bdd axgbe: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:25 +08:00
Zhenlei Huang
3fdf587ab0 ath(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:24 +08:00
Zhenlei Huang
e06e2c8407 altera: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:24 +08:00
Zhenlei Huang
00ae9c1be0 al_eth: Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:23 +08:00
Zhenlei Huang
f75ceecad2 smmu: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:23 +08:00
Zhenlei Huang
1d321c1907 cmn600: Stop checking for failures from malloc/mallocarray(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:22 +08:00
Zhenlei Huang
fe6985ef87 arm ti: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:22 +08:00
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