Commit graph

24,075 commits

Author SHA1 Message Date
Lauren Murphy
24b75db466 llext: add CONFIG_LLEXT_CUSTOM_HEAP_PLACEMENT
Enclose default LLEXT heap section placements with
!CONFIG_LLEXT_CUSTOM_HEAP_PLACEMENT. Users who want to
write a custom linker script can include files like
snippets-noinit.ld, common-noinit.ld or the SOC linker
scripts without including the default LLEXT heap
section placements.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2026-04-18 12:37:46 -04:00
Nikhil Namjoshi
d2aec6ab1e net: tcp: Validate TCP header before connection search in tcp_recv
Moved the TCP header validation in tcp_recv() before the connection
lookup to prevent processing malformed packets and improve efficiency.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-18 12:37:34 -04:00
Nikhil Namjoshi
77aa045b19 net: tcp: Invert invalid condition check in tcp_input
Inverted the condition in tcp_input() to correctly process
valid packets and drop invalid ones.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-18 12:37:17 -04:00
Lauren Murphy
9b4fb20000 llext: relax memblk block size restriction
Reduce scope of restriction that
CONFIG_LLEXT_HEAP_MEMBLK_BLOCK_SIZE be a multiple
of LLEXT_PAGE_SIZE to apply only when CONFIG_MMU
or CONFIG_MPU are enabled.

Referring to llext_copy_region in llext_mem.c, we
see that allocations only need to be sized / aligned
to LLEXT_PAGE_SIZE when MMU or MPU is enabled.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2026-04-17 15:52:39 -05:00
Jordan Yates
a29c14aeec net: conn_mgr: binding configuration check
Add an optional function to connectivity bindings that communicates
whether the binding has the configuration it needs in order to attempt
a connection. This is then used by the connectivity API for
non-persistent interfaces to determine whether it makes sense for the
interface to be powered up.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-17 15:52:09 -05:00
David Boullie
ba3984a658 net: ieee802154: move ieee802154_frame.h to common location
Move header for IEEE 802.15.4-2020 constants from subsystem
location to common for usage by 15.4 radio device drivers.

Signed-off-by: David Boullie <David.Boullie@silabs.com>
2026-04-17 15:51:19 -05:00
Jakub Rzeszutko
79cf685dfe shell: prevent deadlock from non-yieldable context
shell_vfprintf can block on k_event_wait when the TX ring buffer is full.
Calling it from a non-yieldable context (ISR, spinlock, pre-kernel)
causes a deadlock.

Add a k_can_yield() check in shell_vfprintf as both an assert for debug
builds and a runtime guard that silently drops the output when called
from a context that cannot yield, preventing the deadlock regardless
of whether asserts are enabled.

Fixes: #103954

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2026-04-17 16:42:54 +01:00
Alberto Escolar Piedras
ecd9f0a347 Bluetooth: Controller: ecb: Remove two ifdefs for simulation
For a busy wait needed only for simulation we can use the Z_SPIN_DELAY
macro which is more compact and does nothing in real targets.

For the ecb test, we do not need to treat simulated HW differently than
real HW.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-04-17 16:42:23 +01:00
Kapil Bhatt
31866086a5 net: wifi: Set frequency default value as zero for P2P Connect
For P2P connect set frequency default value as 0.
Let wpa_supplicant choose channel. User can override with -f option.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-04-17 16:42:16 +01:00
Håvard Reierstad
2c6c80ddf6 bluetooth: host: Re-key SC config on identity resolution
When a client subscribes to Service Changed CCC before bonding
and privacy is enabled, the SC config is initially stored under
the peer's RPA. On reconnection with a new RPA, sc_restore()
looks up the config by identity address and fails to find it,
so the SC indication is never delivered.

Re-key the SC config entry from the RPA to the resolved identity
address in bt_gatt_identity_resolved(), matching the existing
re-keying logic for CCC and CF configs in the same callback.

