Commit Graph

309429 Commits

Author SHA1 Message Date
Mark Johnston eeffed5aa0 tests/if_carp: Run all tests with execenv=jail
Otherwise failures can occur when running tests in parallel since some
tests reuse jail names.

MFC after:	1 week
2026-05-19 14:29:12 +00:00
Kyle Evans 8dad29555a linuxkpi: fix 32-bit arm build
The new KPI is only used in <asm/set_memory.h>, but it's provided in
linux_page.c.  The latter only includes the former indirectly by way of
<linux/io.h>, and that's only conditionally included outside of 32-bit
ARM there.

All of our archs have the necessary pmap_page_set_memattr(), so just
move the declaration into <linux/page.h> instead of trying to reason
about the usability of <asm/set_memory.h> directly in linux_page.c.

Reported by:	jenkins (via ivy)
2026-05-19 08:47:35 -05:00
Abdelkader Boudih 65341ec317 snd_hda: Reassign duplicate HDMI/DP pin sequences instead of disabling
Some firmware (e.g. Apple EFI on Sandy Bridge Mac hardware) programs all
HDMI/DP output pins in an association with identical sequence numbers.

The existing code disables the entire association on the first
duplicate, leaving HDMI/DP audio non-functional.

For digital output pins (HDMI/DP) with seq=0 duplicates, search for the
next free sequence slot and reassign the duplicate rather than
disabling.

The seq=0 restriction targets the known Apple firmware pattern; any
other duplicate sequence is more likely a genuine firmware error and the
association is still disabled.

Update first after reassignment so that hpredir is not left pointing at
a stale sequence. Non-digital and input associations retain the existing
disable behaviour.

MFC after:	1 week
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D55473
2026-05-19 14:25:51 +02:00
Dag-Erling Smørgrav 1cfc208a07 tmpfs: Overhaul option handling on remount
On remount, we must accept all the same options as on initial mount.
For parameters which we're unable to modify on the fly, fail only if
the new value is different from the existing one.

PR:		295096
MFC after:	1 week
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D57044
2026-05-19 08:54:28 +02:00
Dag-Erling Smørgrav 4617a6cb82 nlist: Handle multiple symbol tables
* Instead of looking for and stopping at the first SHT_SYMTAB section,
  iterate over all SHT_DYNSYM and SHT_SYMTAB sections until we've either
  found all our symbols or run out.

* Perform bounds checks on section and string table offsets and sizes
  before attempting to mmap() the string table.

* Perform bounds checks on individual symbol table entries before
  attempting to access the corresponding strings.

* Stop treating _Foo and Foo as the same symbol.

This unbreaks OpenSSH which uses nlist(3) to verify PKCS#11 providers.

PR:		295336
MFC after:	1 week
Fixes:		77909f5978 ("Initial elf nlist support [...]")
Fixes:		644b4646c7 ("OpenSSH: Update to 10.1p1")
Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D57034
2026-05-19 08:53:35 +02:00
Adrian Chadd 8d36ec1c9c net80211: migrate wk_rxmic / wk_rxmic in TKIP code to accessors
These are the last two uses of the wk_rxmic / wk_txmic macros.
Everything should be using the accessor methods at ths point.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D54790
2026-05-18 22:28:49 -07:00
Adrian Chadd e56f7becc7 iwx: clean up / document noise floor and RSSI fetching
* Document what iwx_rxmq_get_signal_strength() is doing in a comment,
  noting what the firmware returns and what math is being done on it
  to turn it into a dBm value.

* Document what iwx_get_noise() is supposed to do, that we can't just
  go do math with log numbers like we're doing, but also that we're
  seeing zeros in this firmware (AX210), which may mean we're decoding
  using the wrong structs.

* Swizzle around the RSSI calculation as a function, add min/max RSSI
  values, and calculate RSSI against the noise floor.

