Commit Graph
100 Commits
Author SHA1 Message Date
Dag-Erling Smørgrav dd6a1fef0e ObsoleteFiles.inc: Add moved certificates
These two moved from trusted to untrusted.

Fixes:		21ac476142 ("ObsoleteFiles.inc: Add dropped certificates")
2026-10-20 19:55:21 +00:00
Dag-Erling Smørgrav 21ac476142 ObsoleteFiles.inc: Add dropped certificates
Reported by:	michaelo@
Fixes:		82af7f44eb ("caroot: Regenerate")
2026-10-20 19:41:00 +00:00
Dag-Erling Smørgrav 82af7f44eb caroot: Regenerate
Regenerate using certificate data from NSS 3.131.1.

Upstream dropped emSign_ECC_Root_CA_-_G3.pem entirely; we deliberately
move it to untrusted instead to block its reintroduction through e.g.
an outdated copy of security/ca_root_nss.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60906
2026-10-20 19:24:31 +00:00
Dag-Erling Smørgrav 0ce9d6e240 auditdistd: Fix build failure
Fixes:		4f19e4aca4 ("auditdistd: Use void pointers for opaque data")
Reported by:	garga@
2026-10-20 16:59:46 +02:00
Dag-Erling Smørgrav dff56e8118 hastd: Fix build failure
Fixes:		a5e6bee5a0 ("hastd: Use void pointers for opaque data")
Reported by:	garga@
2026-10-20 16:58:45 +02:00
Dag-Erling Smørgrav a5e6bee5a0 hastd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D60729
2026-10-20 15:28:42 +02:00
Dag-Erling Smørgrav 4f19e4aca4 auditdistd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:	Klara, Inc.
Sponsored by:	Qualys, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D60728
2026-10-20 15:28:37 +02:00
Dag-Erling Smørgrav 3ca4b8dd16 auditdistd: Use fixed-length protocol names
All communication between auditdistd senders and receivers and
internally between auditdistd and its worker children passes through the
same pair of send / receive functions.  The receive function uses
recv(2) with the MSG_WAITALL flag, which in theory means we should never
get a short read.  However, when handing off a socket to a worker child,
we also pass a variable-length string identifying the type of socket
we're passing, and reading this string relies on a short read.  This
used to work because the arrival of the descriptor would interrupt the
recv(2) call, but this bug was fixed when the AF_UNIX code was rewritten
a while ago and auditdistd has been broken ever since.

Fixing the length of the protocol name to four characters including the
terminating null solves the short-read bug by never requiring a short
read (nothing else in auditdistd requires one).

PR:		296107
MFC after:	1 week
Reviewed by:	js, kevans
Differential Revision:	https://reviews.freebsd.org/D59565
2026-10-13 17:55:40 +02:00
Dag-Erling Smørgrav 570869838f libfetch: Plug connection leaks in FTP code
When setting up an FTP transfer, we need to dereference the cached
connection before returning after a failure.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60017
2026-09-30 18:55:23 +02:00
Dag-Erling Smørgrav b212f565fb libfetch: Plug leak in 304 Not Modified case
When we get a 304 Not Modified response, we need to go through the error
path to properly free any resources we've allocated instead of just
returning NULL directly.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60016
2026-09-30 18:55:18 +02:00
Dag-Erling Smørgrav cd2fca49d3 libfetch: Correctly free redirect target
When processing a redirect, if we get multiple Location headers, we free
the previous one using free(new) instead of fetchFreeURL(new), which
leaks new->doc.

While here, rename new to loc since new is a reserved word in C++.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60015
2026-09-30 18:55:13 +02:00
Dag-Erling Smørgrav b319c3d6ac libfetch: Reject control characters in credentials
If a URL contains credentials, check that neither the user name nor the
password contain control characters which might confuse the server,
especially in the FTP case.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60008
2026-09-30 18:54:33 +02:00
Dag-Erling Smørgrav 64ce9daab9 libfetch: Limit response line length
When reading an FTP or HTTP response, error out if we read 64 kB before
hitting a newline.  Otherwise a runaway or malicious server could have
us spinning for quite a while allocating more and more memory before we
gave up or crashed.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60007
2026-09-30 18:54:25 +02:00
Dag-Erling Smørgrav 2447e7773e tzcode: Update to 2026e
MFC after:	1 week
2026-09-30 08:40:30 +00:00
Dag-Erling Smørgrav c8754e8778 Import tzcode 2026e 2026-09-30 10:36:39 +02:00
Dag-Erling Smørgrav d2018cedb4 xdr: Fix xdr_string
Forcing maxsize to RPC_MAXDATASIZE breaks code that deliberately uses
XDR with longer strings than permitted by SunRPC.