If a separate entry already exists under the identity address,
merge the attribute handle ranges and remove the duplicate.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Co-authored-by: Einar Thorsrud <einar.thorsrud@nordicsemi.no>
2026-04-17 15:57:35 +02:00
Håvard Reierstad
814b824c88 bluetooth: host: Add assert to gatt update_range
Adds an assert to the `update_range` function in gatt.c to verify
that the start handle is not larger than the end handle.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-04-17 15:57:35 +02:00
Emil Gydesen
57816adfa7 Bluetooth: BAP: Broadcast sink MIC failure behavior
Modify the behavior of update_recv_state_big_cleared to follow
what the current BASS test specification and PTS expects to pass
test cases related to bad broadcast codes. There are open
errata for this behavior to properly define it, but until then
we should follow what the qualification tests expect.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 15:55:18 +02:00
Krzysztof Chruściński
4a3cf66c07 drivers: debug: coresight_nrf: Re-enable early logging
At some point CONFIG_LOG_FRONTEND_STMESP_EARLY_BUF_SIZE default value
was set to 0 on cpuapp. It meant that log entries which happend before
STM and Coresight initialization were lost. Add buffer which is used
to store those logs.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-17 13:43:51 +02:00
Maochen Wang
8cb5ac07f4 net: l2: wifi: reject invalid PSK/SAE password length in AP mode
Add input validation for PSK and SAE password length in wifi_ap_enable().
Invalid lengths could trigger driver-side assertions during AP startup.
Return -EINVAL when parameters are out of range instead of letting the
AP enable flow proceed.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2026-04-17 12:37:30 +01:00
Lyle Zhu
cf7693a826 bluetooth: classic: hfp_hf: Fix out-of-bounds access in indicator index
Add validation to ensure the indicator index is within the valid range
of the ind_table array before accessing it in cind_handle_values().

Without this check, an out-of-bounds index could lead to buffer overrun
when the index is used to access hf->ind_table array elements later in
the function.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-17 12:37:24 +01:00
Emil Gydesen
a1d1fefa9d Bluetooth: CSIP: Fix bad atomic check in add_bonded_addr
To ensure correctness and to avoid any race conditions,
atomic_test_and_set_bit should be use instead of a atomic_test_bit
followed by an atomic_set_bit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 12:36:30 +01:00
Emil Gydesen
9e48895e00 Bluetooth: CSIP: Add bonded addr to all svc_insts
add_bonded_addr_to_client_list returned after adding the address of
`info->addr` once, which mean that only the first svc_inst got updated

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 12:36:30 +01:00
Marek Pieta
e8e596dcf1 bluetooth: host: Improve bt_keys loading from settings
Before config flags were introduced to `bt_keys`, the `keys_set`
allowed loading previously stored keys after disabling support for
Bluetooth LE legacy pairing or signing during DFU (only beginning of the
settings record was used after the DFU).

Introducing version field prevents from loading keys in this scenario.
Settings records that contain extra data are not migrated to the new
format during the settings load operation and eventually are cleared.

Change allows to automatically migrate `bt_keys` stored with extra data
to the new format in the most common scenario where both legacy pairing
and signing support are disabled. This allows to still properly load and
use the keys.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2026-04-17 12:35:06 +01:00
Lyle Zhu
803c19fc91 bluetooth: host: l2cap_br: improve buffer allocation error handling
Improve error handling for L2CAP BR/EDR signaling buffer allocation
failures by introducing a fallback mechanism and proper cleanup paths.

Add l2cap_br_create_pdu() helper function that attempts to allocate
from the specified pool with a timeout, and falls back to the default
pool if allocation fails. This prevents system hangs when the BR/EDR
signaling buffer pool is exhausted.

Update all bt_l2cap_create_pdu() call sites to use the new helper with
appropriate timeouts (K_FOREVER for requests, specific timeouts for
responses). Add error handling to properly disconnect channels or clean
up resources when buffer allocation fails.

Introduce l2cap_br_chan_disconn() helper to centralize channel
disconnection logic, ensuring proper cleanup when disconnect requests
cannot be sent.

