Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync dev to main #2295

Open
wants to merge 10,000 commits into
base: main
Choose a base branch
from
Open

Sync dev to main #2295

wants to merge 10,000 commits into from

Conversation

bsdjhb
Copy link
Collaborator

@bsdjhb bsdjhb commented Jan 21, 2025

No description provided.

kprovost and others added 30 commits January 11, 2025 10:30
Fix a 'case AF_INET;' typo, and ensure we include 'opt_inet6.h' so #ifdef INET6
actually works.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
MFC after:	3 days
These are internally locked already

MFC after:	1 week
These are simple singular diagnostic register reads

MFC after:	1 week
The write is only used to toggle the debug print function and this is
otherwise stateless.

MFC after:	1 week
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
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
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
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
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
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
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
This dramatically improves boot speeds on Graviton 2 instances.

MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46636
In 5c73b3e 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:	5c73b3e ("Add support for getting early entropy from UEFI")
Differential Revision:	https://reviews.freebsd.org/D46637
Reviewed by:	emaste
Fixes: 35e492f ("Update list of Conexant and Realtek codecs.")
Differential Revision: https://reviews.freebsd.org/D45965
Guests must set HDAC_CORBWP less than corb->size.  Treat invalid values
as an error rather than entering an infinite loop.

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-12
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46134
Different types of interrupts may require using different exception
vectors so this commit adds support multiple interrupt roots to handle
these cases. Archs may opt-in to multiple interrupt roots by defining
INTR_ROOT_NUM as the number of roots in their intr.h. Based off
https://reviews.freebsd.org/D40161.

Signed-off-by: Ayrton Munoz <[email protected]>
Co-authored-by: Kyle Evans <[email protected]>
Co-authored-by: Andrew Turner <[email protected]>
Reviewed-by: imp,mmel,mhorne
Pull-Request: freebsd/freebsd-src#1363
arm64 supports FIQs, fast interrupt requests, which are required by
Apple silicon which hardwires the ARM timers to FIQs. This is needed by
the upcoming Apple Interrupt Controller. Based on work by andrew@ and
kevans@ in https://reviews.freebsd.org/D40161.

Signed-off-by: Ayrton Munoz <[email protected]>
Co-authored-by: Kyle Evans <[email protected]>
Co-authored-by: Andrew Turner <[email protected]>
Reviewed-by: imp,mmel,mhorne
Pull-Request: freebsd/freebsd-src#1363
…utput"

This reverts commit 94567c8.

This breaks normal netstat output. It's kinda tricky to do a quick fix
on, so revert this until that can be fixed. If via github, please
open a new pull request...

Sponsored by:		Netflix
Pull Request: freebsd/freebsd-src#1331
The "%lld" format string was used with a value of type long.
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278532.

Reviewed by: imp, mmel
Pull Request: freebsd/freebsd-src#1344
Be more specific about where this is used.

Sponsored by:		Netflix
Allocate the 'bogus_page' page using VM_ALLOC_NOFREE since
it never gets released.

Differential Revision:	https://reviews.freebsd.org/D46699
Reviewed by:	alc, markj, kib
This page was getting pulled into `apropos unix` results due to
arguments being on the same line as a name macro in synopsis.
While here, tag spdx, fold a line slightly better, add loader.efi(8)
to see also and fix it's order.

MFC after:	3 days
Reviewed by: imp
Pull Request: freebsd/freebsd-src#1430
Correct implementation also found in Linux's soundcard.h:
https://github.com/torvalds/linux/blob/master/include/uapi/linux/soundcard.h#L1178

seq_processevent() interprets event[1] as device number and does not
work properly with current SEQ_SYSEX() implementation.

Note: soundcard.h has its own funky style, which this commit follows

Reviewed by: imp, christos
Pull Request: freebsd/freebsd-src#1374
Pass the right encap flag to network card

Sponsored by:	NVidia networking
MFC after:	1 week
Toomas Soome and others added 26 commits January 11, 2025 23:30
fsize is using 2 bytes for cluster number, but with fat32 we
actually do have 4 bytes and with large disks the high bytes will be in use.

illumos issue: https://www.illumos.org/issues/16821

