Commit graph

290263 commits

Author SHA1 Message Date
Zhenlei Huang
4fee8d3e92 mfi(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 701308ef404f552034f8c3e3e912b41bfef28ee6)
2024-09-30 12:44:24 +08:00
Zhenlei Huang
0fa8566510 mana: Stop checking for failures from malloc/mallocarray/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 1dc7a7b74b5ad37ff7c8dc22f1a710460a5f1dcd)
2024-09-30 12:44:24 +08:00
Zhenlei Huang
ec68da0a7e iser(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 40a6bbc4284111790d9240f8a24ef11a9a9ecb07)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
bb8c6f4325 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

(cherry picked from commit 5f97656fa334b494d70866cb1bfff406d3efd92d)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
e4de0a965f hptrr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 92b0370ec65d5287a1deec84fd513e320a8da736)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
c860df902b hptnr(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit a3ec5d3ee7579a26790a86ca4c074512946ab964)
2024-09-30 12:44:23 +08:00
Zhenlei Huang
0341c77f20 hpt27xx(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 28e413a699838df6fa5b0504c9ceb92a515037d9)
2024-09-30 12:44:22 +08:00
Zhenlei Huang
f3af527260 fwip(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 4d47c7ca7baa1ae76cc1fc72ec85b475f1efd41d)
2024-09-30 12:44:22 +08:00
Zhenlei Huang
6515ef4d2b flexspi: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit d1a89bd9b6eb1524902b619fa092c7d6de63e623)
2024-09-30 12:44:22 +08:00
Zhenlei Huang
e78c315e89 etherswitch: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 48741f4ceca71523aa1fa8da3bb78b184fad4aca)
2024-09-30 12:44:21 +08:00
Zhenlei Huang
8c2d777a22 ena(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 51971340bd3ff41591adbbfca68e9e753f6eb135)
2024-09-30 12:44:21 +08:00
Zhenlei Huang
95532d15a1 drm2: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 6dbf3aca4f5c4f7287f186360c2391f2adfea8d6)
2024-09-30 12:44:21 +08:00
Zhenlei Huang
09ed34449c 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

(cherry picked from commit 955b380365af174b3d35905b7b8afae97506a0bd)
2024-09-30 12:44:21 +08:00
Zhenlei Huang
9216ba1853 cxgb(4): Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit bb51f7c8a48a4cd5dfa67fefa81f3d5d199da92b)
2024-09-30 12:44:20 +08:00
Zhenlei Huang
e763c326fc bnxt(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit dcd387aaa5d4409a7e99376e0254029fce1a48a8)
2024-09-30 12:44:20 +08:00
Zhenlei Huang
3db5be6821 axgbe: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit ab0b996bddd96300d56b7d2aa830e2479cdfa92b)
2024-09-30 12:44:20 +08:00
Zhenlei Huang
8c2748b922 ath(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 3fdf587ab02f33018bd042094e3d0bd4169352ed)
2024-09-30 12:44:19 +08:00
Zhenlei Huang
66bb507ccb altera: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit e06e2c84074740a0087193d5929d09f1bc7e1c4b)
2024-09-30 12:44:19 +08:00
Zhenlei Huang
74887e3221 al_eth: Stop checking for failures from malloc/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 00ae9c1be02e2db6ede1abd5b787bb9a3fbd76b0)
2024-09-30 12:44:19 +08:00
Zhenlei Huang
49995f771b smmu: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit f75ceecad2157a0d3aca61a4893ab78f2dec21ee)
2024-09-30 12:44:18 +08:00
Zhenlei Huang
53b7927116 cmn600: Stop checking for failures from malloc/mallocarray(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 1d321c1907c210a33192ff5293f5c23554c96867)
2024-09-30 12:44:18 +08:00
Zhenlei Huang
920288c329 arm ti: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit fe6985ef87e1aedf8e5c9b3b959c7dd54a03e2fe)
2024-09-30 12:44:18 +08:00
Zhenlei Huang
6a0ed6fe27 tests: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit aac6c41d4ba9b0a1aef561f6c4bfd284ab369ebf)
2024-09-30 12:44:18 +08:00
Zhenlei Huang
905d5420ee krping: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 66c35a6675ff987b52a2018871231658b1980a6c)
2024-09-30 12:44:17 +08:00
Zhenlei Huang
7bea79c1ab 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

