Commit Graph

309150 Commits

Author SHA1 Message Date
Kyle Evans 4d4acdbfc2 stat: fix use of devname(3)
Besides being a little hard to parse through visually, this had its own
bug of inspecting st->st_mode to determine what to pass to devname(3),
which is only correct for st_rdev.

For st_dev, you're likely to be looking at files or directories and
attempting to assess what device they're located on, so the mode is
meaningless- we just have to assume that our filesystems are on
character devices and attempt to resolve st_dev as such.

Reviewed by:	des, kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D56565
2026-04-30 22:00:37 -05:00
Kyle Evans 910f78a514 tests: fix remaining test failures under _FORTIFY_SOURCE
The getgroups test is a NetBSD tests, so just apply our larger hammer
and disable the feature entirely.  The audit test can take a more
surgical approach and use __ssp_real() appropriately, since it's a local
one.

PR:		294881
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56735
2026-04-30 21:58:48 -05:00
Kyle Evans d98f4f0698 ssp: fix our gets_s implementation under _FORTIFY_SOURCE
Annex K specifies an interface for handling constraint violations from
gets_s, but we previously broke this for some classes of get_s misuse.

Provide a more nuanced version that tries to dodge errors that would
trigger a constraint handler while still providing value.  Notably, we
don't want to trigger a failure unless the passed-in length reasonably
fits within an RSIZE_MAX, because gets_s will immediately call larger
lengths bogus and fail.

PR:		294881
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56734
2026-04-30 21:58:48 -05:00
Kyle Evans c46a0b5907 build: provide a FORTIFY_SOURCE.<src file> override
For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them.  NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.

This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.

PR:		294881
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56733
2026-04-30 21:58:48 -05:00
Konstantin Belousov 839d3266d8 uipc_shm.c: make large page allocation interruptible
in cases there is no page pressure or when the user lost patience
waiting for very large allocation.  Other case is already handled by
vm_wait_intr().

Reported by:	"Lizzie from Eden Emulator project"
Reviewed by:	adrian, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56725
2026-05-01 04:06:42 +03:00
Cy Schubert 8f46ba0651 krb5: Adjust version to 1.22.2
Fixes:		736e411a73
2026-04-30 17:57:39 -07:00
Cy Schubert c9dd7bffa5 krb5: Fix two NegoEx parsing vulnerabilities
Bring in upstream commit 2e75f0d93 fixing two CVEs. Upstream commit
log is:

 In parse_nego_message(), check the result of the second call to
 vector_base() before dereferencing it.  In parse_message(), check for
 a short header_len to prevent an integer underflow when calculating
 the remaining message length.

 Reported by Cem Onat Karagun.

 CVE-2026-40355:

 In MIT krb5 release 1.18 and later, if an application calls
 gss_accept_sec_context() on a system with a NegoEx mechanism
 registered in /etc/gss/mech, an unauthenticated remote attacker can
 trigger a null pointer dereference, causing the process to terminate.

 CVE-2026-40356:

 In MIT krb5 release 1.18 and later, if an application calls
 gss_accept_sec_context() on a system with a NegoEx mechanism
 registered in /etc/gss/mech, an unauthenticated remote attacker can
 trigger a read overrun of up to 52 bytes, possibly causing the process
 to terminate.  Exfiltration of the bytes read does not appear
 possible.
2026-04-30 17:11:25 -07:00
Cy Schubert 736e411a73 krb5: import MIT 1.22.2
Merge commit '90c687295e2d62f9411fc5b571f5af4e8ee187a7'
2026-04-30 17:10:53 -07:00
Adrian Chadd 6a0610cb50 powerpc/pic: fix the openpic CPU logic to work on powermac
Earlier work (40bcad56f - powerpc/pic: Add a PIC_AP_INIT() to
set up AP PIC info) broke booting my dual G5 powermac.

After much digging, jhibbits@ and I discovered that the openpic
implementation for the memory/bus controller used in the G5 CPUs
doesn't implement /all/ of the openpic specification.
Notably it sticks the WHOAMI register in a different location.
This is reading 0x0 back for all the PICs which is .. very not great.

So to restore the previous behaviour, use a quick for now that jhibbits@
can set appropriately to trust WHOAMI.

I've tested this on my dual G5 PPC and it boots/runs fine.

Fixes: 40bcad56f

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D56751
2026-04-30 17:07:48 -07:00
Pouria Mousavizadeh Tehrani 39b19ce77b route(8): Add route get for multipath routes with -o flag
Get the next hops of the specified route.
route.8 manual will be updated when other actions for
this option are implemented.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56191
2026-05-01 01:36:31 +03:30
Pouria Mousavizadeh Tehrani 23b8d16c66 tests/netlink: Add nexthop group tests for multipath
Added tests:
* Test for creating multiple routes.
* Test for merge multiple nexthops into a single nexthop group.
* Test for nexthop expirations from a nexthop group.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56190
2026-05-01 01:36:20 +03:30
Pouria Mousavizadeh Tehrani 8a64738f5a routing: Expire nhops inside the nhgrp
Fix route expiration of nhops that exists inside a nhgrp.