Change br_sig_pool user data size from hardcoded 8 bytes to
CONFIG_BT_CONN_TX_USER_DATA_SIZE for consistency with other buffer
pools.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-17 10:36:40 +02:00
Roman Leonov
a0dee7ddad usb: host: shell: add usbh device list_dd command
Added:
- usbh shell command to dump descriptors

Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-04-17 10:34:50 +02:00
Emil Gydesen
8e3c6279ce Bluetooth: ISO: Log all values from established events
When an ISO channel is established, we now log all the
information we receive from the controller for that
specific channel.

This can be useful in debugging and determining certain
behaviors.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 10:34:15 +02:00
Alberto Escolar Piedras
3258d42abe Bluetooth: Controller: nRF54Lx: Use hal to set interrupt mask
The HAL has now a function to set the each GRTC group interrupt mask
Let's use it, fixing this old FIXME.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-04-16 11:41:49 -05:00
Emil Gydesen
ce33df667f Bluetooth: CAP: Fix issue with aborting CAP commander procs
Fixed issue where an aborted CAP commander procedure would
never get past bt_cap_common_proc_all_handled and thus never
call the callback with an error, e.g. if the remote CAP
Acceptor rejects a request.

The fix required a significant refactor of the broadcast
part of the CAP commander, as it was fundamentally flawed.
The biggest change is that the implementation now uses both
the receive state notification as well as the write responses
to determine completeneess. Additionally, it also handles
notifications not initiated from our write requests, i.e.
it is now more similar to an event based procedure rather
than a linear one. This also means that when the callbacks
for the start and stop procedures are now called, we have
receive the events (notifications) from the remote CAP
acceptors that they are actually synced (or not synced) to
the broadcasts.

Since the broadcast reception start and stop now waits
for the receive state to be updated, a change in the
Handover implementation was also done.

To test the solution 2 new test cases were added,
and the existing tests were modified to allow for the
new expected behavior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-16 11:37:24 -05:00
Arthur Gay
f1dfc3744b net: http_client: Handle body of 5xx reponses
In the http client, the body of 5xx was skipped, leading to a parse error
in the http parser when it reaches the body.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2026-04-16 14:47:07 +02:00
Seppo Takalo
eecb164fad modem: cmux: Prevent sending to DLC pipes before CMUX is open
If CMUX is not yet connected, or is doing a disconnection,
we should not accept any traffic into pipes.

Block the traffic by replacing the !cmux->attached test with
a runtime test is_connected() that compare states as well.

Rename previous is_connected() to is_active() as it was used
on runtime power management checks.

One exception to rule is pipe->open(), which should be allowed
to be called same time as CMUX connection is initiated.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2026-04-16 14:44:17 +02:00
Seppo Takalo
662f83809a modem: cmux: Close pipes on CMUX close
When the CMUX control channel is closed, CMUX is shut down and
all pipes should be in closed state too.
Notify all modules of this by calling modem_cmux_dlci_pipes_release()
when disconnecting.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2026-04-16 14:44:17 +02:00
Krzysztof Chruściński
59da64a664 debug: coresight: cs_trace_defmt: Fix uninitialized variable warning
In certain configurations there could be a warning due to potential
use of uninitialized variable. Add initialization.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-15 17:17:01 -04:00
Tim Pambor
aaed8332a6 net: ipv6: nbr: fix use-after-free
Avoid accessing the packet after sending it, as the driver may
have already unreferenced or freed it. Use iface argument instead
of calling net_pkt_iface() on a potentially freed packet when
updating packet statistics.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-04-15 17:16:36 -04:00
Tim Pambor
3159c53e8e net: ipv6: mld: fix use-after-free
Avoid accessing the packet after sending it, as the driver may
have already unreferenced or freed it. Store the iface before
sending instead of calling net_pkt_iface() on a potentially
freed packet when updating packet statistics.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-04-15 17:16:36 -04:00
Tim Pambor
0223e5e3ec net: ip: igmp: fix use-after-free
Avoid accessing the packet after sending it, as the driver may
have already unreferenced or freed it. Store the iface before
sending instead of calling net_pkt_iface() on a potentially
freed packet when updating packet statistics.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-04-15 17:16:36 -04:00
Tim Pambor
09c8578c66 net: ip: icmpv6: fix use-after-free
Avoid accessing the packet after sending it, as the driver may
have already unreferenced or freed it. Store the iface before
sending instead of calling net_pkt_iface() on a potentially
freed packet when updating packet statistics.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-04-15 17:16:36 -04:00
Tim Pambor
86e21665d4 net: ip: icmpv4: fix use-after-free
Avoid accessing the packet after sending it, as the driver may
have already unreferenced or freed it. Store the iface before
sending instead of calling net_pkt_iface() on a potentially
freed packet when updating packet statistics.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-04-15 17:16:36 -04:00
Jamie McCrae
f99dbd622e mgmt: mcumgr: grp: fs_mgmt: Fix not checking if write completed
Fixes an issue whereby a write might have partially been successful
but failed due to insufficient space in the storage device by
re-attempting the write again with the offset, and if it still
fails, return an error

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-04-15 17:16:25 -04:00
Emil Gydesen
cce6230e29 Bluetooth: BAP: Fix deligator typo
It is called the BAP Scan Delegator, and not deligator.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-15 17:16:13 -04:00
Alex Ciascai
03ccc9b24d bluetooth: BASS: Reject Remove Source when PA is syncing or synced
If a Remove Source request is received while the IUT is in PA sync
states INFO_REQ or SYNCED, the request is rejected and the source
is not removed.