(cherry picked from commit 7bcb1228558b4325fab39616e2e3b2573a9e7da6)
2024-09-30 12:44:17 +08:00
Zhenlei Huang
3d5e539b1f xdr: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 7a720bf67d73ba565a0a1130065f798870eb5faa)
2024-09-30 12:44:16 +08:00
Zhenlei Huang
ce70888084 netsmb: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 6e50988cf822f87a524b8da2fdc35b234078cc2f)
2024-09-30 12:44:16 +08:00
Zhenlei Huang
a0c4498478 pf: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 5b00557330b3b69db84969e33f2e201288208dd9)
2024-09-30 12:44:16 +08:00
Zhenlei Huang
6797118168 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

(cherry picked from commit 07b16b1e2aeab0b30f68a013de31a4c322a61246)
2024-09-30 12:44:15 +08:00
Zhenlei Huang
891fdd020a 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

(cherry picked from commit 2a119886630bb5fe8283e20db5acb7c0cdba31c3)
2024-09-30 12:44:15 +08:00
Zhenlei Huang
a77e68b014 udf: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 3feb35dc465a8247d70e50792680c230954ef1c1)
2024-09-30 12:44:15 +08:00
Zhenlei Huang
d2d4758456 ctl: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 8e6dd4185871cd9b785869178ab2191a0d6c0b53)
2024-09-30 12:44:14 +08:00
Zhenlei Huang
44a6f9c9a0 subr_bus: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 99e3bb555cb1ef5572de54be0ffed2aa6fc080cd)
2024-09-30 12:44:14 +08:00
Zhenlei Huang
ab31454019 boottrace: Stop checking for failures from realloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit f444db950e877596805aed897c3fbb975be28711)
2024-09-30 12:44:13 +08:00
Zhenlei Huang
fbaf480651 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

(cherry picked from commit 6a2a385507c79abaa9db9eabfdd827362f3dc7ed)
2024-09-30 12:44:13 +08:00
Ed Maste
99d3ce80ba linuxulator: ignore AT_NO_AUTOMOUNT for all stat variants
Commit ff39d74aa9 ignored AT_NO_AUTOMOUNT for statx(), but did not
change fstat64() or newfstatat(), which also take an equivalent flags
argument.  Add a linux_to_bsd_stat_flags() helper and use it in all
three places.

PR:		281526
Reviewed by:	trasz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46711

(cherry picked from commit 3cf834d069d1dcdbe464ea74624930eaf916715d)
2024-09-29 18:37:02 -04:00
Kristof Provost
e3a9f4123f libpfctl: ensure we return useful error codes
Return errno rather than -1 on error. This allows pfctl to report much
more useful errors.

Reported by:	Alexander Leidinger <Alexander@Leidinger.net>
MFC after:	1 week

(cherry picked from commit 93e96359c980ccf318fe089b30b863f7c910b622)
2024-09-29 20:29:50 +02:00
Colin Percival
a651978fc4 loader: Load platform entropy even without menu
In 5c73b3e0a3 calls to core.loadEntropy were added to core.boot
and core.autoboot; but neither of those is invoked if we disable
the "beastie" menu.  Add a core.loadEntropy call to the no-menu
path.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Amazon
Fixes:	5c73b3e0a3 ("Add support for getting early entropy from UEFI")
Differential Revision:	https://reviews.freebsd.org/D46637

(cherry picked from commit 74a28cf6e7f66c7c12fd25ee8231eeedf756bf08)
2024-09-29 08:24:53 -07:00
Colin Percival
82ade8ed7e EC2: Set entropy_efi_seed_size to 64
This dramatically improves boot speeds on Graviton 2 instances.

MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46636

(cherry picked from commit 714a6d436819d446e01d1e4741fbe1089a23fe57)
2024-09-29 08:24:52 -07:00
Colin Percival
f470543a65 loader: Expand EFI entropy if < 2048 bytes
The EFI RNG on some platforms takes a long time if we request 2048
bytes of entropy, so we would like to request less; but our kernel
Fortuna RNG needs to be fed 2048 bytes in order to consider itself
"fully seeded".  If we have between 64 bytes (the size of a single
Fortuna pool and enough to guarantee cryptographic security) and
2048 bytes (what Fortuna wants) then the boot process will hang
waiting for more entropy despite in fact having enough to operate
securely.