MFC after:	1 week
Fixes:		6448ec89e7 (" * limit size of buffers to RPC_MAXDATASIZE")
Fixes:		e17d7ab869 ("xdr_string: don't leak strings with xdr_free")
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kevans, brooks
Differential Revision:	https://reviews.freebsd.org/D59994
2026-09-29 14:12:59 +02:00
Dag-Erling Smørgrav 7399be2030 misc: Avoid use of Unicode closing single quote
The Unicode closing single quotation mark is classified as a homoglyph
and can trip automated code quality checks in downstream CI pipelines or
cause code review UIs to refuse to display a file.  If used as an
apostrophe, use the ASCII single quote instead.  If used as a closing
single quote, replace with double quotes or no quotes at all.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	ziaee, obiwac, olce
Differential Revision:	https://reviews.freebsd.org/D59911
2026-09-23 14:43:13 +02:00
Dag-Erling Smørgrav 1fb9c5ffe2 unbound: Update to 1.26.1
Release notes at
    https://community.nlnetlabs.nl/t/unbound-1-26-1-released

Merge commit '120aa088f4807126af42a652a07c5090e7294fcf'

Security:	CVE-2026-77860
Security:	CVE-2026-77955
Security:	CVE-2026-78227
Security:	CVE-2026-80225
Security:	CVE-2026-81634
Security:	CVE-2026-81642
Security:	CVE-2026-82717
Security:	CVE-2026-82720
Security:	CVE-2026-85501
2026-09-16 14:22:09 +00:00
Dag-Erling Smørgrav b7e5c2e008 hastd: Use fixed-length protocol names
All communication between hastd nodes and internally between hastd and
its worker children passes through the same pair of send / receive
functions.  The receive function uses recv(2) with the MSG_WAITALL flag,
which in theory means we should never get a short read.  However, when
handing off a socket to a worker child, we also pass a variable-length
string identifying the type of socket we're passing, and reading this
string relies on a short read.  This used to work because the arrival of
the descriptor would interrupt the recv(2) call, but this bug was fixed
when the AF_UNIX code was rewritten a while ago and hastd has been
broken ever since.

Fixing the length of the protocol name to four characters including the
terminating null solves the short-read bug by never requiring a short
read (nothing else in hastd requires one).

Note that this issue appears to have been reported independently first
by Alessandro Sagratini in PR 234576 and then by Martin Vidovic in
D57511.  I ended up going in a different direction than Martin's patch,
but his analysis was invaluable, hence the double credit below.

PR:		234576
Reported by:	Martin Vidovic <[email protected]>
MFC after:	1 week
Event:		EuroBSDcon DevSummit 2026
Reviewed by:	xtronom_gmail.com, kevans, glebius, gjb
Differential Revision:	https://reviews.freebsd.org/D59521
2026-09-16 15:56:44 +02:00
Dag-Erling Smørgrav 120aa088f4 import unbound 1.26.1 2026-09-16 15:48:08 +02:00
Dag-Erling Smørgrav 1689b875b4 libc/stdtime: Catch up with tzcode 2026d
Fixes:		212e352494 ("tzcode: Update to 2026c")
2026-09-13 15:54:42 +02:00
Dag-Erling Smørgrav 212e352494 tzcode: Update to 2026c
MFC after:	1 week
2026-09-13 15:29:59 +02:00
Dag-Erling Smørgrav 4d4fdb78db Import tzcode 2026d 2026-09-13 15:18:34 +02:00
Dag-Erling Smørgrav 4cc85d1f00 tests: Fix graid3 insert tests
The script was passing the wrong device name to `graid3 insert` and
didn't notice that the command was failing.

MFC after:	1 week
Event:		EuroBSDcon 2026 DevSummit
Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D59564
2026-09-13 14:27:50 +02:00
Dag-Erling Smørgrav 9094f86b57 graid3: Restore lock acquisition
The lock acquisition in g_raid3_ctl_insert() was improperly dropped a
while ago, making it impossible to add or replace a device in an
existing graid3.  This went unnoticed because the tests are broken.