Differential Revision: https://reviews.freebsd.org/D56189
2026-05-01 01:36:07 +03:30
Pouria Mousavizadeh Tehrani 84bb3648d2 netlink: Fix RTA_MULTIPATH on RTM_GETROUTE
Before this patch, netlink never returned RTA_MULTIPATH.
Also, add RTA_MULTIPATH attribute in way that don't confuse
non-mpath support consumers.

Differential Revision: https://reviews.freebsd.org/D56188
2026-05-01 01:35:44 +03:30
Pouria Mousavizadeh Tehrani dd945c6ba4 routing: Implement merge of nhgrp in new multipath route
Routing subsystem allows creating new multipath routes by
nexthop groups (e.g RTA_MULTIPATH in netlink), in case of
a second nexthop group on the same route, don't panic and
merge the existing nhgrp with new one.

Reviewed by: melifaro (except one comment)
Differential Revision: https://reviews.freebsd.org/D56187
2026-05-01 01:35:32 +03:30
Rick Macklem 71ac1ec5c9 nfscl: Disable use of callbacks for NFSv4.0
The only use for callbacks for NFSv4.0 is delegations
and delegations rarely work well for NFSv4.0 anyhow.

Therefore, this patch disables callbacks for the
NFSv4.0 client.  This is the same behavior as
occurred when the nfscbd(8) daemon was not running.

This change allowed a function called nfscl_getmyip()
to be removed from the kernel, which is nice since
maintaining this function was bothersome, due to its
use of routing, etc.

MFC after:	2 weeks
2026-04-30 14:43:04 -07:00
Michael Tuexen cf678e30ca devfs: add bpf example
Add an example for allowing members of the network group to read from
bpf devices. In particular, this allows members of the network group
to monitor traffic without running with root privileges.

Reviewed by:		markj, glebius
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D56742
2026-04-30 22:35:07 +02:00
Michael Osipov ea1764e5fc mfi(4)/mrsas(4): Set sysctl name for driver versions consistently
Instead of printing the driver version over and over again if multiple
controllers are used, set a sysctl name for the used driver version.

Approved by:	imp, ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D56110
2026-04-30 21:53:47 +02:00
Christos Margiolis 5e9f2a6aef sound: Retire unused snddev_info->bufsz
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-04-30 20:46:13 +02:00
Andre Albsmeier a723308555 dmesg(8): Add -t and -f options for converting timestamps
Kernel timestamps are relative to kern.boottime.
With -t, kern.boottime is added and converted to either
a default format or the one specified using the -f option.

Signed-off-by:	Andre Albsmeier <mail@ghub.e4m.org>
Reviewed by:	kib, pouria
Discussed with:	imp
Pull-Request:	https://github.com/freebsd/freebsd-src/pull/1985
2026-04-30 21:43:37 +03:30
Cy Schubert 90c687295e mport MIT 1.22.2 2026-04-30 11:06:28 -07:00
Jean-Sébastien Pédron 1569e2334a Bump __FreeBSD_version to 1600018 after linuxkpi changes for DRM 6.12.84
As of this commit, all changes to linuxkpi required by the DRM drivers
from Linux 6.12.84 were committed.

Sponsored by:	The FreeBSD Foundation
2026-04-30 19:54:30 +02:00
Dag-Erling Smørgrav 873a195ba6 dhclient: Improve server and filename validation
* Don't iterate over each string three times; once is enough.

* Reject control characters (anything below space) in addition to the
  double quote and backslash.

* If an unsafe character is encountered, discard the string instead of
  rejecting the entire lease.

* If backslashes are encountered in the file name option, convert them
  to forward slashes instead of rejecting the option.

* Tweak the warning messages a bit.  Looking through the rest of the
  code, it seems to me that notes generally end with a period while
  warnings generally don't.

