100 Commits
Author SHA1 Message Date
Ed Maste 7ea9ac99e1 libc: Add a man page caveat about the w modifier
In-tree Clang is unaware of the N2680 fixed-width modifier `w` and emits
a warning when used.

PR:		299631
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D60939
2026-10-26 09:46:02 -04:00
Ed Maste ce9de516ee amdsmu: Print detailed stats for KRACKAN_POINT
Testing on a Dell AMD Ryzen AI 5 PRO 435 laptop shows that the same
diagnostic information is valid.

Reviewed by:	obiwac
Sponsored by:	The FreeBSD Foundation
2026-10-26 09:34:41 -04:00
Ed Maste 81f86c9a94 smsc: Allow 10BASE-T1L/-T1S media
These are Single-Pair Ethernet types (SPE) from 802.3cg. smsc sets the
link flag only if mii_media_active is one of a known set of media types.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60745
2026-10-24 14:54:11 -04:00
Ed Maste 10ceddaa94 smsc: Use read-modify-write to configure LEDs
After reset the driver enables three LED outputs by writing 1s to
the appropriate GPIO/LED configuration bits in the LED & GPIO
configuration register LED_GPIO_CFG.

The LED Select (LED_SEL) bit in LED_GPIO_CFG chooses between two LED
modes:

0: Speed, Link+Activity, Full Duplex
1: Speed, Link, Activity

If an EEPROM is present LED_SEL is initialized from bit 1 in the
EEPROM's configuration flags value.  If no EEPROM is present this bit
defaults to zero.

Previously we wrote to all bits in the register, clearing LED_SEL.  A
device with LED_SEL set by the EEPROM would thus not have correct LEDs.