MFC after:	1 week
Fixes:		fcf69f3dbc ("Consistently use gctl_get_provider instead of home-grown variants.")
Event:		EuroBSDcon 2026 DevSummit
Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D59563
2026-09-13 14:27:18 +02:00
Dag-Erling Smørgrav ff4b81eea8 syscalls: Avoid C++ reserved words
Both kern_renameat() and kern_dup() had arguments named `new`.  Rename
their arguments to match their respecitve manual pages.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D59386
2026-09-05 17:44:35 +02:00
Dag-Erling Smørgrav 4ec3ca55f9 hastd: Add rudimentary tests
Test that we can start and stop hastd with an empty configuration.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D59345
2026-09-05 17:44:35 +02:00
Dag-Erling Smørgrav 7dfadd78ba hastd: Add a stop control message
Add a stop control message which causes hastd to clean up and terminate.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D59344
2026-09-05 17:44:35 +02:00
Dag-Erling Smørgrav 911bda7cff hastd: Ensure nvpair padding is initialized
The proto-libnv implementation embedded in hastd pads names and values
out to the nearest multiple of eight bytes, but leaves the padding
uninitialized, leaking up to 14 bytes of recycled heap per pair in a
message.

While here, switch from bcopy() to memcpy().

MFC after:	3 days
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D59343
2026-09-05 17:44:34 +02:00
Dag-Erling Smørgrav 0abd71f39a hastd: Clean up the ebuf code
Missed an instance of bcopy().

Fixes:		48c0fc0171 ("hastd: Clean up the ebuf code")
2026-09-03 15:35:48 +02:00
Dag-Erling Smørgrav 48c0fc0171 hastd: Clean up the ebuf code
Rename the members of struct ebuf to match their function, replace
bcopy() with memcpy(), add comments explaining what each function does.

Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D59310
2026-09-03 09:58:54 +02:00
Dag-Erling Smørgrav b5ecbcd26c vmstat: Drop vm_cnt compat hack
Prior to FreeBSD 11, vm_cnt was named cnt.  When it was renamed, vmstat
was modified to fall back to the old name if the new name was not found.
It's time we dropped this.

Reviewed by:	kib, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D59255
2026-09-01 14:49:57 +02:00
Dag-Erling Smørgrav cdfc673811 various: Fix nlist invocations
Fix nlist(3) consumers that either expected our toolchain to prepend an
underscore to symbol names or expected nlist(3) to ignore the mismatch,
as it did until we overhauled it back in May.

While here, also fix cases where the last element in the list had an
empty string instead of NULL as sentinel.

MFC after:	3 days
Fixes:		4617a6cb82 ("nlist: Handle multiple symbol tables")
Reviewed by:	kib, jhb
Differential Revision:	https://reviews.freebsd.org/D59254
2026-09-01 14:49:24 +02:00
Dag-Erling Smørgrav 5076e9b546 libc: Fix C23 version macro visibility
In headers that existed prior to C23, these should be visible only in
C23 or BSD mode.

Fixes:		0fe73dcf7c ("libc: Add <assert.h> C23 feature test macro")
Fixes:		1f09e35429 ("sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macro")
Fixes:		cd0727ec70 ("libc: Add <stdio.h> C23 feature test macro")
Fixes:		fc9d02cb29 ("libc: Add <time.h> C23 feature test macro")
Fixes:		4aeed6e9d2 ("libc: Add <setjmp.h> C23 feature test macro")
Reviewed by:	fuz, kfv, dteske
Differential Revision:	https://reviews.freebsd.org/D59272
2026-08-30 19:56:51 +02:00
Dag-Erling Smørgrav a5ff4125cf install: Fix two bugs in stdin code
* Fix case where the source is - and the target exists.

* Only call chflags() (to remove flags that might prevent us from
  replacing an existing target) in the exists case; otherwise,
  to_sb.st_flags is uninitialized.

* Rename the source file in the stdin test case.

* Extend null and stdin test cases to cover the case where the
  target already exists.

PR:		297681
MFC after:	1 week
Fixes:		d34870708d ("install: Allow installing stdin")
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D59144
2026-08-26 19:34:18 +02:00
Dag-Erling Smørgrav 5db5c82fa6 arm: Quote diagnostic message
The C standard does not require diagnostic messages to be quoted, but
some tools get confused by unbalanced quotes such as the apostrophe in
“don't”.  Wrap this message in double quotes to resolve the confusion.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2026-08-25 16:57:45 +02:00
Dag-Erling Smørgrav e2f2b182c0 ObsoleteFiles: Add missing headers
The header files for dialog, figpar, dpv were never listed.

PR:		297612
Fixes:          af202a5052 ("Retire dialog")
2026-08-21 18:03:57 +02:00
Dag-Erling Smørgrav f236685161 kern/sched: Hide scheduler selection from C++
The scheduler selection interface uses names that are reserved words in
C++, causing problems for downstream projects that use C++ in the
kernel.  Work around this by hiding the interface from C++ compilers
until we can come up with a better solution.