* And handle the lowest noise floor value - it can't be -127dBm as
  that will throw things off.  Cap it at -100dBm which is a little
  lower than the thermal noise floor at 20MHz (-98dBm), but it matches
  IWX_MIN_DBM.

Differential Revision:	https://reviews.freebsd.org/D53780
2026-05-18 22:27:59 -07:00
Konstantin Belousov f6f5eb3190 linux/linux_common.h: make header self-contained
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-05-19 07:23:47 +03:00
Kyle Evans 67f7f2781d linuxkpi: work with numpages > 1 in the set_pages_*() KPIs
These calls are used for buddy pages at least in drm's ttm_pool, which
leads to a panic when we invoke lowmem handlers and drm tries to shrink
the pool.

Cope with numpages > 1 by traversing the contiguous pages and executing
the adjustment there, as well, as suggested by markj@.  Previous
versions have tried to use the corresponding `set_memory_*()` functions,
but it is believed that not updating `md.pat_mode` breaks subsequent
userspace mappings in ways that may result in things like screen tearing
or other artifacts when running i915kms.

This stabilized my amdgpu laptop running two VMs, chromium and a
concurrent buildworld.

Reviewed by:	bz, markj
Differential Revision:	https://reviews.freebsd.org/D57004
2026-05-18 22:22:21 -05:00
Ed Maste 762e451b31 nlist.3: Add stab(5) Xref
Commit 876a17321c removed the a.out Xref as nlist(3) no longer
supports a.out, but this left nlist(3) without a reference to a page
documenting struct nlist.

struct nlist is documented in both a.out(5) and stab(5), so add an Xref
to the latter.

Reported by:	brooks
Fixes: 876a17321c ("nlist.3: Replace a.out(5) Xref with elf(5)")
2026-05-18 20:16:13 -04:00
Ed Maste 94b7a33568 nlist.3: Add discouraged use notice
It is a relic from a.out days and is poorly specified. Although ELF
support was added to nlist, there are better ways to access ELF data.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57078
2026-05-18 19:56:00 -04:00
Ed Maste cd6bf930ea nlist.3: Clarify which symbol table is used
nlist() requires section headers, and currently fetches symbol names
only from SHT_SYMTAB,

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57065
2026-05-18 19:00:03 -04:00
John Baldwin 9306d0449b ctld: Simplify pidfile rename handling in conf::apply
Explicitly copy the pidfile path from the initial configuration file
to the kernel-derived configuration to avoid having to check if the
old path is empty as a special case in conf::apply().

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56533
2026-05-18 15:49:57 -04:00
John Baldwin f1c5de5fab ctld: Add a dedicated conf method for shutting down
Currently the main loop creates an empty config and applies it to
force a shutdown of all of the existing configuration.  While this is
functional and does avoid duplicating some code, it is also a bit
clunky and requires a special hack in the pidfile path handling
in the conf::apply method.

Instead, use a dedicated conf::shutdown method which tears down the
CTL ports and LUNs and closes the sockets.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56532
2026-05-18 15:49:35 -04:00
John Baldwin 63d7b7fad2 ctld: Mark a few more isns_* methods in the conf class private
These are only invoked from other methods in the conf class.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56531
2026-05-18 15:47:57 -04:00
John Baldwin 4f90de0933 ctld: Remove redundant call to conf::isns_schedule_update
This is already called at the end of conf::apply.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56530
2026-05-18 15:47:41 -04:00
John Baldwin be4f245e1e sys: Use is_pci_device instead of checking device or devclass names
Reviewed by:	bz, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56998
2026-05-18 14:52:39 -04:00
John Baldwin 6dc813301a sys: Use is_pci_device instead of direct comparisons to devclasses
Reviewed by:	bz
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56997
2026-05-18 14:52:23 -04:00
John Baldwin ffcf5e3566 pci: Add is_pci_device helper function
This returns true if a given device is a PCI device (child of a PCI
bus).