Since 64 bytes of entropy is plenty to be cryptographically secure
(an attack of cost ~ 2^128 is infeasible, which implies a mere 16
bytes of entropy), use PBKDF2 (aka pkcs5v2_genkey_raw) to spread
the entropy across 2048 bytes.  This is secure since PBKDF2 has
the property that every subset of output bytes has within O(1) of
the maximum possible amount of entropy.

Reviewed by:	pjd
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46635

(cherry picked from commit c8ebbd28aa91705aea3a67b06018ea6aef5aa6e4)
2024-09-29 08:24:52 -07:00
Colin Percival
f216bddf84 loader: Make pkcs5v2 unconditionally available
This was previously only available if GELI support was included, but I
want to use it for processing entropy from EFI

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46634

(cherry picked from commit 925f15731e3480fe80f580a2f7463cb5210a95c8)
2024-09-29 08:24:52 -07:00
Colin Percival
8d2d49bdb5 pkcs5v2: Add pkcs5v2_genkey_raw function
This is like pkcs5v2_genkey but takes a "passphrase" as a buffer and
length rather than a NUL-terminated string.

Reviwed by:	pjd
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46633

(cherry picked from commit 8ce291a335bc751e7a89691eebfb9f9da65b82ac)
2024-09-29 08:24:52 -07:00
Colin Percival
0a8ff19896 loader: Make EFI entropy size configurable
Add a new loader variable entropy_efi_seed_size which defaults to 2048;
if not defined (e.g. if the /boot/lua/ is updated but /boot/defaults/
isn't) the same 2048 default will be used.

Reviewed by:	Val Packett
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46632

(cherry picked from commit f4a69a933cd645e384b337db5ef2ccf41a1ddd5b)
2024-09-29 08:24:52 -07:00
Colin Percival
0d348c621f loader: Instrument EFI GetRNG with TSLOG
On some systems, the EFI GetRNG is slow.  Make it show up in flamecharts.

MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46631

(cherry picked from commit b58fe4eb29fbd3236df0f7fdfad4393d2536dbb5)
2024-09-29 08:24:52 -07:00
Colin Percival
a9f4736326 loader: Add TSLOG to interpreter built-ins
Wrap each call to a built-in command with TSENTER/TSEXIT to make
it easier to see where time is going in the loader.

MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46630

(cherry picked from commit 58ec2d0d4a3c3bcf741d9694dc7696c7b4e753b9)
2024-09-29 08:24:52 -07:00
Colin Percival
0e9cdcc514 random: Avoid magic numbers
Move RANDOM_FORTUNA_{NPOOLS,DEFPOOLSIZE} from fortuna.c to fortuna.h
and use RANDOM_FORTUNA_DEFPOOLSIZE in random_harvestq.c rather than
having a magic (albeit explained in a comment) number.  The NPOOLS
value will be used in a later commit.

Reviewed by:	cem
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46693

(cherry picked from commit 32fce09268ddd97efb4412529ba57293554c5985)
2024-09-29 08:24:52 -07:00
Kevin Bowling
a112b062e0 e1000: drop NEEDGIANT from em_sysctl_debug_info use
The write is only used to toggle the debug print function and this is
otherwise stateless.

(cherry picked from commit 5f6964d9fbf663f85ee60dae7dfff153b82759d8)
2024-09-28 20:56:34 -07:00
Kevin Bowling
c16093be8a e1000: drop NEEDGIANT on em_sysctl_reg_handler uses
These are simple singular diagnostic register reads

(cherry picked from commit c11a0649b97281699e39d0fc82818f235c1dfb87)
2024-09-28 20:56:34 -07:00
Kevin Bowling
0c730611ed ixgbe: fix misleading indentation in ixgbe_phy
(cherry picked from commit e3a6e916dbbade2d4047e127c371ee0d0a25a294)
2024-09-28 20:56:34 -07:00
Kevin Bowling
1dd49c09ef e1000: remove NEEDGIANT from a couple sysctls
These are internally locked already

(cherry picked from commit f6e1b567921187b9331bd71c86e94cf232dd7761)
2024-09-28 20:56:34 -07:00