Fixes:		ce38acee8d ("Add kern/sched_shim.c")
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	siderop1_netapp.com, imp, kib
Differential Revision:	https://reviews.freebsd.org/D58991
2026-08-20 15:57:56 +02:00
Dag-Erling Smørgrav 557ba0c2a5 yes: Avoid static initialization
Our buffer is half a megabyte, but we are only initializing the first
two bytes.  Switching from static to dynamic initialization moves it
from .data to .bss, greatly reducing the size of the binary.

Fixes:		cf74b63d61 ("yes: Completely overengineer")
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D58890
2026-08-17 18:04:35 +02:00
Dag-Erling Smørgrav 79a6ad63e6 libifconfig: Fix table size
Tables that have one element per protocol or address family were
previously sized by AF_MAX + 1 since AF_MAX was off by one.  Now that
AF_MAX has been corrected, we need to apply the opposite correction to
these tables.

Fixes:		ddd850aa77 ("sys/socket.h: Fix AF_MAX")
MFC after:	3 days
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D58827
2026-08-14 00:54:27 +00:00
Dag-Erling Smørgrav 6c41d928bc routing: Fix table sizes
Tables that have one element per protocol or address family were
previously sized by AF_MAX + 1 since AF_MAX was off by one.  Now that
AF_MAX has been corrected, we need to apply the opposite correction to
these tables.

Fixes:          ddd850aa77 ("sys/socket.h: Fix AF_MAX")
MFC after:	3 days
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	pouria, kevans, glebius
Differential Revision:	https://reviews.freebsd.org/D58826
2026-08-14 00:54:27 +00:00
Dag-Erling Smørgrav 336b6d1192 build: Use -f when copying sources
If one of the source files we copy is non-writeable, cp will create a
non-writeable copy.  If the original is later modified, cp will fail to
overwrite the copy since it is not writeable.  Using cp -f ensures the
copy always succeeds, as long as the object directory is writeable.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2026-08-13 14:31:54 +02:00
Dag-Erling Smørgrav fd79bf6344 du: Print progress information to stderr
* On SIGINFO, print the current path to stderr rather than stdout.

* Do so immediately, instead of the next time we finish a directory.

* Document this behavior in the manual page.

PR:		296861
MFC after:	1 week
Fixes:          d1588599c0 ("Report the next directory being scanned ...")
Reviewed by:	wollman
Differential Revision:	https://reviews.freebsd.org/D58702
2026-08-08 02:10:46 +02:00
Dag-Erling Smørgrav 4ebcdb8dd9 pseudofs: Don't purge the cache on shutdown
This is a waste of time and results in a use-after-free if linsysfs is
loaded and a USB network interface is in use, since USB devices are
disconnected at shutdown, which triggers a call into linsysfs, which
then tries to destroy a pseudofs node which has already been purged.

MFC after:	1 week
Reviewed by:	glebius
Differential Revision:	https://reviews.freebsd.org/D58359
2026-08-05 10:50:47 +02:00
Dag-Erling Smørgrav 7a789145f8 unbound: Update to 1.26.0
Release notes at
        https://community.nlnetlabs.nl/t/unbound-1-26-0-released

Merge commit '84ffc29dc8ddb0c946db5cb3b3c1310bec6a9e6c'
2026-08-04 18:27:21 +00:00
Dag-Erling Smørgrav 84ffc29dc8 import unbound 1.26.0 2026-08-04 12:04:44 +02:00
Dag-Erling Smørgrav ddd850aa77 sys/socket.h: Fix AF_MAX
AF_MAX was always intended to be one more than the greatest allocated
value.  Jeff broke this in 2013.  Unfortunately, a bunch of people then
decided to adapt to the mistake instead of correcting it.

Fixes:          863c7e4562 (" - Reserve a special AF for SDP.  The one we were incorrectly using before    was taken by another AF.")
MFC after:	3 days
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kevans, glebius
Differential Revision:	https://reviews.freebsd.org/D58597
2026-08-04 11:55:22 +02:00
Dag-Erling Smørgrav 351ed13488 libfetch: Further improve connection polling
* Reorganize the connection loop to make it a little more readable

* Start the timeout clock earlier

* Correctly calculate the poll timeout before calling poll()

* Don't leak the socket on failure

