- **Fix session mutex handling:** Ensure the `mtls_sessions_lock` is
always released in `mtls_get_unused_session_index` on failure
to prevent deadlocks.
- **Protect `in_use` flag:** Added mutex protection when setting
`in_use = false` in free functions.
- **Cleanup on setup failure:** Added calls to `mbedtls_*_free()`
in `mtls_session_setup()` when key initialization fails.
- **Free logic fix:** Corrected `if/else` structure in
`mtls_session_free()` to ensure the correct context is freed.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Remove erroneous calculation of `apkt->pkt->out_len` in
`mtls_ccm_decrypt_auth` and `mtls_gcm_decrypt_auth`.
The output length should be handled by the caller or the
AEAD decryption process itself.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Corrected the RFC2131 section reference in DHCPv4 comments and help text.
The random delay before sending the initial DHCPDISCOVER message is
defined in Section 4.4.1 of RFC2131, not in 4.1.1 as previously stated.
Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
In rare occasions iface and TCP mutexes could cause a deadlock. As
notifying the interface readiness takes place just before the iface
mutex is released, it should be not harm to release it just before the
TCP is notified about interface going down to avoid the deadlock.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The current approach was buggy, for example the TCP context could be
unrefed twice in case of forced close. Or in case of a race, when the
application closed the socket first, the TCP context wouldn't be
dereferenced at all.
Calling the tcp_conn_close() unconditionally in case of forced close
solves all those issues.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A listening TCP context has no active connection therefore it has no a
second ref from the TCP stack. Thereby, when shutting down connections
when interface goes down, net_tcp_put() should not be called on a
listening socket to release the ref on the TCP stack behalf.
Instead, report the error via the registered accept_cb callback no
notify the application about the error, which should then close the
socket and release the associated TCP context.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove the note about time_t being 64-bit in Zephyr, since that is
generally not accurate and depends on the configuration of the C library.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Documentation has been added for the instrumentation subsystem, link to
it in the Zephyr 4.3 release highlights instead of code sample.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add documentation for the instrumentation subsystem as this was missing
from the initial contribution.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The added stm32-adc properties in c21cdd8569 ("dts: bindings: adc:
stm32: add new properties to simplify the driver") were missing from adc2
within the stm32n6.dtsi.
Since adc1 and adc2 are almost identical, just copy the missing properties
from adc1 which was fixed up as part of 5f0c63ea35 ("dts: arm: st: fill
out adc nodes with the new properties").
This fixes compilation when using adc2:
```
devicetree error: 'st,adc-internal-regulator' is marked as required in
'properties:' in [...]/zephyr/dts/bindings/adc/st,stm32n6-adc.yaml, but
does not appear in <Node /soc/adc@50022100 in
[...]/zephyr/dts/arm/st/n6/stm32n6.dtsi:456>
```
Signed-off-by: Emil Dahl Juhl <emil@s16s.ai>
Update manifest to align the copy of Mbed TLS header files which lives
in the TF-M repository to what's in Mbed TLS release v3.6.5.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Add a few useful commands and information when running the
BT Tester with native_sim, either with or without the
Zephyr controller.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Consecutive resource instance name should be encoded regardless of
whether timestamp is present or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
To ensure that code compiles error (and warning) free, add a build-all
testsuite for smbus drivers.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The smbus driver initialization priority was previously set to
`KERNEL_INIT_PRIORITY_DEFAULT` (which is 40). However, the default init
priority of devices is typically `KERNEL_INIT_PRIORITY_DEVICE` (which is
50).
Since the stm32 smbus driver uses a reference to the underlying i2c
device, and since this driver was not being built in CI, this led to the
discovery that the smbus driver was initialized too early.
```shell
ERROR: Device initialization priority validation failed, the sequence of \
initialization calls does not match the devicetree dependencies.
ERROR: /smbus1 <smbus_stm32_init> is initialized before its dependency \
/soc/i2c@40005400 <i2c_stm32_init> (POST_KERNEL+1 < POST_KERNEL+4)
```
By setting the initialization priority to `KERNEL_INIT_PRIORITY_DEVICE`,
both smbus1 and i2c1 have their priorities evaluated in the same group,
and it becomes possible to determine relative priorities via phandle
dependency.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add ARCH_HAS_STACKWALK as a dependency to the stack unwind test to avoid
running it on 64bit Cortex-R platforms, which do not implement the
arch_stack_walk() api.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
The commit 125d0daaa1 added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but guiconfig.py is left untouched. This make menuconfig to
die with:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.13/tkinter/__init__.py", line 2077, in __call__
return self.func(*args)
~~~~~~~~~^^^^^^^
File ".../scripts/kconfig/guiconfig.py", line 917, in _tree_double_click
return _tree_enter(event)
File ".../scripts/kconfig/guiconfig.py", line 942, in _tree_enter
_change_node(node, tree.winfo_toplevel())
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../scripts/kconfig/guiconfig.py", line 1125, in _change_node
s = _set_val_dialog(node, parent)
File ".../scripts/kconfig/guiconfig.py", line 1219, in _set_val_dialog
range_info = _range_info(sym)
File ".../scripts/kconfig/guiconfig.py", line 1339, in _range_info
for low, high, cond in sym.ranges:
^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
This commit ignores the last element in the tuples.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
The commit 125d0daaa1 added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but menuconfig.py is left untouched. This make menuconfig to
die with:
Traceback (most recent call last):
File ".../scripts/kconfig/menuconfig.py", line 3284, in <module>
_main()
~~~~~^^
File ".../scripts/kconfig/menuconfig.py", line 663, in _main
menuconfig(standard_kconfig(__doc__))
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../scripts/kconfig/menuconfig.py", line 732, in menuconfig
print(curses.wrapper(_menuconfig))
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/lib/python3.13/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File ".../scripts/kconfig/menuconfig.py", line 872, in _menuconfig
_change_node(sel_node)
~~~~~~~~~~~~^^^^^^^^^^
File ".../scripts/kconfig/menuconfig.py", line 1586, in _change_node
s, _range_info(sc))
~~~~~~~~~~~^^^^
File ".../scripts/kconfig/menuconfig.py", line 3119, in _range_info
for low, high, cond in sym.ranges:
^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
This commit ignores the last element in the tuples.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
- Add Iulia Prodan as she is already a maintainer of the OpenAMP module.
- Add myself as I am maintainer of the openAMP project.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Many APIs are stuck at experimental status although they already fullfil
the requirements to be considered unstable, i.e. they have multiple
implementations and have been in the tree for more than 2 releases.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The previous method of deriving the local MAC address from the MCU's
Unique ID (UID) by slicing the last 3 bytes had two issues:
1. **Low Entropy:** Risk of address collision because only a small
portion of the UID was used, and this portion may not vary much.
2. **Offset Error:** An incorrect offset calculation could copy
non-intended bytes.
This commit resolves both issues by replacing the slice operation
with a **CRC-32 hash** over the **entire 16-byte UID**.
The lower 3 bytes (24 bits) of the resulting CRC-32 are used as the
local part of the MAC address, maximizing randomization and ensuring
a high probability of uniqueness across all devices.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Defers init of GT911 touch, MIPI DBI, and display device drivers.
lcd_par_s035_init() in shield.c now initializes these to control the
GT911 INT_GPIO state during the Reset sequence.
Signed-off-by: Derek Snell <derek.snell@nxp.com>
hal/renesas was updated with fix for the case when
watchdog was unnecessary disabled after deep sleep.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg.xr@bp.renesas.com>
Update the test_json_decoding test to expect correct unescaped values
based on descriptor type semantics:
- JSON_TOK_STRING: Stores pointer to original JSON string, preserving
escape sequences as they appear in the source. Used when the original
escaped format needs to be maintained.
- JSON_TOK_STRING_BUF: Copies and unescapes the string into a fixed-size
buffer, converting JSON escape sequences (\n, \t, \", etc.) to their
actual character equivalents. Used when the processed, unescaped string
is needed.
The test was incorrectly expecting the nested_string_buf field (which
uses JSON_TOK_STRING_BUF) to contain the escaped form "esc: \\t". With
the proper unescaping implementation, this field should contain the
unescaped version "esc: \t" (with actual tab character).
This aligns with the documented behavior where JSON_TOK_STRING_BUF
performs unescaping during the copy operation, while JSON_TOK_STRING
simply references the original escaped string.
Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
Add extensive test coverage for JSON escape sequence handling to
ensure robustness and prevent regression in string encoding/decoding
operations.
The new test suite includes:
1. **Escape Sequence Stability**: Tests multiple encode/decode cycles
to prevent backslash duplication bugs where sequences like \n, \t
could be duplicated with each cycle.
2. **Individual Escape Sequences**: Comprehensive testing of each JSON
escape type:
- \n (newline), \t (tab), \r (carriage return), \f (form feed)
- \b (backspace), \\ (backslash), \" (quote), \/ (slash)
3. **Quote Handling**: Special focus on quote escaping/unescaping to
ensure proper JSON syntax and data integrity.
4. **Mixed Escape Sequences**: Complex scenarios with multiple
different escape sequences in single strings to test edge cases.
5. **Multiple Cycle Stability**: Repeated encode/decode operations to
simulate real-world usage patterns and detect gradual corruption.
6. **Backslash Duplication Detection**: Specific tests targeting the
common bug where backslashes accumulate during multiple processing
cycles.
7. **Round-trip Validation**: Complete encode → decode → encode cycles
to verify data preservation.
8. **Edge Cases**: Testing boundary conditions like strings containing
only quotes or complex escape combinations.
These tests use a new `escape_test_data` structure with both string
value and string buffer fields to verify proper handling of both
JSON_TOK_STRING and JSON_TOK_STRING_BUF descriptor types.
The test suite ensures that:
- Escape sequences are properly encoded in JSON output
- Escape sequences are correctly unescaped during parsing
- No data corruption occurs during multiple processing cycles
- Both string pointer and string buffer fields behave correctly
- Complex escape scenarios are handled robustly
Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>