Reviewed by:	bz, kib
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56996
2026-05-18 14:50:39 -04:00
John Baldwin 6a043d0814 LinuxKPI: Check the devclass of the parent device in dev_is_pci
Reviewed by:	bz
Fixes:		c41d83548b ("LinuxKPI: pci.h add more defines and functions")
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D57066
2026-05-18 14:44:00 -04:00
Simon J. Gerraty 701d7be6e4 Add test cases for safe_eval.sh
safe_set is the routine that does all the work.

In safe_set; if we replace one=`cmd arg` or two=$(cmd arg) add quotes
around the result eg. one="_cmd arg_"
Also lines containing `` or $() are too likely to result in syntax
errors, so just delete them.

Differential Revision:	https://reviews.freebsd.org/D56795
2026-05-18 10:51:18 -07:00
Adrian Chadd 32f854663d qcom_tlmm: remove annoying debugging
Yes this printf is for local debugging and not required at all on anything.

Pointed out by: andrew@
2026-05-18 10:04:11 -07:00
Ed Maste 22c054c4cc elf_common.h: Add SHT_LLVM_ADDRSIG
Reported by:	bz
Sponsored by:	The FreeBSD Foundation
2026-05-18 13:00:39 -04:00
Adrian Chadd af5cdcd8b1 Revert "asmc: fix asmc_key_dump() page fault on T2 MMIO backend"
This reverts commit 3abc07947c.

I'm not sure how this built locally for me but obviously failed
in CI; I'll go figure that out with the submitter and come back.
2026-05-18 09:58:59 -07:00
Dag-Erling Smørgrav 2509ddee9b freebsd-update: Skip /etc/ssl/cert.pem
We already run `certctl rehash` at the end, there is no point in asking
users upgrading from 15.0 to 15.1 to manually merge the trust store.

MFC after:	3 days
Reviewed by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D57028
2026-05-18 18:22:04 +02:00
Mariusz Zaborski d705a51952 cap_net: do not allow new limits to drop keys from the old ones
If the old limit had family/hosts/sockaddr set, the new limit must
have them too. Before, a missing key in the new limit was treated as
"allow any", which let a caller silently extend their limits.

Reported by:	Joshua Rogers of AISLE Research Team
Reviewed by:	markj
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D56991
2026-05-18 17:18:43 +02:00
Dag-Erling Smørgrav 78074011ac tcp: Fix typo in RFC 6191 sysctl
Fixes:		2af70d7a38 ("tcp: Make RFC 6191 support configurable")
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
2026-05-18 17:00:08 +02:00
Ed Maste 876a17321c nlist.3: Replace a.out(5) Xref with elf(5)
ELF support was added to nlist() in 1997, and a.out support was removed
in 2020.  The man page was not updated for either of these changes.

Fixes: 77909f5978 ("Initial elf nlist support, ...")
Fixes: 86cfa7e70b ("nlist: retire long-obsolete aout support")
Sponsored by: The FreeBSD Foundation
2026-05-18 10:55:32 -04:00
Dag-Erling Smørgrav 2af70d7a38 tcp: Make RFC 6191 support configurable
Add a default-on per-VIMAGE sysctl for RFC 6191 connection recycling.
This makes it possible to merge the change to older branches where it
can be switched off by default to minimize risk.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Reviewed by:	pouria, marius.h_lden.org, tuexen
Differential Revision:	https://reviews.freebsd.org/D57045
2026-05-18 16:50:14 +02:00
Abdelkader Boudih 3abc07947c asmc: fix asmc_key_dump() page fault on T2 MMIO backend
asmc_key_dump() used I/O port macros (ASMC_DATAPORT_WRITE/READ,
asmc_command()) unconditionally. On T2 Macs, sc_ioport is NULL
(MMIO backend is used instead), causing a page fault when
ASMC_DEBUG triggers asmc_dumpall() during attach.