Fixes:		848f360c8f ("libfetch: Apply timeout to connection attempts")
Fixes:		b02e02958d ("libfetch: Fix handling of connection failures")
MFC after:	3 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D58512
2026-07-30 18:36:27 +02:00
Dag-Erling Smørgrav 744cc51456 mbuf: Parenthesize macro arguments
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2026-07-28 14:12:44 +02:00
Dag-Erling Smørgrav 51c0cdb049 pwait: Fix pwait_normal test case
Reported by:	markj
Fixes:		e115066370 ("pwait: Test the new -r option")
2026-07-27 20:54:11 +02:00
Dag-Erling Smørgrav 9d852922f6 Bump dates
Fixes:		c8f5e6819d ("pwait: Optionally wait until process is reaped")
Fixes:		eddd8aa99c ("pwait: Add a SIGINFO handler")
Fixes:		356d0b79cf ("rc.subr: Fix premature return from wait_for_pids")
2026-07-27 12:26:41 +02:00
Dag-Erling Smørgrav 356d0b79cf rc.subr: Fix premature return from wait_for_pids
Use pwait's new -r option to wait until the target processes have not
only terminated, but also been reaped.

PR:		293183
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D58391
2026-07-27 12:15:47 +02:00
Dag-Erling Smørgrav e115066370 pwait: Test the new -r option
Test that pwait without -r reports a process as soon as it terminates,
while pwait with -r does not report it until it has been reaped.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D58385
2026-07-27 12:15:41 +02:00
Dag-Erling Smørgrav eddd8aa99c pwait: Add a SIGINFO handler
On SIGINFO, print a space-separated list or remaining processes to
standard error.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D58386
2026-07-27 12:15:36 +02:00
Dag-Erling Smørgrav c8f5e6819d pwait: Optionally wait until process is reaped
If the new -r option is specified, wait until the target process not
only terminates but is reaped.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D58314
2026-07-27 12:15:31 +02:00
Dag-Erling Smørgrav 2bacbbecb1 kqueue: Add NOTE_REAP
Add a NOTE_REAP event for EVFILTER_PROC which provides a notification
when the process is reaped.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D58313
2026-07-27 12:15:26 +02:00
Dag-Erling Smørgrav 5922e9d7e7 pwait: Don't use init as a target
The time_unit test case uses PID 1 as a target for pwait.  This doesn't
work in a jail.  Since all we need is a process that we know won't die
while the test is running, we may as well use ourselves.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D58418
2026-07-25 14:44:35 +02:00
Dag-Erling Smørgrav 5dc400ff45 cp: Correct description of SIGINFO
The manual page claimed that SIGINFO caused information to be printed to
stdout, when in fact it is printed to stderr, as one would expect.  This
has been true ever since the feature was first added in 2003.

MFC after:	1 week
Fixes:		00d321a2b3 ("Add a SIGINFO handler.")
Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D58392
2026-07-23 08:21:08 +02:00
Dag-Erling Smørgrav 4627fe9e5a kqueue: Fix delivery of unwanted events
In both procdesc_kqops_event() and filt_proc(), the event variable can
have more than one bit set.  This means that:

* We cannot compare it directly with NOTE_EXIT; we must binary-and them
  instead.

* We cannot binary-or it with the report mask; we must binary-and it
  with the request mask first.

MFC after:	1 week
Fixes:		2a5e58c596 ("procdesc: add NOTE_PDSIGCHLD")
Fixes:		b328975b9d ("procdesc: report NOTE_PDSIGCHLD for traced and stopped process")
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D58395
2026-07-23 08:06:32 +02:00
Dag-Erling Smørgrav e27b1cae84 unbound: Update to 1.25.2
Release notes at
	https://community.nlnetlabs.nl/t/unbound-1-25-2-released

Merge commit 'c68e7bcd81d62e9f5364c6da22fd9917976acf85'

Security:	CVE-2026-14586
Security:	CVE-2026-32665
Security:	CVE-2026-40691
Security:	CVE-2026-41637
Security:	CVE-2026-42955
Security:	CVE-2026-44621
Security:	CVE-2026-44687
Security:	CVE-2026-44690
Security:	CVE-2026-46582
Security:	CVE-2026-50045
Security:	CVE-2026-50046
Security:	CVE-2026-50243
Security:	CVE-2026-50248
Security:	CVE-2026-50251
Security:	CVE-2026-50252
Security:	CVE-2026-52863
Security:	CVE-2026-54478
Security:	CVE-2026-55708
Security:	CVE-2026-55717
Security:	CVE-2026-55973
Security:	CVE-2026-55990
Security:	CVE-2026-55991
Security:	CVE-2026-56416
Security:	CVE-2026-56444
2026-07-22 12:23:53 +00:00
Dag-Erling Smørgrav c68e7bcd81 import unbound 1.25.2 2026-07-22 14:15:55 +02:00
Dag-Erling Smørgrav 7c51da13ae kyua-debug: Add -P option
Add -P as shorthand for --pause-before-cleanup.

