gstat: Set errno = 0 before strtoul
The strtoul function sets errno on error, but does not clear it on
success; when using strtoul and checking errno (as one should) for
ERANGE / EINVAL afterwards, it's important to zero errno first.
While here, remove a dead store.
Reviewed by: phk
Fixes: 4fe8c1b67be0 ("Add error and range checking ... ")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59270
(cherry picked from commit 6ddb10cf6b7f870d749e96d2ae55976b18896f54)
gstat: Set errno = 0 before strtoul
The strtoul function sets errno on error, but does not clear it on
success; when using strtoul and checking errno (as one should) for
ERANGE / EINVAL afterwards, it's important to zero errno first.
While here, remove a dead store.
Reviewed by: phk
Fixes: 4fe8c1b67be0 ("Add error and range checking ... ")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59270
(cherry picked from commit 6ddb10cf6b7f870d749e96d2ae55976b18896f54)
tcp: fix TCPS_CLOSED state underleak in syncache_socket()
The syncache entry holds one TCPS_SYN_RECEIVED count that normally is
transferred to the the newborn tp. Upon failure syncache_socket() shall
not use TCPSTATES_INC/TCPSTATES_DEC (see 5050df3f4aa4 why). But when
syncache_socket() fails in_pcbconnect(), it calls tcp_discardcb() to free
resources that were just allocated by tcp_newtcpcb() and this
tcp_discardcb() would do TCPSTATES_DEC(tp->t_state). The t_state is
TCPS_CLOSED at this point.
Make tcp_discardcb() symmetrical to tcp_newtcpcb() - not responsible for
the TCPSTATES. Make the caller responsible for state count book keeping.
Reviewed by: tuexen
Fixes: 3703e1a73e0e0367c04f47f793e46495e46e647b
Differential Revision: https://reviews.freebsd.org/D59325
[RISCV] Fix infinite DAGCombine loop with SETCC and SIGN_EXTEND_INREG (#221593)
We generalized (X & -(1 << C1) & 0xffffffff) == C2 << C1 using `sraiw`.
The combine generates a `SIGN_EXTEND_INREG` when simplifying.
However, when C1 is 0 and the sign bit (bit 31) of X is already known to
be zero, `DAGCombiner` sees that `SIGN_EXTEND_INREG` is semantically
equivalent to `AND X, 0xFFFFFFFF` (zext). Because `DAGCombiner`
considers `AND` to be more canonical than `SIGN_EXTEND_INREG` in this
context, it immediately reverts the node back to `AND`.
This caused an infinite DAGCombine loop. This patch disables the folding
when the C1 is zero. That case is covered by a later combine that already
checks if bit 31 is known to be zero.
Fixes: https://github.com/llvm/llvm-project/issues/221521
security/pkcs11-tools: Update 3.0.0 => 3.1.0
Port Changes:
- Use distribution tarball rather than pure source code
for prebuilt manpages instead of depending on Pandoc.
Changelog:
https://github.com/Mastercard/pkcs11-tools/blob/v3.1.0/CHANGELOG.md
PR: 297826
Approved by: osa, vvd (Mentors, implicit)
Co-authored-by: Yusuf Yaman <nxjoseph at FreeBSD.org>
inpcb: use new local address in in_pcbconnect()
when collecting necessary locks for the operation. The IPv6 version
is already correct.
Submitted by: Nick Price <nick spun.io>
Fixes: 1dda8ba77a20d983774a3bf0e94c51c93f1d8758
devel/tinygo: Update 0.19.0 => 0.42.0, take maintainership
The port has been stuck at 0.19.0 since 2021 and was deprecated on
2026-08-08 along with the other ports pinned to Go 1.25, scheduled for
removal on 2026-09-30. Upstream 0.42.0 supports Go 1.27 and LLVM 22, so
the pin goes away and with it the reason for the deprecation.
Upstream renamed Makefile to GNUmakefile, dropped the git rev-parse call
and ships the submodule marker files the build checks for, so
files/patch-Makefile is no longer needed at all and the port now builds
unpatched. wasm-opt is taken from devel/binaryen rather than built from
the bundled copy, and build/release no longer produces a pkg directory.
The bundled LLVM is now a fork of llvm-project carrying the Xtensa
backend, pinned by the commit recorded in llvm-version.txt. Keeping it
bundled rather than switching to devel/llvm22 is what makes the Xtensa
targets work, ESP32 included.
tinygo resolves GOROOT by running "go" from PATH, which the package does
[13 lines not shown]
security/q-feeds-connector - add db_update action which indexes the additional feed information in sqlite, which will be executed during a regular update after fetch.
linuxkpi: Add `split_page()`
This function is supposed to split large pages into an array of
`PAGE_SIZE`-sized pages, with correct refcounting. This is apparently
used to allow some drivers to free a part of a large page only.
I don't think we use large pages in linuxkpi. Therefore, this new
function is curently a no-op.
The DRM drivers TTM memory manager started to use it in Linux 6.15.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58762
linuxkpi: Update `struct vm_area_struct` when an existing mapping is extended
With Mesa 26 and DRM drivers in Linux 6.13, userspace will try to extend
an existing mmap, at last push the end address further.
Before this change, the mapping was not updated, but userspace would try
to access a page after the initial end address, leading to a panic
triggered by the following assertion in `vm_fault_populate()`:
MPASS(fs->first_pindex <= pager_last);
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58195
linuxkpi: Add `kthread_run_worker()`
On Linux, `kthread_run_worker()` differs from `kthread_create_worker()`
by waking up the task after creating it with `kthread_create_worker()`.
On FreeBSD, we already execute it and wait for it, so probably no need
to do anything further. Therefore, `kthread_run_worker()` is an alias to
`kthread_create_worker()`.
The DRM drivers generic code started to replace
`kthread_create_worker()` by `kthread_run_worker()` as is in Linux 6.14.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57701
linuxkpi: Alias `sd` field of `struct kobject`
On Linux, a `struct kernfs_node *` pointer, representing a directory in
sysfs, is kept in the `sd` struct field.
We don't have that on FreeBSD because we use sysctls instead. Let's
alias the sysctl OID pointer to `sd` using an union.
This pointer is checked by the DRM drivers using:
if (var->kobj.sd) {
...
}
The amdgpu DRM driver started to use these checks in Linux 6.13.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57586
graphics/heimer: Fix building with CMake 4
It is already fixed upstream the proper way, so this knob is only a temporary
measure.
Approved by: portmgr (fixit blanket)
www/code-server: Fix process listing
Split the ps(1) arguments the same way editors/vscode does; FreeBSD's
ps does not accept the combined column list, which broke the process
explorer and the process diagnostics.
Also document which extensions need a native language server on
FreeBSD and how to configure them, install the document as
EXTENSIONS.md and point to it from the install message.
Obtained from: editors/vscode (ps.ts patch)
Sponsored by: Netzkommune GmbH
[offload][omp] Manage memory allocation through liboffload
Migrate DeviceTy::allocData/deleteData off GenericPluginTy::data_alloc/
data_delete onto liboffload's olMemAlloc*/olMemFree, migrate
targetLockExplicit/targetUnlockExplicit off data_lock/data_unlock onto
olMemRegister/olMemUnregister (fixing a latent bug where these passed
the OpenMP-visible device number instead of the plugin device id), and
migrate DeviceTy::isAccessiblePtr onto a new olMemIsAccessible API
(added with a unit test) since liboffload had no equivalent for
querying accessibility of arbitrary, not-necessarily-liboffload-
allocated pointers. Removes the now-dead GenericPluginTy::data_alloc/
data_delete/data_lock/data_unlock/is_accessible_ptr wrappers and their
exports entries.