Add an MMIO guard at the top of asmc_key_dump(): delegate to
asmc_key_dump_by_index() + asmc_key_read() for MMIO devices,
consistent with the rest of the T2 code paths.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56748
2026-05-18 07:01:20 -07:00
Ed Maste f5993872fa openssh: Regen config.h to fix i386 SIZEOF_TIME_T
Fixes: 2574974648 ("OpenSSH: Update to 10.3p1")
Sponsored by:	The FreeBSD Foundation
2026-05-18 09:03:02 -04:00
Ed Maste 0b0e5daf43 openssh: Fix SIZEOF_TIME_T in freebsd-configure.sh
Sponsored by:	The FreeBSD Foundation
Reviewed by:	jlduran
Differential Revision: https://reviews.freebsd.org/D57053
2026-05-18 09:02:33 -04:00
Mateusz Piotrowski 30f500e97b p9fs.4: MLINK to virtio_p9fs.4
Technically, virtio_p9fs is an emulated device that masquerades
as a p9fs mount, but it does not make sense to have two separate manual
pages.

Reviewed by:	bnovkov, dfr
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D57013
2026-05-18 11:12:12 +02:00
Bjoern A. Zeeb ca67cfa523 fwget: update realtek and intel pci entries
For Realtek we only add new entries.

For Intel the old way of extracting IDs from the driver no longer
works.  The new list is shortened as we drop more specific entries
which were already covered by wildcard entries.  The new lists are
also sorted within the groups.
There are 4 entries the new driver no longer carries but are still
present in older versions, so we keep them manually.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-05-17 23:37:12 +00:00
Bjoern A. Zeeb 4f6c60c3d3 iwlwifi: firmware: reduce script to extract fwget information
Due to driver changes it is no longer feasible to extract the full
PCI ID / firmware / card type information in one go as we used to
be able to.
We have already changed the way we extract firmware information for
ports and marked the iwlwififw.4 man page as obsolete.

Reduce the script to simply extarct the fwget(8) information and,
compared to the old times, sort each section so diffs will be easier
to see in the future.  This was particular helpful this time to make
sure we do not lose entries with the change of technique.

We also keep the script in the best perl spirit to do the job but
not to win a price, especially given it seems we have to change
matters every (other) year.

Given we can no longer extract firmware information for the PCI IDs,
we need to "manually" check against the ports that names match.
Ideally we will simplify things for everything "mld-only" one day
to only have a single firmware package for these (even if size
increases slightly).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-05-17 23:37:12 +00:00
Bjoern A. Zeeb 56460a6a42 rtw89: firmware: extend script to extract fwget entries
The so far so consistent (file)names got an outlier so add the
one character longer pattern as well to catch that.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-05-17 23:35:55 +00:00
Konstantin Belousov 8ad8643a66 ufs: ufs_bmap_seekdata() needs mapped buffer for scan
PR:	295348
Reported and tested by:	 Alastair Hogge <agh@riseup.net>
Reviewed by:	mckusick
Fixes:	bab04ddf1f ("ufs: support unmapped bufs for indirect blocks in bmap")
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57036
2026-05-18 01:09:26 +03:00
Koine Yuusuke 436f47a80c intelhfi: Add IA32_PM_ENABLE bit flag define
Reviewed by: Minsoo Choo <minsoo@minsoo.io>
Differential Revision: https://reviews.freebsd.org/D56919
2026-05-17 17:13:14 -04:00
Konstantin Belousov 56bc43f5d0 locking.9: warn about using sleepable lock address as a sleep channel
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D57012
2026-05-17 22:55:23 +03:00
Konstantin Belousov 7bdf2b5d5f nullfs: do not allow to mount a vnode over itself
This causes recursion in VFS that is not worth handling.

PR:	275570
Reported by:	Alex S <iwtcex@gmail.com>
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57043
2026-05-17 22:44:06 +03:00
Dag-Erling Smørgrav 363ea40c76 limits: Further RLIMIT_VMM cleanup
Teach limits(1), sh(1), and setclassresources(3) about RLIMIT_VMM.