MFC after:	1 week
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D56613
2026-07-22 10:38:24 +02:00
Dag-Erling Smørgrav 0eef3d01c2 install: Fix typo
MFC after:	1 week
Reported by:	markj
Fixes:		d34870708d ("install: Allow installing stdin")
2026-07-22 08:05:30 +02:00
Dag-Erling Smørgrav a931431a1d libsysdecode: Recognize NOTE_PDSIGCHLD
MFC after:	1 week
Fixes:		2a5e58c596 ("procdesc: add NOTE_PDSIGCHLD")
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D58388
2026-07-21 23:57:32 +02:00
Dag-Erling Smørgrav c93f3b55e6 libutil: Reimplement getlocalbase()
* Get rid of the pointless LOCALBASE_CTL_LEN mechanism

* Apply minimal normalization to the paths obtained from the environment
  or sysctl variable

* Turn the manual page into a manual page

* Add tests

MFC after:	1 week
Reviewed by:	se
Differential Revision:	https://reviews.freebsd.org/D58362
2026-07-21 08:31:49 +00:00
Dag-Erling Smørgrav 134ddd372f install: Code cleanup
This is mainy focused on using bool for booleans but also renames some
variables for clarity, adds some explicit comparisons, adds some braces,
with miscellanous style fixes thrown in.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D58355
2026-07-21 08:03:49 +00:00
Dag-Erling Smørgrav d34870708d install: Allow installing stdin
If from_name is "/dev/stdin" or "-" and the target is not a directory,
skip the comparison and copy data from standard input to the target.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D58348
2026-07-21 08:03:44 +00:00
Dag-Erling Smørgrav bd30d1ad78 nvme: Explicitly cast caddr_t values
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
MFC after:	1 week
Fixes:		6d0001d444 ("nvme: add support for DIOCGIDENT")
Reviewed by:	bnovkov, imp
Differential Revision:	https://reviews.freebsd.org/D58357
2026-07-21 08:03:05 +00:00
Dag-Erling Smørgrav 67518c9f56 wpa: Define CONFIG_DEBUG_FILE globally
We defined CONFIG_DEBUG_FILE only in libwpautils, not in wpa_supplicant,
so all it did was enable code that never got called.  Enable it at the
top level so it also applies to wpa_supplicant(8), and the -f option
mentioned in the manual page now actually works.

PR:		281617
MFC after:	1 week
Reviewed by:	cy
Differential Revision:	https://reviews.freebsd.org/D57723
2026-07-21 07:59:43 +00:00
Dag-Erling Smørgrav d94e034d50 pkg: Add -j and -r options
This allows pkg(7) to be used to bootstrap a jail or chroot, and to
recognize the -j and -r options and pass them through to pkg(8) if
already bootstrapped.

Note that this does not address the issue of repository keys.  If using
a signed package repository, you will still need to copy /usr/share/keys
into the target environment before or after bootstrapping, or pkg will
be unable to verify package signatures.

MFC after:	1 week
Reviewed by:	imp, bapt
Differential Revision:	https://reviews.freebsd.org/D58165
2026-07-13 17:32:41 +02:00
Dag-Erling Smørgrav 2479b6921a Import tzcode 2026c 2026-07-09 08:38:09 +02:00
Dag-Erling Smørgrav 60382b4a04 libfetch: Reduce copying
Reduce the amount of copying we do when performing buffered reads.

MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D58113
2026-07-13 08:43:56 +02:00
Dag-Erling Smørgrav d4e0e1fbc2 libfetch: Make fetch_ref an inline
Make fetch_ref() an inline and provide a fetch_deref().

MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D57944
2026-07-13 08:43:51 +02:00
Dag-Erling Smørgrav 3dddfe2924 fetch: Stop setting an alarm
Now that fetchTimeout works reliably, setting an alarm is not only no
longer necessary but counterproductive, as it will trigger even if the
connection is not actually stalled but merely slow.

While here, improve the wording of the manual page's description of the
various options for setting a timeout.

MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D57911
2026-07-13 08:43:46 +02:00
Dag-Erling Smørgrav 27b411734c libfetch: Document fetchTimeout
Document the global fetchTimeout variable, now that it works reliably.

MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D57910
2026-07-13 08:43:42 +02:00
Dag-Erling Smørgrav 848f360c8f libfetch: Apply timeout to connection attempts
Mark the socket non-blocking before connecting and poll for completion,
applying fetchTimeout if set.

MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D57909
2026-07-13 08:43:37 +02:00
Dag-Erling Smørgrav a197827737 libfetch: Add read buffering
Previously, we would read FTP control connection messages and HTTP
reponse headers one character at a time.  Now, we read as much as will
fit in our buffer and look for a newline.  If there is data left over,
it will be reused by the next fetch_getln() call.  This also requires
the addition of a fetch_bufread() which takes the buffer into account,
otherwise the start of the HTTP response body will be stuck in the
buffer after we read the last line of the header.

This should noticeably improve HTTP performance, especially for small
transfers.

MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D57907
2026-07-13 08:43:33 +02:00
Dag-Erling Smørgrav 32c341bd1c libfetch: Overhaul socket read / write
* Make fetch_ssl_read() and fetch_ssl_write() behave more like read(2)
  and write(2), and drop fetch_socket_read() in favor of read(2).

* Don't request POLLERR, it's implied.

* Don't needlessly set errno, it's relatively costly.

* Always check for EAGAIN from writev(2), otherwise we will abort on a
  short write instead of proceeding to poll(2).

* Always check for EAGAIN from poll(2) even though it can't happen on
  FreeBSD; POSIX says it can, and it might in the future.

* Rewrite fetch_read() and fetch_writev() to be more similar to each
  other.  The main difference is that a partial read is treated as
  success while a partial write is treated as failure.

PR:		296316
MFC after:	1 week
Reviewed by:	op
Differential Revision:	https://reviews.freebsd.org/D57906
2026-07-13 08:43:28 +02:00
Dag-Erling Smørgrav 9fc14dbe48 tail: Allow repetitive or contraditory options
Unlike its GNU counterpart, our tail(1) has always errored out if given
repetitive or contradictory options, even prior to Keith Bostic's 1991
reimplementation.  There is no good reason to continue to do so, not
even tradition, since many other commands (including head(1)) simply
apply the rightmost option in cases like this.

MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D58192
2026-07-13 08:42:40 +02:00
Dag-Erling Smørgrav 0b95429fde usb/quirks: More USB mass storage quirk sorting 2026-07-09 15:41:56 +02:00
Dag-Erling Smørgrav 28f617de7d tzcode: Update to 2026c
MFC after:	1 week
2026-07-09 08:22:09 +00:00
Dag-Erling Smørgrav 134a4c78d0 Retire the GNU subtree
With GNU diff and cdialog gone, this is now an empty shell.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55425
2026-07-07 08:47:40 +02:00
Dag-Erling Smørgrav af202a5052 Retire dialog
This is the last remaining piece of GPL software in the base system.
The installer transitioned to bsddialog four years ago, and the last
remaining dialog consumer, dpv, was turned off more than two years ago.
Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself.

Reviewed by:	dteske
Differential Revision:	https://reviews.freebsd.org/D55424
2026-07-07 08:47:36 +02:00
Dag-Erling Smørgrav 5f4c87e650 git-mfc: Allow merging merge commits
In order to merge merge commits (such as vendor imports), we need to
tell git cherry-pick which of the two branches referenced in the commit
is the mainline.  In our case, it is always the first.

Approved by:	markj
2026-07-06 22:02:34 +02:00
Dag-Erling Smørgrav 8b197806dc libsysdecode: Teach mktables to handle enums
While here, clean up and simplify the existing code.

MFC after:	1 week
Reviewed by:	glebius, jhb
Differential Revision:	https://reviews.freebsd.org/D57993
2026-07-06 21:41:15 +02:00
Dag-Erling Smørgrav 4805b88edb libc/resolv: Dead code and style cleanup
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57928
2026-07-06 14:23:55 +02:00
Dag-Erling Smørgrav 3f15998d25 resolv.h: Remove unused parts
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57927
2026-07-06 14:23:50 +02:00
Dag-Erling Smørgrav 60827d7885 libc/resolv: Add no-debug and no-rotate options
These are simply the reverse of the debug and rotate options.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57926
2026-07-06 14:23:43 +02:00
Dag-Erling Smørgrav fbe0257b56 libc/resolv: Reimplement the sortlist parser
When we switched from the BIND4 resolver to the BIND9 resolver, the
sortlist parser was inadvertently disabled due to a missing #define, and
nobody seemed to notice.  The sorting code remained enabled in the
resolver, but there was no way to set a sort order.

Reimplement the sortlist parser, but correctly, and update the manual
accordingly.  The new parser accepts IPv4 and IPv6 addresses with or
without a mask or prefix length, just like the old one, except IPv6
support was a bit wonky in the original code.

