The linux-riscv64-openwrt target inherits linux-generic64, which sets no
asm_arch, so OpenSSL builds only its C code on riscv64. Inherit
linux64-riscv64 instead. That adds the riscv64 assembly for AES, GHASH,
ChaCha20 and SHA-2, which uses the Zb*, Zk* and vector crypto extensions
only when the CPU reports them at runtime.
libcrypto.so.3 grows by 24 KiB, and is 2.3 KiB smaller after xz.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25581
Signed-off-by: Robert Marko <robimarko@gmail.com>
libopenssl3 differs between builds depending on the environment of the
build host, e.g. in the images of the Turris Omnia:
-compiler: arm-openwrt-linux-muslgnueabi-gcc -fPIC -pthread -Os ...
+compiler: arm-openwrt-linux-muslgnueabi-gcc -fPIC -pthread -Wa,--noexecstack -Os ...
- GNU_STACK ... RWE 0x10
+ GNU_STACK ... RW 0x10
Configure probes whether the assembler supports --noexecstack by running
$CROSS_COMPILE$CC, with CC taken from the environment. A host which sets
CC to select its compiler, e.g. CC=gcc-13, makes it run
arm-openwrt-linux-muslgnueabi-gcc-13, which does not exist, so the flag
is silently dropped and libcrypto ends up with an executable stack.
Pass CC=gcc to Configure, so that it always probes the cross compiler.
With CC=gcc-13 in the environment, the configuration now gets
-Wa,--noexecstack like a build without CC set.
Link: https://github.com/openwrt/openwrt/pull/25719
Signed-off-by: Paul Spooren <mail@aparcar.org>
zlib-ng decides whether to build its POWER8 and POWER9 sources from a
probe that compiles getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07 and
nothing else, so it accepts any target whose libc has getauxval. On
mpc85xx that offers POWER8 to an e500v2 and the build fails:
adler32_power8.c:126:13: error: '__builtin_vsx_lxvw4x_v16qi' requires
the '-mvsx' option
POWER8 is ISA 2.07 and POWER9 is ISA 3.0, 64-bit server ISAs that no
32-bit PowerPC in the tree implements, so turn both off for
ARCH=powerpc. powerpc64 keeps them, where they build and zlib-ng gates
them on HWCAP2 at runtime.
Fixes: b6ab56871d ("zlib: switch to zlib-ng 2.3.3 in zlib-compatible mode")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
zlib-ng built with ZLIB_COMPAT provides libz.so.1 with the zlib API and
ABI, and carries maintained SIMD code with runtime CPU detection: NEON
on ARM, the ARMv8 CRC32 instructions, and SSE/AVX on x86.
zlib-ng 2.3.3 lacks the functions zlib 1.3.1.2 and 1.3.2 added:
deflateUsed() and the size_t variants compress_z(), compress2_z(),
compressBound_z(), deflateBound_z(), uncompress_z() and uncompress2_z().
Backport both from zlib-ng develop, and the zlib.map.in change of
zlib-ng PR 2403 that exports deflateUsed under ZLIB_1.3.1.2, so libz.so.1
exports every symbol and version node of zlib 1.3.2.
Build with -DNO_QUICK_STRATEGY. deflate_quick makes level 1 output of a
4 MiB text file 20% larger than zlib's; levels 3 to 6 keep
deflate_medium.
Install zlib_name_mangling.h, which the compat zconf.h includes. The
host build in tools/zlib stays on zlib.
On IPQ8074 (Cortex-A53), 4 MiB of text, median of 3 interleaved runs:
inflate 34.0 -> 22.7 ms, deflate level 6 460 -> 270 ms. libz.so.1 grows
by 18.9 KiB on aarch64, 9.8 KiB on arm_cortex-a7 and 9.1 KiB on
mips_24kc, compressed with xz.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25570
Signed-off-by: Robert Marko <robimarko@gmail.com>
Patch 004 builds vendored copies of inflate.c and inffast.c from 2017
(madler/zlib#256, never merged) instead of the stock files on 32-bit
ARM targets with NEON. The vendored inflate.c lacks the CVE-2022-37434
fix that zlib 1.2.13 and later carry.
Drop the patches and the NEON probe, so every target builds stock
zlib. aarch64 is unaffected: gcc does not define __ARM_NEON__ there,
so the probe never enabled the vendored files.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25570
Signed-off-by: Robert Marko <robimarko@gmail.com>
PCRE2 supports JIT on RISC-V and LoongArch64, but PCRE2_JIT_ENABLED
cannot be selected for them. Allow it and enable it by default, as on
aarch64.
libpcre2-8.so grows by 61 KiB on riscv64 and 54 KiB on loongarch64,
compressed with xz.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25582
Signed-off-by: Robert Marko <robimarko@gmail.com>
RISC-V is becoming more popular, and it's beneficial to have OpenSSL
optimized for speed on riscv64 architectures by default. And many
algorithms in OpenSSL currently lack assembly optimizations for riscv64,
so optimizing for speed for riscv64 will bring significant performance
improvements for C implementations. For example, the performance of
ChaCha20 improves dramatically with this change, from 63603.67k to
129428.12k on Bananapi BPI-RV2 with rva22u64 profile.
All existing boards that use riscv64 that support boot from SDCard or at
least 128M NAND flash, so the slight increase in binary size is
acceptable. And I have tested this change to build with even rva22u64
profile, the libssl.so.3 only increases from 972K to 1.1M, which is
acceptable for most use cases.
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Link: https://github.com/openwrt/openwrt/pull/21070
Signed-off-by: Robert Marko <robimarko@gmail.com>
Is a security patch release. The most severe CVE fixed
in this release is High.
This release incorporates the following bug fixes and mitigations:
* Fixed DTLS retransmissions of handshake messages from a stale buffer offset.
([CVE-2026-84782])
* Fixed excessive memory allocation in relative CRLDP processing.
([CVE-2026-35189])
* Fixed QUIC unvalidated amplification credit may be over-accounted.
([CVE-2026-35191])
* Fixed potential CPU DoS via O(n^2) fragment reassembly in QUIC.
([CVE-2026-42772])
* Fixed a timing side-channel in scalar multiplication for mon-NIST EC curves.
([CVE-2026-54872])
* Fixed QUIC `STREAM` fragment metadata DoS.
([CVE-2026-54873])
* Fixed non-constant-time SM2 scalar multiplication on ARM64 and RISC-V.
([CVE-2026-54875])
* Fixed out-of-bounds access after `SSL_set_SSL_CTX()` during a handshake.
([CVE-2026-72897])
* Fixed QUIC connection-level flow control was not enforced for streams.
([CVE-2026-75804])
* Fixed a NULL pointer dereference in CMP client revocation response handling.
([CVE-2026-75805])
* Fixed an unauthenticated and undersized DTLS 1.2 AEAD record causing DoS.
([CVE-2026-75806])
* Fixed a timing side-channel in SM2 signature generation.
([CVE-2026-77696])
* Fixed an unbounded `RETIRE_CONNECTION_ID` backlog in QUIC stack
implementation.
([CVE-2026-84784])
* Fixed a bug where `EVP_DecryptFinal()` incorrectly reported a stale success
on AES-SIV authentication failure.
Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25557
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
With ccache enabled, MKlib_gen.sh treats ccache as the compiler when
probing its version. It therefore misses GCC's required -P workaround
for line markers introduced while expanding macros. The generated
lib_gen.c then fails to compile with GCC 14.4.0, reporting:
"_Bool" after # is not a positive integer
Pass -P explicitly to the make-time preprocessor used by the ncurses
source generators. This fixes the apm821xx/nand and qoriq/generic
external-toolchain CI failures without changing compiler detection
or the source library API. Increment the package release.
Build-tested complete static/shared ncurses, menu, form and panel
libraries with ccache and the failing PowerPC GCC 14.4.0 toolchains.
The same build also passes with MIPS32 GCC 16.2.0. The original
make-time CPP command reproduces both PowerPC failures.
Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Assisted-by: Codex (OpenAI GPT-6)
Link: https://github.com/openwrt/openwrt/pull/25538
Signed-off-by: Robert Marko <robimarko@gmail.com>
Changelog: https://github.com/the-tcpdump-group/libpcap/blob/libpcap-1.10/CHANGES
CVE fixes:
- CVE-2026-0799: Access M[] safely in the BPF interpreter.
- CVE-2026-31912: Mind the program bounds in pcap_offline_filter().
- CVE-2026-31911: Fail opcodes safely in the BPF interpreter.
- CVE-2026-6244: Avoid division by zero via pcap_offline_filter().
- CVE-2026-6554: Limit "ja L" looping in pcap_offline_filter().
- CVE-2026-18313: Fix a memory leak in rpcapd.
- CVE-2026-18238: Fix RPCAP_MSG_PACKET validation.
Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25384
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
A package builds with -j1 unless it sets PKG_BUILD_PARALLEL, and 171 of
the 220 packages do not set it. These three gain the most from the job
server on a cold build of this tree:
mtd-utils 24.77 s -> 6.43 s
libsepol 17.99 s -> 2.18 s
libselinux 7.82 s -> 1.89 s
mtd-utils runs while nothing else does, so its 18 s count against the
wall clock in full.
Each one builds three times out of three with the job server, and each
build writes a tree that is identical to the one a serial build writes.
nftables gains as well, 17.9 s to 13.0 s, but it is left alone: its
build directory differs between two serial builds, so the check that
covers the other three says nothing about it.
Signed-off-by: John Crispin <john@phrozen.org>
Commit 30fb675847 ("gettext-full: disable parallel compilation")
disabled parallel builds of gettext 0.21, as they failed with make -j12.
With gettext 0.24.2, the host and the target build passed four times
each with make -j24, and libintl-full does not change. The host build
takes 172 s instead of 231 s, and the target build 142 s instead of
214 s. With all packages selected, both are on the longest chain of a
clean build.
Signed-off-by: John Crispin <john@phrozen.org>
The configure script links libatomic whenever the compiler cannot
inline 64-bit atomic builtins, but libusb only uses word-sized atomics
and never imports a symbol from it. Tell configure that
__atomic_fetch_add_4 needs no library and remove the dependency.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The open-coded architecture list pulls libatomic onto every ARM target
although ARMv6K and ARMv7 inline 64-bit atomics. ATOMIC64_DEPENDS
covers exactly the targets whose compiler emits libatomic calls.
OpenSSL's linux-armv4 and mips configurations link libatomic
regardless, so link with --as-needed to drop it where libcrypto
imports nothing from it.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
OpenSSL 3.5.8 fixes zero-length message handling for AES-GCM-SIV
upstream with commit bdeb0cd994d9 ("Check the tag on EVP_Cipher()
finalize: Poly1305 and OCB AEADs", CVE-2026-75803, backport of
5741d29a5f35): aes_gcm_siv_finish() now generates the tag when the
finalization is the first empty-message operation.
That makes the cipher_aes_gcm_siv.c hunk of our local patch redundant,
and worse than redundant. By substituting the address of an empty
object for the NULL input pointer it keeps routing the terminal
EVP_Cipher(ctx, out, NULL, 0) call to aes_gcm_siv_encrypt()/
aes_gcm_siv_decrypt() instead of aes_gcm_siv_finish(), so the tag
supplied by the caller is never compared and a forged tag is accepted.
That is the hole the upstream commit closes.
Measured against a locally built 3.5.8; the EVP_Cipher() return value
is a byte count, so 0 means the tag was accepted and -1 means it was
rejected:
decrypt empty msg EVP_Cipher(out, NULL, 0)
genuine forged genuine forged
3.5.8 vanilla ok rejected 0 -1
3.5.8 + patch 010 ok rejected 0 0 <- bad
3.5.8 + this commit ok rejected 0 -1
AES-SIV has no equivalent fix in 3.5.8 or in openssl master, and
without the second hunk a zero-length message cannot be encrypted at
all, so keep that hunk and rename the patch to match what is left.
Fixes: 2bc7978323 ("openssl: fix AES-GCM-SIV and AES-SIV with zero-length messages")
Assisted-by: Claude:claude-opus-5
Link: https://github.com/openwrt/openwrt/pull/24944
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Upgrade ncurses snapshot 6.6.20260801. This includes fixes that enable
the maintained patches to be dropped. It also introduces additional
terminfo files for the terminal emulator ghostty.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Since the introduction of the host package for ncurses, it has attempted
to install terminfo files directly into the build machine's /usr/lib.
When not root, this silently fails to install. On ncurses versions after
v6_4_20230708, ncurses fails to install instead of silently failing.
Remove the host terminfo database installation to avoid this unexpected
behavior.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
The ncurses tarballs are infrequently released. Start building ncurses
from the git repo to be able to get fixes and improvements quicker.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Introduce a config, CONFIG_LIBNCURSES_TERMINFO, that allows a user to
install additional terminfo files into the target filesystem. This helps
avoid needing to add arbitrary additional terminfo files to the default
list while still providing an easy way to include the files.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
This version fixes security issues and bugs.
Security fixes:
* Fix a side channel in RSA PKCS#1 v1.5 decryption. (CVE-2026-50587)
* Fix a bug where transcript-hash computation errors during TLS 1.2 extended master secret calculation could be ignored instead of causing the handshake to fail. (CVE-2026-50581)
* Fix a TLS 1.3 server-side error-handling bug affecting session ticket generation. (CVE-2026-50640)
* Fix renegotiation failing and potentially causing a buffer overflow in DTLS when badmac_limit is enabled. (CVE-2026-50713)
* Reject ChaCha20 operations that would make the 32-bit block counter wrap around, which could otherwise reuse keystream and compromise confidentiality. (CVE-2026-50584)
* Fixed a TLS 1.3 record-boundary validation issue that could allow unauthenticated plaintext data to be processed across a key change.
* Fix a possible buffer overflow in mbedtls_ecdh_calc_secret() (CVE-2026-35336)
* Fix a remote buffer overflow in (D)TLS with ECDHE-PSK cipher suites when CBC is disabled. (CVE-ID-50580)
* Fix a side channel in ECC computations that allows a powerful local attacker (typically, untrusted OS attacking a secure enclave) to fully recover long-term secret keys). (CVE-2026-54435)
* Fix a potential information disclosure in TLS 1.2 servers using session tickets. (CVE-2026-50586)
* Fix timing side channel in RSA key generation, prime generation and primality testing, on platforms where division is not constant-time.
* Fix a 1-byte buffer overread when parsing a malformed ECC public key in the PK module. (CVE-2026-50583)
* Fix an out-of-bounds read when parsing TLS 1.2 ECJPAKE ServerKeyExchange messages. (CVE-2026-50588)
* Fix a use-after-free/double-free risk in mbedtls_pkcs7_free() when reusing an mbedtls_pkcs7 context across parse -> free -> parse -> free cycles. (CVE-2026-50579)
* PKCS7 now rejects weak hash algorithms (RIPEMD160, MD5, SHA-1, SHA-224, SHA3-224) on signature verification.
* Improved documentation of mbedtls_ssl_conf_sig_algs() to emphasize that this function only sets signature algorithms that are enforced during TLS key exchange and not on certificate verification. (CVE-2026-54441)
* Ensure 'dtls_srtp_info' field from 'mbedtls_ssl_context' is properly zeroized when mbedtls_ssl_session_reset() is called. (CVE-2026-50585)
* Fix a bug where mbedtls_ssl_read() and mbedtls_ssl_write() could return 1 instead of an error code if the random generator failed when a server called these functions before the end of a TLS 1.3 handshake.
* Fix TLS 1.3 clients to reject a HelloRetryRequest whose selected group was not advertised in the original ClientHello. (CVE-2026-25832)
* Fix two bugs in the X.509 certificate parser that caused some inputs with a malformed basicConstraints extension to be accepted. (CVE-2026-49300)
Full release notes: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.7
Remove backported upstream patches that are included in this release.
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24131
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Update to a newer bugfix release of gettext.
This version includes a commit to make adjustments
according to changes in gnulib in early 2025.
Add DEPENDS variable to package definition
in order to enforce the correct build order,
which should have been done when libunistring
and libxml2 packages were moved to openwrt core.
No patch requires refresh.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24247
Signed-off-by: Robert Marko <robimarko@gmail.com>
e2fa9dcf67a8 uloop: fix use-after-free when cancelling interval timers
329d823294a0 uloop: keep signal handler installed while other watchers remain
3362b39a1c03 kvlist: fix use-after-free when updating an entry in place
b33f74af02b2 list: define list_prev_entry used by list_for_each_entry_continue_reverse
65f62583c236 udebug: check hdr before dereferencing it in set_start_time
9d7fb82530b5 udebug: reject non-power-of-two ring metadata from a peer
2e0e7f0f4d38 udebug: verify shared-memory fd size before mapping
dda814a9750a usock: retry poll() on EINTR in usock_wait_ready()
72e2b396bd9a ustream: reset byte and buffer counters when freeing buffers
be161d0320da utils: guard cbuf_order against zero and one
08081477ad6c uloop: fix kevent() eventlist size argument in register_kevent
0c3eec553828 uloop: fix kqueue timer interval arithmetic
a9ab90bd1d5d uloop: fix use-after-free in signal_consume when a callback deletes a watcher
c08a4ab53129 uloop: fix use-after-free in uloop_handle_processes when a callback deletes a process
7677b7a4f3a4 vlist: pass the tree as comparator context in VLIST_TREE_INIT
Signed-off-by: Felix Fietkau <nbd@nbd.name>
f227ab4f1285 uclient: fix memory leak of url when backend alloc fails
645236607a3d uclient: free proxy_url in uclient_free
53d2d11fb00d uclient-http: fix NULL deref when digest WWW-Authenticate lacks params
0ba1b8718be5 ucode: check calloc return in uc_uclient_new
5cb19466d076 uclient-fetch: reset redirect counter per request
568c447950c1 uclient-fetch: retry short writes and surface errors
4c4a61a69ac3 uclient-fetch: use strtoull to parse Content-Length
440ca260622d uclient-http: validate Content-Length and chunk sizes from the server
8658324bd234 uclient: cast to unsigned char before ctype classifications
bf403fa0f8e5 uclient-fetch: reject CR in --header values
ec47f4176b1e uclient-fetch: always allocate auth_str and free it on exit
391dacd10d31 uclient-http: fail digest auth when the cnonce cannot be randomized
ba1f4311b099 ucode: clamp read length to the size of the static buffer
0ba47f319b09 uclient-fetch: advance to the next URL between requests
9dd0055d527d uclient: initialize *port for unknown address families
f816506651d5 uclient-http: start digest nonce count at 1
9b9b2da40835 uclient-http: fix 2-byte buffer undercount in digest add_field
80fb1e5ee68b ucode: avoid double-free of SSL context on ssl_init error
d44fb561bbcf ucode: don't clear an unrelated registry slot on free
02562403d2a3 uclient-fetch: close the output file before fetching the next URL
4a63561d0012 uclient-http: initialize fd to -1 so a failed connect can't close stdin
428ae8342118 uclient: cancel pending timers in uclient_free()
ffd8db308289 uclient-fetch: guard SSL debug setup against a missing SSL context
9f4db039a263 ucode: release callback argument references
d2af92b0aad9 uclient-http: resolve redirects against the proxy target URL
5dddda023267 uclient-utils: avoid out-of-bounds pointer in get_url_filename
8507588e7ce7 uclient-http: use the proxy target URL for HTTP authentication
322c89c6ca0a uclient-http: retry 401 auth for all body-less request methods
db3bb00ddda7 uclient-http: accept unquoted digest auth parameter values
5ce9983b2a11 uclient-http: follow 303 and 308 redirects
070c868486dc uclient-fetch: finalize request on invalid 206 Content-Range
83659a5a9bc1 uclient-fetch: concatenate multiple URLs into a single -O file
43bed2753998 ucode: don't leak string references in status()/get_headers()
03b17e4fc793 uclient-fetch: attach credentials to the proxy target, not the proxy
74c07b12f7ab uclient-fetch: don't run the progress meter in spider mode
daad21fa2c17 uclient-fetch: handle init_request failure on the 204 resume retry
Link: https://github.com/openwrt/openwrt/pull/23693
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
895f92164b66 uloop: add ULOOP_PRIORITY support for EPOLLPRI events
f9b1f3ff17ba uloop: revert my flag changes from the ULOOP_PRIORITY change
2982bfb1c325 blob: fix wrong type for realloc result in blob_buffer_grow()
78c20f6c8579 json_script: convert recursive __json_script_file_free() to iterative
e7c13bf8cbca usock: fix off-by-one in nanosecond normalization in poll_restart()
68b3f1588de4 uloop: usock: add error checking for fcntl and remove duplicate include
03821f942c49 uloop: fix undefined behavior in signal bit operations for signals > 32
e6e6fd83e26d blobmsg: fix policy name length overflow and add bounds check in blobmsg_parse()
d30b9cc1a02d usock: fix integer overflow in timeout calculations
406e342bb900 udebug: fix double off-by-one in udebug_entry_vprintf()
700eca0bac66 blobmsg_json: fix integer overflow in blobmsg_puts()
6351fe552162 blobmsg_json: floor strbuf size and tighten the post-format guard
58b6543f1b25 blobmsg: fix unsigned integer overflow in blobmsg_alloc_string_buffer()
d7a3ae699df0 blobmsg: use correct byte-order macro when setting BLOB_ATTR_EXTENDED
23c6618a5b90 blobmsg_json: fix double format string to avoid truncation and data loss
1edf1d704e76 jshn: fix integer overflow and type confusion in jshn_parse_file
9b488010c4a7 utils: fix integer overflow in __calloc_a()
40a87f734b94 blob: fix integer overflow in buffer growth functions
02fccb465651 blob: use size_t for blob_memdup() length
0fa612ca08f7 json_script: avoid alloca() on attacker-controlled pattern length
8c9862b6921b blobmsg: fix integer overflow in blobmsg_realloc_string_buffer()
5fbef5bb94fb ustream: avoid INT_MAX overflow on malloc in ustream_vprintf()
1501e60e5554 md5: detect read errors in md5sum() instead of returning a bogus hash
Link: https://github.com/openwrt/openwrt/pull/23212
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>