Fixes:		8008e4b88d ("dhclient: Check for unexpected characters in some DHCP server options")
PR:		294886
MFC after:	1 week
Reviewed by:	brooks, markj
Differential Revision:	https://reviews.freebsd.org/D56740
2026-04-30 18:45:35 +02:00
Felipe Matarazzo 0e680203d5 fix typo: recieved -> received in test comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:19 -07:00
Felipe Matarazzo deb17abdef fix typos in rtsx.c comments: freqency and wich
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:19 -07:00
Felipe Matarazzo 092528b05d fix typo: writting -> writing in sack_filter
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:18 -07:00
Felipe Matarazzo a8cb5cb400 fix typo: remove extra 'the' in rack.c comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:17 -07:00
Felipe Matarazzo 0e235f7736 fix typo: seperate -> separate in tcp_ratelimit comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:17 -07:00
Felipe Matarazzo e1841a50d6 fix typo: lenght -> length in netlink comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:17 -07:00
Felipe Matarazzo 713332b4eb fix typo: duplicate 'the' in OP_NOTROOT comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:16 -07:00
Felipe Matarazzo 82525a8ead fix typo: remove duplicate 'the' in ffs_vfsops comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
2026-04-30 09:29:16 -07:00
Christos Margiolis 549e740619 snd_uaudio: Support Roland UA-33
Apply the appropriate quirk. Also, introduce a new uaudio_vendor_audio
table, similar to uaudio_vendor_midi, which includes non-standard USB
audio devices. The Roland UA-33 needs this, bceause it comes with
bInterfaceClass = 0xff (vendor-specific), so snd_uaudio(4) doesn't
detect it.

PR:		294814
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/24
2026-04-30 17:18:30 +02:00
Artem Bunichev 0ed292531e debug.sh.8: Add FILES section
Which contains only the source code file.

While here, remove trailing empty lines in the end of the page.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D56659
2026-04-30 10:49:52 -03:00
Mitchell Horne 16dd592982 ddb.4: add 'show preload' entry
For the recently added command.

Fixes:	b683fd0b32 ("preload: add "show preload" DDB command")
2026-04-30 10:24:04 -03:00
Jean-Sébastien Pédron eebb643bb3 sx: Add sx_has_waiters() macro
This macro will return non-zero if there are threads waiting for this
lock; otherwise, it will return zero.

The function assumes (but does not assert) that the caller already holds
the lock and that it is interested in other threads waiting for it to
release the lock.

The motivation to add this is the implementation of
`rwsem_is_contended()` in linuxkpi.

This Linux function indicates the same thing to the caller: if other
threads are waiting for this semaphore.

The amdgpu DRM driver started to use `rwsem_is_contended()` in Linux
6.12.

Reviewed by:	bz, olce
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56443
2026-04-30 13:40:05 +02:00
Jean-Sébastien Pédron 65dc0e9071 linuxkpi: Define VFM_*() macros in <asm/cpu_device_id.h>
They use another set of constants and macros in <asm/intel-family.h>.

All these macros are defined regardless of the architecture, even though
they are specific to x86. Perhaps we should restrict them using #ifdefs.

The amdgpu DRM driver started to used `VFM_MODEL()` and the
`INTEL_*LAKE*` constants in Linux 6.12.x.

Reviewed by:	bz, olce
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56585
2026-04-30 13:40:01 +02:00
Boris Lytochkin 6d65c91b9a etcupdate: fix arguments order of diff command
Due to misplacement of the second -L argument of diff command, it is
treated by getopt_long as an error.

Also add -l option for a diff command that alters the way it shows
differences. Instead of printing full diff, it reports changed file
the same way as added/removed files are reported.

Reviewed by:	imp
Obtained from:	Yandex LLC
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56708
2026-04-30 14:31:34 +03:00
Corvin Köhne 226b37dc3a dev/ichsmb: disable block buffer if supported
In order to improve the efficiency of block read/write calls, Intel has
introduced a block buffer. Instead of generating an interrupt after
receiving/sending a single byte, the data is buffered in the block buffer. It
allows the SMBus controller to generate a single interrupt for the whole
transfer. At the moment, we don't support that and don't expect the SMBus
controller to behave in that way. Unfortunately, BIOS code can also access the
SMBus controller and may enable the block buffer. Poorly written BIOS code may
also keep the block buffer enabled breaking our driver. Therefore, we should
check if the device supports a block buffer and disable it for every request
because we don't know if some BIOS code has reconfigured the SMBus controller
in between.

Reviewed by:		emaste
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Pull Request:		https://github.com/freebsd/freebsd-src/pull/2161
2026-04-30 11:15:18 +02:00
Corvin Köhne 75909086a4 bhyve: allow read/write to full CRB buffer
For some reason, we've incorrectly calculated the size of the CRB data buffer
register. There's no need to divide the CRB data buffer size by 4. We should
allow access to the whole buffer instead.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Pull Request:		https://github.com/freebsd/freebsd-src/pull/2169
2026-04-30 11:09:49 +02:00
Jean-Sébastien Pédron 713b4ce8ef linuxkpi: Add copy_from_user_inatomic_nontemporal() function
In Linux 7.1, `__copy_from_user_inatomic_nocache()` was renamed to
`copy_from_user_inatomic_nontemporal()`. This change was backported to
several LTS branches.

This includes Linux 6.12.x and the i915 DRM driver started to use it in
that version.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56719
2026-04-30 09:05:02 +02:00
Jean-Sébastien Pédron 796fff59a5 linuxkpi: Define DEFINE_XARRAY*() macros
The `DEFINE_XARRAY*()` macros are used to declare a static xarray.