Fixes:		5342d17f09 ("Update the resolver in libc to BIND9's one.")
Relnotes:	yes
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57925
2026-07-06 14:23:37 +02:00
Dag-Erling Smørgrav ffeb56905e libc/resolv: Refactor the configuration parser
This was previously all a single loop in res_init(), apart from option
parsing which we cleaned up in a previous commit.  Break it out into
separate functions for reading the configuration line by line, setting
the default domain, setting the search list, and adding a nameserver
to the nameserver list.  Sprinkle bounds checks and code comments all
around.

The sortlist code, which has been disabled for the past 20 years, will
be dealt with in a separate commit.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57924
2026-07-06 14:23:33 +02:00
Dag-Erling Smørgrav 9bfdfecd27 libc/resolv: Refactor the option parser
Start the loop by finding the end of the option name, the name-value
separator (if any), and the end of the option.  Use those pointers to
simplify matching the option name and parsing the option value, and
validate option names and values more strictly.  This means that:

* We no longer accept trailing garbage in an option name or value.  For
  instance, we would previously interpret “edns0123” as “edns0” and
  “timeout:3xyz” as “timeout:3”.  This was actually quite lucky because
  we also failed to recognize the newline at the end of the option line
  as a whitespace character.

* For options that take a numerical argument, we would previously accept
  negative values and treat non-numerical arguments as 0, while large
  numerical arguments would be capped to the option's maximum permitted
  value.  Now, any failure to parse the argument, including overflow,
  results in the option being left unchanged.

MFC after:	1 week
Relnotes:	yes
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57923
2026-07-06 14:23:29 +02:00
Dag-Erling Smørgrav aba9fffebf libc/resolv: Drop Solaris 2 compatibility
MFC after:	1 week
Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D57922
2026-07-06 14:23:24 +02:00
Dag-Erling Smørgrav 4319e4bf42 resolver(5): Overhaul
* Modernize the markup

* Describe the comment syntax

* Drop obsolete advice

* Capitalize sentences

* Improve the language

* Replace no_tld_query with no-tld-query; both are supported, but all the
  other multi-word options use hyphens rather than underscores.

* Add missing ENVIRONMENT section

* Redo the example

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57921
2026-07-06 14:23:20 +02:00
Dag-Erling Smørgrav a2545f68f6 src.conf(5): Suggest using ccache4
We have separate ports for Ccache 3 and 4.  Suggest both, rather than
only the Ccache 3 port.  Rearrange the text somewhat to avoid an
excessively ragged edge on a standard 80-column terminal.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D58005
2026-07-02 17:16:52 +02:00
Dag-Erling Smørgrav 43da0c93ff usb/quirks: Sort the USB mass storage quirks
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D57930
2026-07-02 14:59:42 +02:00
Dag-Erling Smørgrav 402a657488 libsysdecode: Fix shutdownhow table
MFC after:	1 week
Fixes:		c3276e02be ("sockets: make shutdown(2) how argument a enum")
Reviewed by:	glebius
Differential Revision:	https://reviews.freebsd.org/D57915
2026-07-01 12:06:52 +02:00
Dag-Erling Smørgrav 271b8f0f09 libalias: Fix buffer overflow in RTSP aliasing
In alias_rtsp_out(), we construct a new packet in a fixed-length buffer
before copying it back into the original buffer.  We never checked if
the data we were writing to this temporary buffer fit in it, nor if the
result fit in the original buffer.

* Use a dynamically sized allocated buffer instead of a fixed-length
  stack buffer.

* Check for overflow before appending to our temporary buffer.

* Check for overflow before copying the data back to the packet buffer.

* While here, use size_t for sizes and bool for booleans.

Approved by:	so
Security:	FreeBSD-SA-26:41.libalias
Security:	CVE-2026-49420
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57753
2026-06-30 17:00:22 +00:00
Dag-Erling Smørgrav acf6518a2d OptionalObsoleteFiles: Add missing headers
The header files for dialog, figpar, dpv were never listed.

Fixes:		bc6c827078 ("OptionalObsoleteFiles: Add figpar to dialog section")
2026-06-29 21:17:52 +02:00
Dag-Erling Smørgrav 82c3877731 .git-blame-ignore-revs: Reverted accidental commits 2026-06-29 18:00:12 +02:00
Dag-Erling Smørgrav 51a4a96f63 Revert "resolver(5): Overhaul"
This reverts commit 066bef580b.
2026-06-29 17:54:01 +02:00