Now we read the current value of LED_GPIO_CFG and just set the three
LED configuration bits, as Linux does in commit 52a2f0608366 ("net: usb:
smsc95xx: fix changing LED_SEL bit value updated from EEPROM").

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60828
2026-10-23 18:01:59 -04:00
Ed Maste dc4c75c9a3 smsc: Support external PHY
SMSC_HW_CFG_PSEL indicates that an external PHY is present. Skip the
internal PHY initialization when set and store the ID of the detected
PHY.

Reviewed by:	br
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D60744
2026-10-23 18:00:48 -04:00
Ed Maste 13011cbf7d smsc: Remove phy address check in smsc_miibus_writereg
The driver only allowed writes to the expected phy (i.e., sc->sc_phyno),
and reads were never filtered.  sc_phyno is already passed to
mii_attach() as phyloc, so nothing tries to issue MDIO writes to other
addresses and the check is not required.

Remove the check in advance of supporting external PHYs at arbitrary
addresses.

Tested on Microchip's EVB-LAN9500A-LC LAN9500A evaluation board.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	Microchip (Hardware)
Differential Revision: https://reviews.freebsd.org/D60743
2026-10-23 17:58:51 -04:00
Ed Maste bea44a8363 kernel: Use external retpoline thunks
External retpoline thunks for amd64 and i386 were added in commit
74d971fe15 ("x86: Add external retpoline thunk").  Use them when
WITH_KERNEL_RETPOLINE is set.

There should not be any material performance impact -- the call sites
are identical, and this just replaces (on amd64) compiler-generated
__llvm_retpoline_r11 functions in each object with our
__x86_indirect_thunk_r11.

After this change we could implement boot-time patching, replacing
__x86_indirect_thunk_r11 with just jmp %r11 when retpoline is not
required.

Note on i386: An i386 build WITH_KERNEL_RETPOLINE was successful, but
has not been extensively tested.  Clang may use registers other than
just eax on i386 and so in the future additional thunks beyond the one
added in 74d971fe15 could be required for i386.  Patches are welcome
if this is important to you.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
2026-10-23 11:53:05 -04:00
Ed Maste f69099fc0f if_media: Add 100BASE-T1 and 1000BASE-T1 media types
100BASE-T1 (IEEE 802.3bw) and 1000BASE-T1 (IEEE 802.3bp) are Single-Pair
Ethernet (SPE) standards intended for use in automotive and industrial
applications.

Reviewed by:	kbowling
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60864
2026-10-20 15:04:39 -04:00
Ed Maste d5612784ab Revert "umb: Update man page HISTORY"
Oops, pushed in error from a staging branch.

This reverts commit ed79730624.
2026-10-15 13:59:44 -04:00
Ed Maste ed79730624 umb: Update man page HISTORY
It was merged to stable/14 prior to FreeBSD 14.4.
2026-10-15 13:55:47 -04:00
Ed Maste 617c700aba newvers.sh: Report -dirty also with staged changes
We add -dirty to the uname version string if the tree does not match the
reported hash. Previously, staged but uncommitted changes were ignored.
Noted by naddy@ in D60606.

Reviewed by:	cperciva, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60722
2026-10-15 13:24:13 -04:00
Ed Maste 79d491be21 Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.
2026-10-15 13:07:36 -04:00
Ed Maste 4a65e12dfb dict: Add "macho"
Macho is a perfectly cromulent word, in both Merriam-Webster and OED.

Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D60713
2026-10-13 19:49:58 -04:00
Ed Maste b80af977f1 mgb: Build module for all archs
It is not x86-specific.

This reverts commit e0a5aa37c1.
This reverts commit 2d935a1e93.

Reviewed by:	kbowling
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60615
2026-10-13 12:51:05 -04:00
Ed Maste 6c3f2b8be2 mgb: Correct TX interrupt bit
The TX interrupt handler checked MGB_INTR_STS_RX(qidx) instead of
MGB_INTR_STS_TX(qidx) -- presumably a copy-paste issue.

Because the driver does not use TX interrupts so there was no actual
issue in practice.

Reviewed by:	adrian
Sponsored by:	The FreeBSD Foundation
Fixes: 8890ab7758 ("Introduce if_mgb driver for Microchip LAN743x PCIe NIC")
Differential Revision: https://reviews.freebsd.org/D60550
2026-10-09 15:20:56 -04:00
Ed Maste e959f2a7d8 ctf*: exit with error upon terminate()
The initial port of the CTF tools had a FreeBSD-specific patch to print
the termination message but exit with a 0 status, with a goal of getting
as much to build as possible and silently ignoring any issues.

We're now past the point where silently ignoring failures makes sense.
Any future issues need to be found and addressed.

PR:		276826
PR:		276930 [exp-run]
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43743
2026-10-09 14:23:42 -04:00
Ed Maste 39f7dbff60 bsd.dirs.mk: Improve "installing DIRS" message
Some of these messages looked at first glance like they were incorrectly
concatenated, e.g. "installing DIRS testsFILESDIR".  Add a colon to
clarify.

Reviewed by:	brooks, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60525
2026-10-09 11:38:21 -04:00
Ed Maste d3c788feec Makefile.inc1: Don't unnecessarily ignore rm errors
For rm -f it's not an error if the files do not exist.  If there's any
other error it's presumably a real issue, so avoid ignoring all errors.

Reviewed by:	brooks, adrian
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56714
2026-10-09 11:06:46 -04:00
Ed Maste 24d5194306 build: Emit a warning for build targets run as root
Build targets should generally be run as an unprivileged user.  Even
though building as root is discouraged many users do so, so just start
with a warning.

Reviewed by:	brooks
Differential Revision: https://reviews.freebsd.org/D50352
2026-10-09 11:02:30 -04:00
Ed Maste 87f0db8c67 Makefile.inc1: Update comment wrt world build targets
The utility targets described by this comment are in fact related to
building (buildworld), not installing (which is included in
`make world`).

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56715
2026-10-09 10:57:45 -04:00
Ed Maste ac9093170d x86: Fix retpoline capitalization
Fixes: 74d971fe15 ("x86: Add external retpoline thunk")
2026-10-09 10:52:20 -04:00
Ed Maste 74d971fe15 x86: Add external retpoline thunk
This allows use of -mindirect-branch=thunk-extern, and is only a few
bytes of dead code if not used.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60524
2026-10-09 10:50:40 -04:00
Ed Maste dd51cef583 sound: Whitespace cleanup
In advance of additional sound(4) work, remove EOL whitespace and mixed
tab/space.

Reviewed by:	christos
Differential Revision: https://reviews.freebsd.org/D60442
2026-10-08 08:19:22 -04:00
Ed Maste 3ba592cfea makefs: Correct style(9) nit from a recent change
Fixes: b9811d1357 ("cd9660: merge level 1 and 2 filename conversion")
2026-10-07 10:53:53 -04:00
Ed Maste e3f5a83b8f camcontrol: Add Spectra Logic copyright
The majority of lines of code currently in fwdownload.c come from ken@'s
rework in commit 0e358df062 ("Revamp camcontrol(8) fwdownload support
and add the opcodes subcommand.").  Add the appropriate copyright.

Approved by:	ken
2026-10-06 16:14:51 -04:00
Ed Maste fc544d3b57 makefs: Remove unused "mac68k" support
Obtained from:	OpenBSD 4f3c7809d4013a2eb3e75fc5e7bd2d8ae1f41843
2026-09-24 12:57:09 -04:00
Ed Maste 884b961c74 makefs: Make target filesystem inodes 64 bits
Obtained from:	NetBSD 2501d4dfda92, 7022656d8ab2
2026-09-24 11:54:40 -04:00
Ed Maste 0cb85c5b41 aq.4: Remove experimental note
I added the text when this driver was merely an import of
https://github.com/Aquantia/aqtion-freebsd with patches from ports applied.
nprice@ resolved issues and added support for newer cards and the note is
no longer applicable.

Reviewed by:	adrian
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59909
2026-09-22 14:03:49 -04:00
Ed Maste 82dcd3ab12 vt: Move VWF_GRAPHICS clearing under VT_LOCK
Reviewed by:	vexeduxr, Quentin Thébault <[email protected]>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59814
2026-09-20 08:19:27 -04:00
Ed Maste 0ec81f6a53 openssh: Add date bump command to FREEBSD-upgrade instructions
Provide a convenient in-place sed edit command to update the FreeBSD
VersionAddendum dates with today's date.

Sponsored by:	The FreeBSD Foundation
2026-08-24 14:47:03 -04:00
Ed Maste a793cabb62 libusb: Avoid signed integer overflow UB
Instead, just reset next_callback_id to 1 at INT_MAX.  The potential for
duplicate callback IDs remains.

Sponsored by:	The FreeBSD Foundation
2026-08-21 15:49:44 -04:00
Ed Maste fdf3e57036 sdhci: Remove redundant device_get_softc
Fixes: 550db3d6f5 ("sdhci: Initial support for the SpacemiT K1 sdhci controller")
Reviewed by:	bnovkov
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59083
2026-08-21 11:27:55 -04:00
Ed Maste 250db717b2 libusb: Add an XXX comment for possible duplicate callback IDs
If next_callback_id wraps we could end up with two callbacks with the
same ID.  I recommitted the original change despite this issue in order
to fix the libusb API as soon as possible after SHLIB_MAJOR was bumped
in commit 527a82474c (libusb: versioning symbols).

It's very unlikely in practice that software will register and
deregister a sufficient number of callbacks to trigger this, but it is
a real issue to be fixed in a subsequent commit.

Sponsored by:	The FreeBSD Foundation
2026-08-21 10:53:45 -04:00
Ed Maste 2346300eaf clk: Correct SpacemitT typo
SpacemiT has only one T.

Fixes: dcb10e3add ("clk: Initial support for the SpacemiT K1 clock control units")

Sponsored by:	The FreeBSD Foundation
2026-08-21 09:50:50 -04:00
Ed Maste 767d5fe9df mailmap: Fix Nick Price
Somehow a few commits ended up with "null" appended to Nick's name and
email address.

Reviewed by:	Nick Price <[email protected]>
Differential Revision: https://reviews.freebsd.org/D58517
2026-07-29 21:23:22 -04:00
Ed Maste da412147f2 mailmap: Sort
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D58515
2026-07-29 21:23:19 -04:00
Ed Maste 8a7ab3ed22 uvideo: Return actual mtx_sleep error in dqbuf
Don't coerce errors to EINVAL, which isn't correct for mtx_sleep's
failure cases.

Sponsored by:	The FreeBSD Foundation
2026-07-24 13:34:12 -04:00
Ed Maste 2b1df6149e loader: Allocate trampoline as EfiLoaderCode, not Data
Firmware on a test machine applied NX to non-code allocations, which
resulted in a fault when jumping to the trampoline.

Reviewed by:	kib
Tested by:	Jim Huang Chen <[email protected]>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58383
2026-07-21 17:23:11 -04:00
Ed Maste ba583f0c2d contigmalloc.9: Correct typo
Reported by:	alc, rlibby
Fixes: caabdb3aef ("contigmalloc.9: Note that M_WAITOK may still return NULL")
2026-07-21 15:06:35 -04:00
Ed Maste caabdb3aef contigmalloc.9: Note that M_WAITOK may still return NULL
Reviewed by:	markj, bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58382
2026-07-21 14:27:47 -04:00
Ed Maste c3e38c0093 vidcontrol: Disallow -i mode with vt(4)
vt(4) does not (currently) support changing the video mode.  Report that
-i mode is not supported rather than printing an empty list.

PR:		207411
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58163
2026-07-20 18:04:16 -04:00
Ed Maste b273481f2a vtfontcvt: Avoid dead store in add_char
The fallback glyph is stored at index 0, and does not need to be
inserted into a mapping.

Previously there was a dead store of add_glyph's return value for the
fallback case, which upset Clang's static analyzer.  Now, cast the
return value to (void) to make it clear this is intentional.

Also change add_glyph's fallback parameter to a c99 bool to make its use
more clear.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57174
2026-07-20 16:46:50 -04:00
Ed Maste 513d3fde7c tools/build: Don't set RANLIB for non-FreeBSD builds
RANLIB is not used by our build, so there is no need to set it.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58156
2026-07-10 14:16:49 -04:00
Ed Maste ae0a3632b5 build: Retire LLVM_COV src.conf knob
I introduced it in commit 1b49115a40 ("Promote llvm-cov to a
standalone option").  llvm-cov was previously enabled as part of the
CLANG_EXTRAS option.  I made it a standalone, default-enabled option for
parity with the tools provided by the GCC-based toolchain.

We no longer provide an in-tree GCC toolchain.  Now, just build llvm-cov
along with Clang to simplify build infrastructure.

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58155
2026-07-10 11:20:34 -04:00
Ed Maste 7fde3e6223 beinstall: Avoid chrooting into new world
The new world may use system calls that are not in the currently-running
kernel, so we cannot chroot into the new environment to run `make
installworld`, `etcupdate`, etc.  Partially revert commit 16702050ac
("beinstall: perform pre-installworld steps") and switch back to using
DESTDIR for installworld and so on.

Reported by:	olivier
Reviewed by:	olivier
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50682
2026-07-10 11:04:45 -04:00
Ed Maste c185120563 readelf: Add support for ELF package metadata note
We don't use this note type today, but as a general purpose ELF
diagnostic tool readelf(1) ought to decode it.

References:
https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects
https://systemd.io/ELF_PACKAGE_METADATA/

Reviewed by:	fuz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47524
2026-07-10 10:58:15 -04:00
Ed Maste 5792a639ab openssh: fix GSSAPI option names
From openssh-portable commit c14709356563.

Reported by:	cy
2026-07-09 23:15:37 -04:00
Ed Maste 707ee7ff95 usbdevs: Add Microchip 10BASE-T1S eval board
USB vendor:product 184f:0051

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56794
2026-07-09 14:40:37 -04:00
Ed Maste bb5c77e9d2 OpenSSH: Update to 10.4p1
Full release notes are available at
https://www.openssh.com/txt/release-10.4

Selected highlights from the release notes:

Potentially-incompatible changes
--------------------------------

 * sshd(8): configuration dump mode ("sshd -G") now writes directives
   in mixed case (e.g. "PubkeyAuthentication") whereas previously it
   emitted only lower-case names.

 * ssh(1), sshd(8): make the transport protocol stricter by
   disconnecting if the peer sends non-KEX messages during a post-
   authentication key re-exchange. Previously a malicious peer could
   continue sending non-key exchange messages without penalty. These
   would be buffered, causing memory to be wasted up until the
   connection terminated or the server/client hit a memory limit.
   Implementations that do not restrict messages sent during key
   exchange as per RFC4253 section 7.1 may be disconnected.
   Reported by Marko Jevtic.

Changes since OpenSSH 10.3
==========================

This release contains a number of security fixes as well as general
bugfixes and a couple of new features.

Security
========

 * sftp(1): when downloading files on the command-line using
   "sftp host:/path .", a malicious server could cause the file to
   be downloaded to an unexpected location. This issue was identified
   by the Swival Security Scanner.

 * scp(1): when copying files between two remote destinations, do
   not allow a malicious server to write files to the parent
   directory of the intended target directory.  This issue was
   identified by the Swival Security Scanner.

 * sshd(8): DisableForwarding=yes didn't override PermitTunnel=yes
   as it was documented to do. Note that PermitTunnel is not enabled
   by default. Reported independently by Huzaifa Sidhpurwala of
   Redhat and Marko Jevtic.

 * sshd(8): avoid a potential pre-authentication denial of service
   when GSSAPIAuthentication was enabled (this feature is off by
   default). This was not mitigated by MaxAuthTries, but would be
   penalised by PerSourcePenalties. This was reported by Manfred
   Kaiser of the milCERT AT (Austrian Ministry of Defence).

 * sshd(8): fix a number of cases where the minimum authentication
   delay was not being enforced. Reported by the Orange Cyberdefense
   Vulnerability Team.

 * ssh(1): fix a possible client-side use-after-free if the server
   changes its host key during a key reexchange. This was reported by
   Zhenpeng (Leo) Lin of Depthfirst.

New features
------------

 * All: add experimental support for a composite post-quantum
   signature scheme that combines ML-DSA 44 and Ed25519 as specified
   in draft-miller-sshm-mldsa44-ed25519-composite-sigs.

   This scheme is not enabled by default. To use it, you'll need
   to add it to HostKeyAlgorithms, PubkeyAcceptedAlgorithms, etc.
   Keys may be generated using "ssh-keygen -t mldsa44-ed25519".

Bugfixes
--------

 * sshd(8): avoid sending observably different messages for valid vs
   invalid users in GSSAPIAuthentication (disabled by default).

 * ssh(1), sshd(8): fix several bugs that incorrectly
   classified bulk traffic as interactive. bz3972, bz3958

 * ssh-keygen(1), ssh-add(1): skip unsupported key types when
   downloading resident keys from a FIDO token. Previously, downloads
   would abort when one was encountered. GHPR657

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58083
2026-07-09 17:17:11 +00:00
Ed Maste 3838aee845 Vendor import of OpenSSH 10.4p1
Sponsored by:	The FreeBSD Foundation
2026-07-06 12:41:15 -04:00
Ed Maste 465a3b7adc newvers.sh: Avoid spurious -dirty in git revision
If git is installed and .git exists but git rev-parse failed to report a
hash we previously produced just "-dirty" as the git revision.  Gate the
git commit count and -dirty check on the rev-parse passing.

Reviewed by:	jlduran
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57995
2026-07-03 09:34:58 -04:00
Ed Maste 2f7a8222b6 memory_model.7: Correct typo
perserving -> preserving

Reviewed by: jrm
Event: Halifax Hackathon 202606
Fixes: 1366a87c9c ("memory_model(7): create and document pointer provenance")
2026-06-26 09:16:27 -04:00
Ed Maste 3a5c2899fc libcxxrt: Fix diagnostics for derived classes
In terminate_with_diagnostics the cast_to arguments were swapped, so it
always failed.  The diagnostic handler produced output like "Terminating
due to uncaught exception 0x24891e08000 of type std::runtime_error".

Now, e->what() will actually be included in the output, e.g.
"Terminating due to uncaught exception 0x2bba49208000 'Model file
doesn't exist' of type std::runtime_error".

Reviewed by:	dim
Event:		Halifax Hackathon 202606
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57822
2026-06-24 13:36:13 -04:00
Ed Maste 9a10af53db Revert "kldload: Improve error handling"
It broke the test suite, and will be recommitted when fixed.
This reverts commit db887713de.

Reported by:	markj
2026-06-16 11:06:30 -04:00
Ed Maste 52a2b4bc5d tests: Fix build if TIOCSTI is not defined
Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI

We already have some components (such as mail and tcsh) that build
without TIOCSTI defined.  This is (existing portability support in those
projects.

Simplify things for downstreams by extending this approach to this
additional TIOCSTI user.

Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D50614
2026-06-15 11:42:48 -04:00
Ed Maste 39e2fe2323 if_tsec: Free entire mbuf chain on failure
Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57478
2026-06-15 10:32:02 -04:00
Ed Maste 21a75a85f0 netlink: Indicate that ifinfomsg uses IFT_* types
On Linux struct ifinfomsg uses ARPHRD_* values, while we used IFT_*
types (which derive from SNMP ifType definitions in RFC 1573).
Update the header to reflect this.

PR:		272144
Reviewed by:	pouria
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57334
2026-06-15 08:36:16 -04:00
Ed Maste 6365c45d95 elf_common: Add FDO package metadata note type
Reviewed by:	fuz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57525
2026-06-10 11:45:34 -04:00
Ed Maste c94b8eee5b vt: Rename sysctl to security.bsd.allow_tiocsti
This is consistent with allow_read_dir and allow_ptrace.

PR: 293485
Fixes: c289291a67 ("tty: Add sysctl knob to globally disable TIOCSTI")
Sponsored by: The FreeBSD Foundation
2026-06-09 14:27:56 -04:00
Ed Maste c289291a67 tty: Add sysctl knob to globally disable TIOCSTI
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57233
2026-06-09 12:38:54 -04:00
Ed Maste b16c731b01 ipfw nat: Add assertion that mbuf is not a chain
Discarding m_free's return value will result in an mbuf leak if the mbuf
was in a chain.

In general we should use m_freem if the mbuf may be in a chain, or
assert that the return was NULL.  There will not be a chain here due to
m_megapullup, so add an assert.

Reviewed by:	ae
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57479
2026-06-08 16:47:24 -04:00
Ed Maste 888d9236e2 netlink: Use unsigned type in nl_process_nbuf
nlmsghdr::nlmsg_len and nl_buf::offset are u_int.  Make msglen match.

Reviewed by:	pouria, glebius
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57474
2026-06-08 15:51:35 -04:00
Ed Maste 85195c0c7f ipsec: Free entire mbuf chain on failure
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57475
2026-06-06 08:35:47 -04:00
Ed Maste 232021fd09 linuxkpi 802.11: Free entire mbuf chain on failure
Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Fixes: 0936c648ad ("LinuxKPI: 802.11: update the ni/lsta reference cycle")
Fixes: c816f64e66 ("LinuxKPI: 802.11: plug mbuf leak")
Differential Revision: https://reviews.freebsd.org/D57477
2026-06-06 08:34:50 -04:00
Ed Maste 5a7f41e94b if_stf: Free entire mbuf chain on failure
Reported by:	 Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:	markj, bz, kp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57476
2026-06-06 08:32:40 -04:00
Ed Maste c2631d1623 arch.7: Restore (non-SPE) 32-bit powerpc to MD tables
powerpc is still relevant for lib32.  powerpcspe cannot use lib32 so
remains removed.

Reported by:	Minsoo Choo <[email protected]>
Reviewed by:	Minsoo Choo <[email protected]>
Sponsored by:	The FreeBSD Foundation
Fixes: 2ea49bb595 ("arch.7: Remove 32-bit powerpc from tables")
Differential Revision: https://reviews.freebsd.org/D57473
2026-06-05 16:17:36 -04:00
Ed Maste 0ae946e722 vt: Avoid integer overflow in CONS_HISTORY ioctl
Reviewed by:	markj, vexeduxr
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57250
2026-06-05 13:56:12 -04:00
Ed Maste 2ea49bb595 arch.7: Remove 32-bit powerpc from tables
Most 32-bit architecture support has been deprecated for FreeBSD 16.

Reviewed by:	des
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57472
2026-06-05 12:35:25 -04:00
Ed Maste 5805fadd0d arch.7: arch.7: Add wchar_t signedness
Most architectures have the same signedness for char and wchar_t, but
powerpc has the unusual combination of unsigned char and signed wchar_t.

Reviewed by:	des, jhb, markj
Sponsored by:	The FreeBSD Foundation
2026-06-05 12:25:43 -04:00
Ed Maste 248dd56d2d install.1: Convert link flags to a table
The five link flags get lost in prose.

Reviewed by:	ziaee
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57418
2026-06-03 16:45:13 -04:00
Ed Maste b49021b49a install.1: Document options incompatible with -s
Reported by:	des
Reviewed by:	ziaee
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57409
2026-06-03 16:34:19 -04:00
Ed Maste 521afce6a8 xinstall: Do not allow -l and -s together
Cannot strip the target if creating a link.

Reviewed by:	des
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57398
2026-06-03 11:33:05 -04:00
Ed Maste 4908bea5b7 xinstall: Add test for -d -s not allowed together
Reviewed by:	des
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57403
2026-06-03 11:33:05 -04:00
Ed Maste f77d37cffd linuxulator: Return EINVAL for invalid inotify flags
We implement all of the currently-defined Linux inotify mask bits and
flags, with the same values as Linux.  Return EINVAL for unknown bits,
as Linux does.

This also moves the translation inline into linux_inotify_add_watch.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57387
2026-06-01 14:42:38 -04:00
Ed Maste 72e34b3e39 get/setpriority: Add capability mode checks
Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57345
2026-06-01 12:30:20 -04:00
Ed Maste 96dbc9a8de netlink: Check permissions for interface flag changes
Reviewed by:	pouria, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57332
2026-05-29 19:11:21 -04:00
Ed Maste 9ddb6064f8 netlink: Use early exit pattern in _nl_modify_ifp_generic
No functional change.

Reviewed by:	pouria, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57349
2026-05-29 19:11:21 -04:00
Ed Maste 692b0ef150 syscalls.master: Allow clock_nanosleep in capability mode
It is akin to nanosleep(2) and does not access global namespaces.
It should be permitted in capability mode.

Reviewed by: vangyzen
Fixes: 3f8455b090 ("Add clock_nanosleep()")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57343
2026-05-29 18:25:42 -04:00
Ed Maste 32a7ba251a route: Fix flush w/o specified address family
PR:		291867
Reported by:	gavin
Reviewed by:	pouria, melifaro
Sponsored by:	The FreeBSD Foundation
Fixes: c597432e22 ("route(8): convert to netlink")
Differential Revision: https://reviews.freebsd.org/D57336
2026-05-29 18:18:20 -04:00
Ed Maste f9f46294d6 bsdinstall: Use libarchive secure flags for extract
This doesn't really matter, as we trust that the installer tarballs are
not malicious, but it doesn't hurt to set these flags.

Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57274
2026-05-28 09:03:45 -04:00
Ed Maste b9d16b7fd2 sigqueue: In capability mode, only allow signalling self
This is copied from the check in kern_kill.

Reviewed by:	markj, oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57244
2026-05-26 15:18:56 -04:00
Ed Maste 33acf0f26b netlink: Fix RTM_GETROUTE loop for RT_TABLE_UNSPEC
Reviewed by: bz, pouria
Fixes: 7e5bf68495 ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57234
2026-05-25 12:37:12 -04:00
Ed Maste f05fb5157b vtfontcvt: Return error from write_fnt_source
Previously write_fnt_source always returned 0, silently discarding
errors.  Return rv so that errors set vtfontcvt's shell exit
appropriately.

Sponsored by: The FreeBSD Foundation
2026-05-25 09:46:58 -04:00
Ed Maste 4d125ed6e7 netlink: Avoid potential undefined behaviour
Taking the address of an OOB array element is UB, even if not
dereferenced.

Reviewed by: des, bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57172
2026-05-23 16:59:52 -04:00
Ed Maste 1dbc104148 netlink: Check for NULL return from npt_alloc()
Reviewed by: glebius, pouria
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57171
2026-05-23 12:22:36 -04:00
Ed Maste eff5f220c3 netlink: Fix interface type match
Reviewed by: bz, glebius, pouria
Fixes: 7e5bf68495 ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57167
2026-05-22 14:34:13 -04:00
Ed Maste 1a4ad649cb netlink: Avoid undefined behaviour
Even though it is not dereferenced, it is UB to take the address of an
out of bounds array element.

Reviewed by: pouria, bz, des, adrian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57158
2026-05-22 10:21:11 -04:00
Ed Maste d66fec481b netlink: Fix lock leak in nl_find_nhop
Reviewed by: bz, pouria
Fixes: 7e5bf68495 ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57156
2026-05-21 20:38:45 -04:00
Ed Maste 59601a75d6 cap_net.3: Clarify monotonic reduction in permitted operations
Reviewed by:	markj, oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57141
2026-05-20 16:49:22 -04:00
Ed Maste 3c07cfb252 elfdump: Decode SHT_LLVM_ADDRSIG section header type
Reported by:	bz
Sponsored by:	The FreeBSD Foundation
2026-05-19 19:54:07 -04: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
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
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
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
Ed Maste 6531070132 openssh: Add reference for another local patch
A bug fix was committed locally and submitted upstream.  Document it in
our upgrade instructions, as these sometimes take a long time before
getting merged.

Sponsored by:	The FreeBSD Foundation
2026-05-15 12:19:49 -04:00
Ed Maste 2574974648 OpenSSH: Update to 10.3p1
Full release notes are available at
https://www.openssh.com/txt/release-10.3

Selected highlights from the release notes:

 * ssh(1), sshd(8): remove bug compatibility for implementations
   that don't support rekeying. If such an implementation tries to
   interoperate with OpenSSH, it will now eventually fail when the
   transport needs rekeying.

 * ssh(1), sshd(8): support IANA-assigned codepoints for SSH agent
   forwarding, as per draft-ietf-sshm-ssh-agent. Support for the new
   names is advertised via the EXT_INFO message. If a server offers
   support for the new names, then they are used preferentially.

 * ssh(1): add a ~I escape option that shows information about the
   current SSH connection.

 * sshd(8): add 'invaliduser' penalty to PerSourcePenalties, which is
   applied to login attempts for usernames that do not match real
   accounts. Defaults to 5s to match 'authfail' but allows
   administrators to block such attempts for longer if desired.

 * Support the ed25519 signature scheme via libcrypto.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56999
2026-05-14 18:59:30 +00:00
Ed Maste 4cdcacb9b2 usbdevs: Add TP-Link UB500 (RTL8761BUV) USB ID
This device is not yet supported.

Unfortunately some recently purchased UB400 dongles also contain this
Realtek IC.

Sponsored by:	The FreeBSD Foundation
2026-05-14 09:50:46 -04:00