Sponsored by:	MNX Cloud, Inc.
MFC after:	1 week
When soft updates began being enabled by default that change carried
over to mdmfs(8) which does not want or need them. This fix ensures
that they are only enabled in mdmfs(8) when requested with the -U flag.

Reported by: Ivan Rozhuk
Tested by:   Ivan Rozhuk
PR:          279308
MFC after:   1 week
These are all local diffs that have no functional change.

Reviewed by:	mav, emaste
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D46530
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

There was a small misunderstanding about the mdoc format: a 1-line
enclosure does not need a closing tag.  For example, Pc is for closing
an Po; if a line uses Pq (enclose the remainder of this line), there's
no need for Pc.

Signed-off-by:	Graham Percival <[email protected]>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	freebsd/freebsd-src#1434
These were reported by `mandoc -T lint ...` as errors; this commit only
handles unnecessary .Ed commands.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <[email protected]>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	freebsd/freebsd-src#1435
The intended value is:
    -offset indent
If there's any typo such that the value doesn't match the pre-defined
strings, then the offset is the same width as the value.  So by chance,
"-offset -ident" ended up being a standard-width indent (since the
default indent is 6 chars, and "-ident" also has 6 chars), whereas
"-offset -indent" had a longer indent, and "-offset ident" had a shorter
one.

Signed-off-by:	Graham Percival <[email protected]>
Reviewed by:	mhorne, Alexander Ziaee <[email protected]>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	freebsd/freebsd-src#1436
In the explanation section sglist_append_mbuf is duplicated. The
second reference is meant to be sglist_append_single_mbuf.

Approved by:	mhorne (src)
Pull Request:	freebsd/freebsd-src#1439
The function hda_codec_command is vulnerable to buffer over-read, the
payload value is extracted from the command and used as an array index
without any validation.
Fortunately, the payload value is capped at 255, so the information
disclosure is limited and only a small part of .rodata of bhyve binary
can be disclosed.

The risk is low because the leaked information is not sensitive. An
attacker may be able to validate the version of the bhyve binary using
this information disclosure (layout of .rodata information, ex:
jmp_tables) before executing an exploit.

Reported by:	Synacktiv
Reviewed by:	christos, emaste
Security:	HYP-13
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46098
Without this patch, vdevs faulted via AUX state would not be replaced
once the appropriate drive is replaced.  ZFS does not internally use
that state, but a drive can be manually forced into such a state with a
command like zinject.

Submitted by:	Goran Mekić <[email protected]>
Sponsored by:	ConnectWise
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D46866
When we find a SPCR (Serial Port Console Redirection) TABLE, print all
the details. This includes support for the recent Revision 3 and
Revision 4 tables, though I've not encountered them in the wild yet, so
that code is untested.

https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table

Sponsored by:		Netflix
The virtio_scsi device allows a VM guest to directly send SCSI commands
(ctsio->cdb array) to the kernel driver exposed on /dev/cam/ctl
(ctl.ko).

All kernel commands accessible from the guest are defined by
ctl_cmd_table.

The command ctl_persistent_reserve_out (cdb[0]=0x5F and cbd[1]=0) allows
the caller to call malloc() with an arbitrary size (uint32_t). This can
be used by the guest to overload the kernel memory (DOS attack).

Reported by:    Synacktiv
Reviewed by:	asomers
Security:       HYP-08
Sponsored by:   The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46044
tmpfs_seek_data_locked should return the offset of the first page
either resident in memory or in swap, but may return an offset to a
nonresident page. Check for residence to fix that.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D46879
In libpcap 1.10.5, two structures that we relied on, pcap_timeval and
pcap_sf_pkthdr, were made private.  As a workaround, we initially
defined the structures in pflogd.h.  After further investigation, mostly
by kp@, we concluded that it is reasonable to define these structures
ourselves since they represent a file format and thus are unlikely to
change from under us.  We will stick with this solution but move the
definitions out of the header file to prevent others from using pflogd.h
to access them.

Another solution that was considered was using libpcap's pcap_dump()
function to write packets, but there are blockers.  For example, pflogd
writes to a memory buffer, and libpcap lacks support for this.