As the structure embeds a mutex(9), we also need to declare the static
mutex after the `struct xarray`. Thus the slightly awkward definition
of `DEFINE_XARRAY_FLAGS()`.

The DRM generic code started to use `DEFINE_XARRAY_ALLOC()` in Linux
6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56446
2026-04-30 09:05:02 +02:00
Jean-Sébastien Pédron 783d018cf9 linuxkpi: Add struct xa_limit support to xarray
The `xa_alloc*()` functions family takes a `struct xa_limit` to describe
the range of IDs the caller wants to allocate. We were using a single
mask to qualify a maximum ID only.

This commit changes that to use the same `struct xa_limit`. The logic
did not change, except it now supports a minimum ID as well.

The definition of `XA_LIMIT()` macro is adapted, as well as the
definitions of `xa_limit_*` (only `xa_limit_32b` existed, the other two
are added with this commit).

The DRM generic code started to use this `struct xa_limit` in Linux
6.12.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56445
2026-04-30 09:05:01 +02:00
Stephen J. Kiernan b683fd0b32 preload: add "show preload" DDB command
This is the DDB equivalent of the debug.dump_modinfo sysctl which
outputs pretty-printed bootloader metadata.

Move sbuf_db_printf_drain to subr_prf.c and expose it for general use.

Reviewed By: jmg
Differential Revision: https://reviews.freebsd.org/D53763
2026-04-30 01:20:12 -04:00
Abdelkader Boudih e7f4269dbf asmc: replace hardcoded model table with universal probing
Probe SMC keys at attach time to detect hardware capabilities,
supporting all Intel Apple machines without per-model entries.

Sensors are discovered by scanning sorted SMC key ranges for
known prefixes and types. Capabilities such as SMS, fan safe
speed, and ambient light are detected by key presence.

A global key description table provides human-readable names
for well-known temperature sensors.

Tested on:
 - MacBook Pro (Early 2007, Mid 2014, Mid 2015)
 - MacBook Air (Early 2015, Mid 2017)
 - iMac (Mid 2011, Late 2013)
 - Mac mini (Mid 2011)

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56405
2026-04-29 17:38:38 -07:00
Justin Hibbits 59a844b9ce mpc85xx/msi: Add compat string for T208x/T4xxx SoCs 2026-04-29 20:14:35 -04:00
Justin Hibbits 0a705587e4 iicmux: Return the right error codes
I2C subsystem errors belong in the IIC_* error space.  It's pretty clear
this is what is intended in the code.
2026-04-29 20:14:19 -04:00
Justin Hibbits 787b5e1367 dtrace: Add missing file for powerpc kernel build 2026-04-29 20:14:19 -04:00
Justin Hibbits 605f53705d powerpc/openpic: Increase the maximum number of IRQs allowed
The Freescale MPIC supports up to 2048 IRQs, but since we only build an
array of 768 interrupts in intr_machdep, clamp the max at 512.  The most
any Freescale PowerPC chip actually supports is 452 on the T4240, so 512
is sufficient.

As part of this, increase the vector mask to the full openpic vector
mask, and use this limit as the terminator for the dispatch loop,
instead of a hard-coded 255.

Differential Revision:	https://reviews.freebsd.org/D56422
2026-04-29 20:13:48 -04:00
Justin Hibbits 40bcad56f1 powerpc/pic: Add a PIC_AP_INIT() to set up AP PIC info
pc_cpuid may not match the PIC's idea of a given CPU.  Since openpic
has a WHOAMI register, we can use that to get the PIC's idea of the CPU.
This needs to be done on each AP, so add a PIC_AP_INIT device method so
the PIC can perform any AP-specific initialization at AP bootstrap time.

This fixes SMP on e6500, which is still lacking SMT support.

Differential Revision:	https://reviews.freebsd.org/D56421
2026-04-29 20:13:48 -04:00
Andrew Gallatin 72e2ae505c tcp: release nic ktls send tags when entering time wait
When under heavy load or churn, inline ktls offload NICs may run out
of hardware resources described by ktls send tags.  Rather than
waiting for connections to pass through the time_wait state, reclaim
the ktls send tags early, at entry to time_wait. By preventing
potentially tens or hundreds of thousands of sessions from holding
send tags in time_wait, this allows more ktls sessions to be offloaded
to hardware.

Reviewed by: glebius, kib, nickbanks_netflix.com, rrs, tuexen
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D56610
2026-04-29 19:35:47 -04:00
Vincenzo Maffione 0216ea8598 netmap: check for possible out-of-bound write with options
Submitted by:	hari.thirusangu@sophos.com
MFC after:	2 weeks
2026-04-29 21:13:09 +00:00