Fixes:		1092ec8b33 ("kern: Introduce RLIMIT_VMM")
Reviewed by:	bnovkov
Differential Revision:	https://reviews.freebsd.org/D57031
2026-05-17 18:23:50 +02:00
Alan Somers 4cee16d471 linuxulator: fix SO_PEERCRED emulation after 1d24638d3e
For Linux binaries, sopt->sopt_td may be null.  And there's also no
need to check it, since struct l_ucred has the same layout on 32-bit
systems as on 64-bit ones.

PR:		295333
Reported by:	Miguel Gomes <miguel.dias.gomes@protonmail.com>
Fixes:		1d24638d3e ("Fix LOCAL_PEERCRED in 32-bit compat mode")
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D57032
2026-05-17 06:49:23 -06:00
Andrey V. Elsukov 2872268c7f ipfw: treat ipv6 address with zero mask as 'any'
Make the behaviour similar for both IPv4 and IPv6. Also add
the corresponding tests.

PR:             294733
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56618
2026-05-17 13:12:20 +03:00
Konstantin Belousov 43a8585cb2 sys/mount.h: restore KNF_NOKQLOCK in VFS_KNOTE_{,UN}LOCKED() call to KNOTE()
ZFS needs to take internal sleepable lock in its implementation of
VOP_GETATTR().  Due to this, kq must be unlocked around calls to the vfs
filter methods.

Fixes:	1d5e4020e3 ("vnode: add VIRF_KNOTE flag")
Reported and tested by:	des
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-05-17 02:24:10 +03:00
Jose Luis Duran 3d246db083 blocklist: Add back probes
The banner exchange was moved to the sshd-auth process in upstream
commit bb781f02d4efd178e329a62a838962bee16e3e9b.  Add it back.

Add back fatal exit probe.

NetBSD PR:	bin/60270 (GNATS)
Reviewed by:	emaste
Fixes:		2574974648 ("OpenSSH: Update to 10.3p1")
Differential Revision:	https://reviews.freebsd.org/D57027
2026-05-16 22:00:02 +00:00
Konstantin Belousov 72ab129799 x86: remove sys/mount.h from genassym.c
The header is not needed, and causes some issues with build because it
requires vnode_if.h generated due to transient dependency from vnode.h.

While there, remove unneeded explicit sys/cdefs.h and sys/param.h usage.

Reported and tested by:		thierry
Fixes:	1d5e4020e3 ("vnode: add VIRF_KNOTE flag")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-05-17 00:40:31 +03:00
Ryan Libby 755c1e039a kernel: address executable stack warnings in amd64 gcc build
Mark assembly files as not requiring executable stacks.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D56946
2026-05-16 13:24:45 -07:00
Ruslan Bukin 7eb71fd267 riscv: fix GENERIC-NODEBUG build
Reported by:	bz
2026-05-16 21:17:44 +01:00
Alex S 8dd43304b3 amd64/ptrace-sce-tamper test: get rid of PT_TRACE_ME
PT_TRACE_ME is only useful in combination with exec and there is no
exec in this test.

Signed-off-by:	Alex S <iwtcex@gmail.com>
MFC after:	1 week
2026-05-16 22:41:26 +03:00
Colin Percival 61df4be487 EC2: Don't enable firstboot_pkgs in small flavour
The EC2 "base" flavour installs the devel/py-awscli package at boot
time by default; we don't do this in the "small" flavour, so the
default behaviour was to update the FreeBSD-ports repository and
then do nothing with it.

Turn off firstboot_pkgs by default; if someone is using the "small"
flavour of AMIs and wants to install packages at instance launch
time, they simply need to add 'firstboot_pkgs_enable="YES"' to
/etc/rc.conf (which they must already be editing via user-data, in
order to provide the list of packages they want installed).

Sponsored by:	Amazon
MFC after:	3 days
MFC to:		stable/15
Relnotes:	EC2 "small" images now have firstboot_pkgs_enable="NO".
2026-05-16 12:18:52 -07:00