Reviewed by:	kp
MFC after:	3 days
Event:		EuroBSDCon 2024
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46894
These add alternative behaviour to some floating-point instructions
so don't need any kernel support and can just be exposed to userspace.

Sponsored by:	Arm Ltd
We haven't seen bug reports relating to this feature for a while, so
stop printing a warning.

Reviewed by:	cperciva
MFC after:	2 weeks
In general it's not safe to drop the topology lock in these routines, as
GEOM assumes that the mesh will be consistent during traversal.
However, there's no reason we can't hold the topology lock across calls
to g_gate_release().  (Note that g_gate_hold() can be called with the
topology lock held.)

PR:		238814
MFC after:	2 weeks
We were previously unconditionally adding PROT_WRITE to the maxprot of
private mapping (because a private mapping can be written even if the
fd is read-only), but this might violate the user's PROT_MAX request.

While here, rename cap_maxprot to max_maxprot.  This is the intersection
of the maximum protections imposed by capsicum rights on the fd (not
really relevant for private mappings) and the user-required maximum
protections (which were not being obeyed).  In particular, cap_maxprot
is a misnomer after the introduction of PROT_MAX.

Add some regression test cases.  mmap__maxprot_shm fails without this
patch.

Note: Capsicum's CAP_MMAP_W is a bit ambiguous.  Should it be required
in order to create writeable private mappings?  Currently it is, even
though such mappings don't permit writes to the object referenced by the
fd.

Reported by:	brooks
Reviewed by:	brooks
MFC after:	1 month
Fixes:		c7841c6 ("Relax restrictions on private mappings of POSIX shm objects.")
Differential Revision:	https://reviews.freebsd.org/D46741
Add support for RME AO4S/AI4S extension cards. They are designed as a bracket
with 4 stereo TRS jacks each.

https://archiv.rme-audio.de/download/ao4s192_e.pdf
https://archiv.rme-audio.de/download/ai4s192_e.pdf

Reviewed by: Florian Walpen <[email protected]>
Differential Revision: https://reviews.freebsd.org/D46409
Fix unified pcm mode after support for the AO4S-192 and AI4S-192
extension boards was added. Adjust the man page accordingly.

Reviewed by:	br
Differential Revision:	https://reviews.freebsd.org/D46946
Create an additional 4 channel pcm device for RME HDSP 9632 sound cards,
to support the optional AO4S-192 and AI4S-192 extension boards. For
simplicity, the <HDSP 9632 [ext]> pcm device is always present, even if
the extension boards are not installed.

Unfortunately I cannot test this with actual hardware, but I made sure
the additional channels do not affect the functionality of the HDSP 9632
as currently in src.

Reviewed by: christos, br
Differential Revision: https://reviews.freebsd.org/D46837
SHM_REMAP was incorrectly defined to 030000 which collides with
SHM_RDONLY and SHM_RND.  Renumber to 040000 (incidentally matching
Linux).

This is an ABI break, but the previous ABI was unusable (SHM_REMAP would
imply SHM_RDONLY and vice versa).  Fortunately SHM_REMAP has very few
consumers in the wild (I spotted openjdk for Linux, libfabric, MIPCH,
and one other MPI thing in Debian code search)

Reviewed by:	kib
Fixes:		ea7e700 Implement shmat(2) flag SHM_REMAP.
Differential Revision:	https://reviews.freebsd.org/D46825
Fixes:		2201f7c Build BSD diff3 if GNU diff3 is disabled.
Explicitly disable executable stacks in the syscall stubs on all
architectures.  Previously, aarch64 and riscv64 didn't include the
.note.GNU-stack note due it being disabled by default in those ABIs.

This appears to have been harmless in practice, but better to be clear
in case a different compiler/linker has different defaults.  This also
reduces special cases in the Makefile.

Reported by:	jrtc27
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44883
@bsdjhb bsdjhb requested a review from brooksdavis January 21, 2025 02:11
@bsdjhb
Copy link
Collaborator Author

bsdjhb commented Jan 21, 2025

This is the current tip of dev, but it has also been on dev for about a week.

@bsdjhb
Copy link
Collaborator Author

bsdjhb commented Jan 31, 2025

Backed up one since the random change broke booting for some RISC-V FPGA cores in CI (which is fixed in dev now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.