Commit graph

293657 commits

Author SHA1 Message Date
John Baldwin
fcef359272 uart: Use uintptr_t instead of vm_offset_t for pointer arithmetic
Reviewed by:	imp
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D46490
2024-09-04 09:56:21 -04:00
Mariusz Zaborski
241a7ddd71 libnv: add tests to verify potential overflow issues
Differential Revision:  https://reviews.freebsd.org/D46131
2024-09-04 13:43:16 +02:00
Mariusz Zaborski
2981431e04 libnv: add test to verify null termination of string in array
Differential Revision:  https://reviews.freebsd.org/D46138
2024-09-04 13:43:07 +02:00
Mariusz Zaborski
3aaaca1b51 libnv: verify that string is null terminated
During unpacking, we ensure that we do not read beyond the
declared size. However, unpack uses a function that copies
null-terminated strings. Prior to this commit, if the last string
was not null-terminated, it could result in copying data into a
buffer smaller than the allocated size.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45288
Security:       CAP-03
Reported by:    Synacktiv
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46138
2024-09-04 13:42:55 +02:00
Mariusz Zaborski
36fa90dbde libnv: allocate buffer in a safe way
Ensure that the calculation of size of array doesn't
overflow.

Security:	FreeBSD-24:09.libnv
Security:	CVE-2024-45287
Security:	CAP-02
Reported by:	Synacktiv
Reported by:	Taylor R Campbell (NetBSD)
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46131
2024-09-04 13:42:49 +02:00
Ruslan Bukin
e29afe64ef riscv: fix csr_swap()
Fix csr_swap() macro so that we don't overwrite the argument (which is not
even possible when the argument is an immediate value)

Reviewed by: jrtc27

Differential Revision: https://reviews.freebsd.org/D46526
2024-09-04 10:08:40 +01:00
Konstantin Belousov
f76826b892 ipsec offload: use private taskqueue thread
Using global taskqueue_thread XXX with the vnet tasks scheduled during
VNET destruction.  VNET shutdown needs to wait for all vnet-scoped
SAs/SPs to be handled, and doing that from taskqueue_thread task
deadlocks because the same thread proceeds the removals.

Reviewed by:	markj
Sponsored by:	NVidia networking
Differential revision:	https://reviews.freebsd.org/D46494
2024-09-04 11:49:38 +03:00
Konstantin Belousov
1af77be327 ipsec_offlad: remove not needed IFP_HS_INPUT/OUTPUT flags
Calculate the hdr_ext_size unconditionally, it is kept unused for SAs
not handling the input.

Sponsored by:	NVidia networking
2024-09-04 11:49:38 +03:00
Konstantin Belousov
d02e1a3ffa ipsec_accel_output(): do not process packet if interface rejected offload
Sponsored by:	NVidia networking
2024-09-04 11:49:38 +03:00
Konstantin Belousov
957e389ca7 dev/mlx5: remove some duplicated macros from device.h
Sponsored by:	NVidia networking
2024-09-04 11:49:38 +03:00
Colin Percival
647299caa0 EC2: Add new "small" AMIs
These are the same as the standard "base" images except:

* They don't have kernel or world debug symbols,
* They don't have FreeBSD tests,
* They don't have 32-bit libraries,
* They don't have LLDB,
* They don't have the Amazon SSM Agent pre-installed,
* They don't default to installing the awscli at first boot.

This reduces the amount of disk space in use when the EC2 instance
finishes booting from ~5 GB to ~1 GB.

Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46509
2024-09-03 22:57:06 -07:00
Colin Percival
40ff0753ab EC2: Make amazon-ssm-agent optional
Move it from VM_EXTRA_PACKAGES in ec2.conf to VM_EXTRA_PACKAGES in
ec2-{base,cloud-init}.conf

Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46508
2024-09-03 22:57:06 -07:00
Colin Percival
f961ddb28d EC2: Move network config into a separate function
Having the "base" FreeBSD network configuration (aka. what is used
when not using cloud-init) in ec2.conf will allow us to reuse it in
other AMIs.

Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46507
2024-09-03 22:57:06 -07:00
Colin Percival
81d3df02bc vmimage.subr: Pass $INSTALLOPTS to install*
This makes it possible for a VM build configuration file to pass
options to make installworld/installkernel/distribution, e.g.
WITHOUT_DEBUG_FILES=YES in order to produce smaller images.

Note that these options are only applied at install time, not at
build time (since the same build is installed into many different
VM images), so not all src.conf options are usable here.

Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46506
2024-09-03 22:57:06 -07:00
Bjoern A. Zeeb
a84d91d81a mmccam: fix mmcsd disk aliases
For EXT_CSD_PART_CONFIG_ACC_BOOT<n> and possibly others with suffixes
we fail to create proper disk aliases (symlinks), which shows up as
g_dev_taste: make_dev_alias_p() failed (name=mmcsd0, error=17)

In this case we ended up with the followng two:
  /dev/mmcsd0 -> sdda0
  /dev/mmcsd1 -> sdda0boot1
Note that (i) it should be mmcsd0boot1 and not mmcsd1 and that
(ii) there is no mmcsd0boot0 (failed above as it tried to create a
second mmcsd0).

Adjust the code (using a highly simplified version--compared to my
original approach--suggested by imp) using an extended format string
with (sdda/mmcsd) prefix as first argument to create proper names.