Signed-off-by: Alex Ciascai <alexandru.ciascai@nordicsemi.no>
2026-04-15 17:16:03 -04:00
Peter van der Perk
a833ec7074 rtio: add selectable placement for SQE and block pool
Add Kconfig options to control where RTIO SQEs and the RTIO block pool
are allocated: default RAM, DTCM, or a Zephyr nocache region.

This improves robustness and performance for DMA-heavy RTIO users:
- Avoids D-cache coherency pitfalls (especially with tiny DMA buffers).
- Enables using DTCM for lower-latency RTIO queue and pool access.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-04-15 17:15:55 -04:00
Hanliang Xu
7aab6c07f3 Bluetooth: TBS: fix URI scheme list matching
Comparisons only triggered on comma, leaving the last entry unchecked,
and start_idx was never advanced after each delimiter, making all
subsequent length calculations wrong.

Fix by updating start_idx and uri_scheme_cand on each comma, then
adding a post-loop check for the final entry.

Fixes #105073

Signed-off-by: Hanliang Xu <leonxu2004@outlook.com>
2026-04-15 17:15:16 -04:00
Alberto Escolar Piedras
4f2e63556a net: coap: mark function as possibly unused
encode_be32() is only used in some configurations.
Let's mark it as possibly unused so the compiler does not warn us about
it

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-04-15 15:39:01 +02:00
Benjamin Cabé
700c42c4aa net: coap: remove unused insert_be32 function
Commit b9d3344fd4 introduced this static
helper function that is effectively unused and makes clang unhappy.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-15 13:50:00 +02:00
Syed Syed
edcfe755ae logging: fix unaligned access in z_log_msg_enqueue
On architectures with strict alignment (RISC-V, ARM Cortex-M0),
multi-domain logging can trigger a Load/Store Address Misaligned
exception. This occurs when z_log_msg_enqueue receives a data
pointer from an IPC transport that is not word-aligned.

This commit reorders the operations to perform the memcpy into
the aligned internal buffer before accessing any struct members.

Signed-off-by: Syed Syed <syeds@amd.com>
2026-04-15 05:56:11 -04:00
Lyle Zhu
e94f98edd9 bluetooth: host: rfcomm: adjust MTU for credit-based flow control
When credit-based flow control (CFC) is supported, reduce the MTU by
one byte to account for the credits field in RFCOMM frames. This
prevents the SDU length from exceeding the maximum frame size when
the credits field is included in the frame.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-15 05:49:22 -04:00
Lyle Zhu
e52fcdc7ea bluetooth: host: rfcomm: use generic CRC8 implementation
Replace custom RFCOMM CRC table and calculation with the generic CRC8
implementation from zephyr/sys/crc.h. This reduces code duplication and
improves maintainability. Also, it will reduce the flash footprint by
about 300 bytes.

The RFCOMM FCS calculation uses CRC-8 with polynomial 0x07, reflected
input/output, and initial value 0xff, which matches the definition of
the specification GSM 07.10.