MFC after:	3 days
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D43538
2024-09-03 21:38:24 +00:00
Jessica Clarke
18f7683e0d loader.efi.8: Remove rogue duplicated lines
Fixes:		871911a4ab ("loader.efi(8): beef up the updating the ESP")
MFC after:	1 week
2024-09-03 21:14:44 +01:00
John Baldwin
f5541f9f47 nvmfd/nvmft: Fix a typo "whiled" -> "while"
Sponsored by:	Chelsio Communications
2024-09-03 16:12:04 -04:00
Ed Maste
1b9cfd6a62 stand: bump arbitrary build date to 2024-01-01
For build reproducibility we set PE headers to an arbitrary timestamp.
Nothing in FreeBSD uses this timestamp, but bump it from 2016 to 2024 so
that the timestamp does not seem "too old" in case some third party tool
is used to inspect EFI boot components.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46527
2024-09-03 15:09:28 -04:00
Guy Harris
f8860353d4
tcpdump: ppp: Use the buffer stack for the de-escaping buffer
This both saves the buffer for freeing later and saves the packet
pointer and snapend to be restored when packet processing is complete,
even if an exception is thrown with longjmp.

This means that the hex/ASCII printing in pretty_print_packet()
processes the packet data as captured or read from the savefile, rather
than as modified by the PPP printer, so that the bounds checking is
correct.

That fixes CVE-2024-2397, which was caused by an exception being thrown
by the hex/ASCII printer (which should only happen if those routines are
called by a packet printer, not if they're called for the -X/-x/-A
flag), which jumps back to the setjmp() that surrounds the packet
printer.  Hilarity^Winfinite looping ensues.

Also, restore ndo->ndo_packetp before calling the hex/ASCII printing
routine, in case nd_pop_all_packet_info() didn't restore it.

Reviewed by:	emaste
2024-09-03 14:24:16 -03:00
Gordon Tetlow
fbd465f263
openssl: Bring over fix for CVE-2024-6119 from vendor/openssl-3.0.
Merge commit 'e60dbfd00b009d424dfc5446d132872c93dd0aed'
2024-09-03 09:49:23 -07:00
Poul-Henning Kamp
4dabfcb615 Typo.
Spotted by: ktullavik
2024-09-03 16:00:17 +00:00
Ed Maste
83325e7b73 beep: show error upon failure to open sound device
If beep cannot open /dev/dsp provide more information to aid the user
in diagnosing a problem.

Reviewed by:	christos
Sponsored by:	The FreeBSD Foundation
2024-09-03 10:27:43 -04:00
Olivier Certner
ad4cf76ec4
bitset: __BIT_FFS_AT(): Fix herald comment, take 2
Remove the reference to the nonexistent 'end' parameter.  While here,
rephrase a bit.

I did the initial comment fix (commit "bitset: Fix __BIT_FFS_AT()'s
herald comment", f3ab0d86e8) as part of an experiment introducing
macros to operate on ranges of bits in a bitset and subject to
a predicate (a generalization of some code used in some pending
modifications of the ULE scheduler), which was finally ditched as being
too verbose and impractical to use.  I however then forgot to remove the
reference to 'end'.

No functional change.

Noted by:       emaste
Approved by:    emaste (mentor)
MFC after:      3 days
MFC with:       f3ab0d86e8
Sponsored by:   The FreeBSD Foundation
2024-09-03 15:16:13 +02:00
Poul-Henning Kamp
ffaf862df6 Mention that SILI makes tcopy(1) slow on modern tape drives 2024-09-03 10:44:20 +00:00
Zhenlei Huang
7ea3fd3bb5 mxge(4): Stop checking for failures from taskqueue_create(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:38 +08:00
Zhenlei Huang
57cd8f27b7 liquidio(4): Stop checking for failures from malloc/taskqueue_create/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:38 +08:00
Zhenlei Huang
3fdef8e855 jme(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:38 +08:00
Zhenlei Huang
36ef39831f dpaa2: Stop checking for failures from malloc/taskqueue_create(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:37 +08:00
Zhenlei Huang
af28fc3c19 cas(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:37 +08:00
Zhenlei Huang
d44bc2f07b bge(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:36 +08:00
Zhenlei Huang
b29adaaf44 axgbe: Stop checking for failures from taskqueue_create(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:36 +08:00
Zhenlei Huang
f5524be39e ale(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:35 +08:00
Zhenlei Huang
0cd3976d07 alc(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:35 +08:00
Zhenlei Huang
5cece2c24b age(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:35 +08:00
Zhenlei Huang
3f3f3ca25b ae(4): Stop checking for failures from taskqueue_create_fast(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45853
2024-09-03 18:25:34 +08:00
Zhenlei Huang
778ea7ed5a vchiq(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:34 +08:00
Zhenlei Huang
f80483cdd5 sdhci(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:34 +08:00
Zhenlei Huang
59121599bb sound: Stop checking for failures from malloc(M_WAITOK)
Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:33 +08:00
Zhenlei Huang
761339c554 sume(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:33 +08:00
Zhenlei Huang
866dc4bd81 qat(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:32 +08:00
Zhenlei Huang
4fb8a80a78 pms(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:32 +08:00
Zhenlei Huang
a38d9ad473 mrsas(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:32 +08:00
Zhenlei Huang
849f9ac370 mpi3mr(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:31 +08:00
Zhenlei Huang
556cd18fb0 mlx(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:31 +08:00
Zhenlei Huang
701308ef40 mfi(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:31 +08:00
Zhenlei Huang
1dc7a7b74b mana: Stop checking for failures from malloc/mallocarray/buf_ring_alloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:30 +08:00
Zhenlei Huang
40a6bbc428 iser(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:30 +08:00
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