Also simplify rfcomm_check_fcs() to reuse rfcomm_calc_fcs() and compare
the calculated FCS with the received value directly. It is consistent
with the following  logic:
o Calculate the CRC,
o CRC = crctable[CRC^"received FCS"],
o if the CRC equals to 0xcf.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-15 05:49:14 -04:00
Yuheng Li
02a3299bea Bluetooth: Classic: HFP: HF: fix 3-way call direction flag update
Use atomic_set_bit() instead of atomic_test_bit() in
set_call_incoming_flag().

atomic_test_bit() is read-only, so the previous code did not update
INCOMING_3WAY/OUTGOING_3WAY flags when call_count > 1.

Signed-off-by: Yuheng Li <liyuheng@xiaomi.com>
2026-04-15 05:49:05 -04:00
Rithic Chellaram Hariharan
1fcdeffa95 net: sockets: tls: make session cache prefix configurable
Turn the hardcoded TLS_SETTINGS_PREFIX into a Kconfig symbol
CONFIG_NET_SOCKETS_TLS_SESSION_CACHE_PERSISTENT_PREFIX so users
can choose a different settings key prefix if needed.

Signed-off-by: Rithic Chellaram Hariharan <gr8rithic@gmail.com>
2026-04-15 05:48:42 -04:00
Rithic Chellaram Hariharan
93eb99a2e4 net: sockets: tls: add persistent session cache via settings
Add persistent TLS/DTLS session cache support using the settings
subsystem. Sessions are saved after each successful handshake and
restored during tls_init(), enabling session resumption across
device reboots without a full handshake.

Backend-agnostic: works with any settings backend (NVS, ZMS, FCB,
filesystem).

Signed-off-by: Rithic Chellaram Hariharan <gr8rithic@gmail.com>
2026-04-15 05:48:42 -04:00
Marcin Niestroj
561120f300 modem: uart_isr: support mdm-dtr-gpios
Support controlling mdm-dtr-gpios in uart_isr, same as it is already
supported in uart_async and uart_async_hwfc.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2026-04-15 05:38:31 -04:00
Sanjay Vallimanalan
208a2d3fa8 net: ocpp: Add TLSv1.3 support
Added support for TLSv1.3 to the OCPP subsystem by enabling
TLS secure sockets. This allows secure WebSocket
connections over TLSv1.3 during OCPP communication.

Signed-off-by: Sanjay Vallimanalan <sanjay@linumiz.com>
2026-04-15 05:37:57 -04:00
Kapil Bhatt
df9a974782 modules: hostap: Display WEP Open/Shared in status
Instead of WEP show WEP-OPEN and WEP-SHARED in status.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-04-14 22:37:55 -04:00
Lyle Zhu
47b1e29717 bluetooth: rfcomm: convert DLC list from linked list to sys_slist
Convert the RFCOMM DLC (Data Link Connection) management from a manual
linked list implementation using _next pointers to use Zephyr's
sys_slist API. This change improves code maintainability and safety by
using the standard list handling primitives.

Key changes:
- Replace bt_rfcomm_dlc._next with sys_snode_t _node for list handling
- Convert bt_rfcomm_session.dlcs from pointer to sys_slist_t
- Update rfcomm_dlcs_lookup_dlci() to use
  SYS_SLIST_FOR_EACH_CONTAINER_SAFE
- Update rfcomm_dlcs_remove_dlci() to use
  sys_slist_find_and_remove()
- Replace manual list traversal with sys_slist iterators throughout
- Initialize session DLC list with sys_slist_init() in
  rfcomm_session_new()
- Use sys_slist_is_empty() instead of NULL pointer checks
- Use sys_slist_prepend() for adding DLCs to session

The conversion eliminates manual pointer manipulation and reduces the
risk of list corruption while maintaining the same functional behavior.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-14 22:37:49 -04:00
Pieter De Gendt
85a0e87743 net: lib: coap: client: Improve timeout check for multicast requests
Multicast requests should only check mcast_timeout in timeout_expired.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-14 22:37:40 -04:00