Commit graph

62320 commits

Author SHA1 Message Date
kay-lambdadelta
586978b416 tools/rust: Fix softfloat abi target spec name
Rename abi "x86-softfloat" to just "softfloat" to enable compatibility
with newer rust nightly versions.

Rust recently changed the name of the softfloat abi to one more unified
across targets, and more recently, removed the compat alias.

Signed-off-by: Kay Lambdadelta <lambdadeltakay@proton.me>
2026-08-13 20:20:06 +08:00
22078360
f594708b9f mips/Makefile: Add nuttx build with CONFIG_ALLSYMS enabled.
Change the arch/mips/src/Makefile to build nuttx with CONFIG_ALLSYMS
enabled in MIPS architecture. This enables symbol name showing in
system, such as 'dumpstack 3' shows both functions name and addresses.

This change is referred to arch/tricore/src/Makefile and updated to
work well with MIPS. And it works with and without CONFIG_ALLSYMS enabled.

Fixes apache#19728

Signed-off-by: wangtao <twangpicasso@gmail.com>
2026-08-13 20:11:45 +08:00
zhangyu117
807f33e296 arch/tricore: perf.c donot depend on illd
Replace the iLLD helpers IfxCpu_resetAndStartCounters() and
IfxCpu_getClockCounter() in the performance-counter path with direct
CSR accesses via tricore_mtcr()/tricore_mfcr().

tricore_reset_ccnt() disables the CPU cycle counter (CPU_CCTRL), clears
CPU_CCNT, then re-enables it; up_perf_gettime() reads CPU_CCNT directly.
This removes the arch/tricore perf path's dependency on the Infineon
iLLD layer. No behavior change.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-13 20:10:55 +08:00
zhangyu117
481473ee9a arch/tricore: cachecode donot depend on illd
Replace the iLLD register structures (Ifx_CPU_PCON0/1/2, Ifx_CPU_DCON0/1/2)
and the IfxCpu_cfg.h cache-size/line-size macros in the cache path with
direct CSR accesses via tricore_mtcr()/tricore_mfcr() and locally defined
PCON/DCON bit masks.  Also switch __isync()/__dsync() to the UP_ISB()/
UP_DSB() barrier wrappers.

This removes the arch/tricore cache path's dependency on the Infineon
iLLD layer.  No behavior change.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-13 20:10:55 +08:00
zhangyu117
46618bb25b arch/tricore: add tricore_mtcr and tricore_mfcr macros
Add tricore_mtcr()/tricore_mfcr() inline-assembly wrappers for the
MTCR/MFCR (move to/from Core Special Function Register) instructions.
These let arch/tricore code access CSRs directly without relying on the
Infineon iLLD intrinsics, and are used by the following iLLD-removal
change in the performance-counter path.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-13 20:10:55 +08:00
alexcekay
2688f948c7 fs/cromfs: Fix stale cache read in read() fast path.
cromfs_read()'s fast path decompresses a block directly into the
caller's buffer whenever a read reaches a block at its start and the
caller has room for the whole decompressed block, bypassing the
per-file decompression cache (ff_buffer). It nonetheless marked that
block as cached by setting ff_offset, without ever writing ff_buffer
itself.

A later read of the same block that fell onto the slow path trusted
that false cache tag, skipped decompression, and copied from
ff_buffer without it ever having been populated for that block. A
repeated identical fast-path read of the same block hit the same
false tag and skipped decompression entirely, leaving the caller's
buffer untouched and returning whatever was already there.

Fixed by having the fast path only read the cache, never populate it:
reuse ff_buffer when a prior slow-path read already cached the same
block, otherwise decompress straight into the caller's buffer without
touching ff_offset/ff_buffer.

Co-authored-by: Pavlo
Assisted-by: Claude Code:claude-sonnet-5
Signed-off-by: alexcekay <alexander@auterion.com>
2026-08-13 20:08:58 +08:00
raiden00pl
427ad36315 fs/romfs: fix node cache overflow in directories with >256 entries
romfs_cachenode() tracked the allocated size of rn_child in a uint8_t
while rn_count is a uint16_t. Past 256 entries the size wraps to zero,
the grow condition rn_count == num - 1 can never be true again and the
array is not reallocated: entries are written beyond the allocation,
corrupting the heap.

Track the allocated size in a size_t.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-13 02:43:04 +08:00
Alin Jerpelea
46e0f6f698 Documentation: add NuttX 13.0.1 release notes
add release notes for NuttX 13.0.1 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-08-12 21:53:05 +08:00
Darryl Ring
6b5125a34a arch/arm/stm32h5: Fix handling of GPIO port I
Correct the number of GPIO ports (STM32_NPORTS) from 8 to 9 and include
GPIOI in the g_gpiobase array. Also fix the comparison that would
prevent the GPIOI clock from being enabled (this is really a no-op,
though).

Signed-off-by: Darryl Ring <darryl@bluerobotics.com>
2026-08-12 21:52:13 +08:00
raiden00pl
7815a905af arch/x86_64: align the user signal frame and skip the ABI red zone
The signal frame was built inside the 128 byte red zone of the
interrupted user code and inherited its stack alignment, so a leaf
function could lose live data to the siginfo copy and the handler
could fault on an SSE access. Build the frame below the red zone,
16 byte aligned; the naked trampoline calls the handler itself and
its call provides the return address slot.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-12 19:48:27 +08:00
raiden00pl
7c43502613 arch/x86_64: run the signal trampoline on the thread kernel stack
For a thread interrupted in user mode the trampoline ran on the user
stack, where the signal handler then grows over its frame. Run it on
the thread kernel stack, unused while the thread is in user mode. The
stack cannot be selected from the saved CS: up_initial_state() records
the caller CS, a kernel selector even for user threads.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-12 19:48:27 +08:00
raiden00pl
8aa02a2362 arch/x86_64: restore the kernel stack when a signal handler returns
SYS_signal_handler_return restored RSP from saved_rsp, which is not
written when a task signals itself: synchronous dispatch skips
up_schedule_sigaction(), so the kernel stack pointer was set to zero
and the next push faulted. Save the kernel stack pointer at dispatch
in xcp.kstkptr, as risc-v does, and restore that.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-12 19:48:27 +08:00
raiden00pl
8f45ffb1c7 syscall: add missing memory locking and clock_getres entries
add missing syscall entries for mlock, mlockall, munlock, munlockall,
mprotect and clock_getres

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-10 22:48:05 +08:00
Filipe Cavalcanti
297e7625ab arch/risc-v: fix uninitialized HW cmds and bus clock
Initialize i2c_ll_hw_cmd_t in sendstart/startrecv so ack_exp/done are
not left with stack garbage that can NACK or skip the address byte.
Program i2c_hal_set_bus_timing() with the requested bus_freq instead of
the board default so msg frequency is applied.

Affects only Espressif devices.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-08-10 22:47:24 +08:00
William Byatt
a6b45dd471 video/rgbcolors: Fix RGBTO8 to use the high bits of each component.
RGBTO8 shifted each component up before masking:

    (((uint8_t)(r) << 5) & 0xe0)

The cast is promoted to int before the shift, so the mask keeps bits 5:7
of the shifted value, which are bits 0:2 of r.  The macro therefore
encoded the three least significant bits of red and green and the two
least significant bits of blue, rather than the most significant.

This disagrees with RGBTO16 in the same file, which correctly takes the
high bits, and with RGB8RED/RGB8GREEN/RGB8BLUE immediately below it,
which are documented as the inverse transformation but read the result
as high bits.

All in-tree callers pass full 8-bit components, so all were affected:
RGBTO8(39, 64, 139) in apps/examples/nxterm, intended as midnight blue,
evaluates to 0xe3 -- full red plus full blue, i.e. magenta.

Take the high bits instead, so that RGBTO8 matches RGBTO16 and the
RGB8xxx macros become its true inverse.

Tested on a RISC-V LiteX/VexRiscv target with an 8bpp RGB332 frame
buffer, and with a host round-trip check over all 256 representable
colours.

Assisted-by: Claude:claude-opus-5
Signed-off-by: William Byatt <william@byatt.io>
2026-08-10 22:43:20 +08:00
Felipe Moura
e2f85ffea7 drivers/usbdev/cdcacm: fix self-deadlock in cdcuart_txempty()
cdcuart_txempty() held priv->lock across EP_POLL(), which re-enters the
class through cdcacm_wrcomplete() and takes that same non-recursive lock,
and then took it a second time to read nwrq. Release it after the
disconnected check, matching cdcuart_txready()/cdcuart_rxavailable().

Fixes: cc067ab199 ("drivers/usbdev/cdcacm.c: Use small lock to protect cdcacm")
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-10 22:42:44 +08:00
Justin Hammond
51f42c824e drivers/usbhost: Refuse to register the same class driver twice.
The registry is a singly linked list of static structures, so registering
one of them a second time does not add a second entry: it points that
entry's own link at itself, and the list stops having an end.

Nothing notices while every device that turns up matches something near
the head, because the search returns before it reaches the loop.  The
first device that matches nothing at all, meaning anything without a
class driver built in, walks the list to look for it and never comes back,
holding the registry lock.  On a multiprocessor the rest of the system
follows it down: every other processor that touches the registry spins,
and on the one measured here that included the console, so a board with a
USB keyboard and no keyboard driver came up and then answered nothing.

Registering twice is easy to do by accident.  drivers_initialize() calls
usbhost_drivers_initialize(), which registers every class the
configuration selected, and board code that also registers one, which
many boards do, gets a second call for free.

So look before linking, and treat a repeat registration as the no-op the
caller expected it to be.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-10 22:41:54 +08:00
raiden00pl
a78a1cd000 arch/nrf53/nrf53_i2c.c: fix I2C3 base
fix I2C3 base

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-10 09:21:46 -03:00
Joao Mario Lago
87458547f5 arch/arm/stm32h5/serial: fix UART8 buffer guard typo
Use CONFIG_STM32_UART8_SERIALDRIVER so g_uart8rxbuffer and
g_uart8txbuffer are compiled when UART8 is enabled.

Signed-off-by: Joao Mario Lago <joao.mario.lago@hotmail.com>
2026-08-07 15:15:14 -04:00
Felipe Moura
8d0d0c61e2 fs/vfs: provide link fallback without softlinks
Build fs_link.c unconditionally so link() remains available even when
CONFIG_PSEUDOFS_SOFTLINKS is disabled. Return ENOSYS in that
configuration instead of leaving applications with an undefined symbol.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-07 12:49:07 -03:00
Martin Vajnar
7f0e365e2f stm32f746g-disco: Add support for Winbond W25Q128JVEQ flash chip
New series of the STM32F746G-DISCO use Winbond W25Q128JVEQ. This commit
adds support for it.

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
2026-08-07 12:49:07 -03:00
Alin Jerpelea
888f35fef9 Revert "boards/lm3s6965-ek: Disable CONFIG_READLINE_EDIT to fix build"
This reverts commit 1240ee3ef7. which is
out of sync with releases/13.0 nuttx-apps

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-08-07 12:49:07 -03:00
raiden00pl
60ddd837c7 !arch/arm/src/stm32: unify the timer input clock board options
Replace the divergent board conventions for the timer input clock
frequency with a single uniform convention provided by every board:

- STM32_APBx_TIMn_CLKIN and BOARD_TIMn_FREQUENCY -> STM32_TIMn_CLKIN
- STM32_APBx_LPTIMn_CLKIN, BOARD_LPTIMn_FREQUENCY and
  STM32_LPTIMn_FREQUENCY -> STM32_LPTIMn_CLKIN
- STM32_APB1_THRTIM1_CLKIN and BOARD_HRTIM1_FREQUENCY ->
  STM32_HRTIM1_CLKIN

All STM32 consumers (tim/lptim/pwm/adc/dac/capture/sdadc/dfsdm/
pulsecount) updated to match; the timer input clock is now bus-agnostic
in the drivers.

Boards that carried the same timer clock in more than one convention now
define STM32_TIMn_CLKIN exactly once, derived from the APB bus clock
(PCLKx with the x2 doubler when the APB prescaler is greater than 1),
instead of redefining it with a second, sometimes different, value.

BREAKING CHANGE: The timer input-clock board macros STM32_APBx_TIMn_CLKIN,
BOARD_TIMn_FREQUENCY, STM32_APBx_LPTIMn_CLKIN, BOARD_LPTIMn_FREQUENCY,
STM32_LPTIMn_FREQUENCY, STM32_APB1_THRTIM1_CLKIN and
BOARD_HRTIM1_FREQUENCY are removed in favor of STM32_TIMn_CLKIN,
STM32_LPTIMn_CLKIN and STM32_HRTIM1_CLKIN.  Out-of-tree boards must
define the new macros (drop the APB bus from the name, keep the value),
and out-of-tree drivers referencing the old names must be updated.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-07 12:49:07 -03:00
anjiahao
bc484cb4d8 boards/stm32f3: nucleo-f302r8:ihm07m1_b16: enable LTO to fit flash
The ihm07m1_b16 (FOC motor control) configuration overflows the
STM32F302R8 64 KiB flash region by ~470 bytes, so it no longer links.
Enable GNU Full LTO (CONFIG_LTO_FULL=y); cross-module dead-code
elimination brings the image back under the limit (flash drops from
~66.0 KiB to ~57.7 KiB, 88%).

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-08-07 12:49:07 -03:00
Alin Jerpelea
3f8718571e boards/arm/stm32f3/nucleo-f302r8: fix qenco configuration
build will fail with the following error
arm-none-eabi-ld: /awork/android/NuttX/nuttx/nuttx section flash'
arm-none-eabi-ld: region .text' will not fit in region flash' overflowed by 1144 bytes

before
Register: qe
Register: nsh
Register: sh
LD: nuttx
arm-none-eabi-ld: /awork/android/NuttX/nuttx/nuttx section .text will not fit in region flash
arm-none-eabi-ld: region flash overflowed by 1144 bytes
Memory region         Used Size  Region Size  %age Used
           flash:       66680 B        64 KB    101.75%
            sram:        5136 B        16 KB     31.35%
make[1]: *** [Makefile:230: nuttx] Error 1
make: *** [tools/Unix.mk:569: nuttx] Error 2

after
Register: qe
Register: nsh
Register: sh
LD: nuttx
Memory region         Used Size  Region Size  %age Used
           flash:       38008 B        64 KB     58.00%
            sram:        4132 B        16 KB     25.22%
CP: nuttx.hex
CP: nuttx.bin

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-08-07 09:47:32 +08:00
raiden00pl
e4875dc45d arch/arm/stm32: SDMMC1/2 depends on SCHED_HPWORK
STM32 SDMMC driver depends on  CONFIG_SCHED_HPWORK

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-06 20:35:46 +08:00
raiden00pl
3b126851ec arch/arm/stm32: STM32 I2S depend on AUDIO and SCHED_WORKQUEUE
STM32 I2S depend on AUDIO and SCHED_WORKQUEUE

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-06 20:35:46 +08:00
raiden00pl
89815a37f1 arch/arm/stm32: STM32_SDIO depend on SCHED_HPWORK
STM32_SDIO depend on SCHED_HPWORK

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-06 20:35:46 +08:00
raiden00pl
e9f1e15314 arch/arm/src/stm32: make STM32_ETHMAC depend on NET
STM32_ETHMAC selects NETDEVICES, but NETDEVICES depends on NET. Enabling
ETHMAC without NET produced an invalid Kconfig

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-06 20:35:46 +08:00
raiden00pl
fb9ec8d6ec arch/arm/src/stm32: make STM32_FOC depend on MOTOR_FOC
Enabling STM32_FOC without MOTOR_FOC failed to build with
"unknown type name 'foc_current_t'". Add the dependency on MOTOR_FOC.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-06 20:35:46 +08:00
raiden00pl
621db41c43 arch/arm/src/stm32: STM32_DTS depends on SENSORS
The H5 DTS driver registers with the sensor framework (sensor_register),
so it requires SENSORS.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-06 20:35:46 +08:00
ywhkkx
e5636eb23c fs/pseudofile: fix buffer sizing and sparse growth.
Grow the in-memory pseudofile buffer by doubling instead of
1<<LOG2_CEIL, which can under-allocate on 32-bit targets for large
expand sizes. Also:
* reject size_t wrap before expand on write (-EFBIG)
* clear newly addressed bytes when the file grows
* route truncate growth through the same expand path

Impact: CONFIG_PSEUDOFS_FILE expand/write/truncate only; no API or
build-system change.

Testing: host arithmetic PoC blocked; WSL sim:pseudofile-poc
(SIM_M32+KASAN) write returns -ENOMEM instead of SIGSEGV in memcpy.

Signed-off-by: ywhkkx <2076064543@qq.com>
2026-08-06 19:40:39 +08:00
zhekunren
f80016f4c7 net/igmp: fix length check that always dropped valid IGMP packets
igmp_input() verified the packet length with:

  if (dev->d_len < NET_LL_HDRLEN(dev) + (iphdrlen + IGMP_HDRLEN))

but dev->d_len at this point holds the IPv4 total length (IP header plus
payload) without the link-layer header, consistent with the convention
established in ipv4_in()/ipv6_in() (which do `dev->d_len -=
NET_LL_HDRLEN(dev)`) and used by all other transport input handlers
(icmp, tcp, udp), none of which reference NET_LL_HDRLEN.

Adding NET_LL_HDRLEN(dev) to the right-hand side made the check always
true for valid IGMP packets:

  iphdrlen + IGMP_HDRLEN < NET_LL_HDRLEN + iphdrlen + IGMP_HDRLEN
                         (= 0 < NET_LL_HDRLEN)

so every well-formed IGMP message hit the "Length error" path and was
silently dropped, breaking IGMP membership query/report processing.

Drop the extra NET_LL_HDRLEN(dev) so the check matches the other
protocol handlers.

Signed-off-by: zhekunren <zhekunren@qq.com>
2026-08-06 19:39:26 +08:00
Felipe Moura
0f2b210e5b crypto: add CRYPTO_CHACHA20_DJB variant (64-bit counter/nonce)
CRYPTO_CHACHA20 implements the RFC 8439/IETF parameterization (32-bit
counter + 96-bit nonce). SSH's chacha20-poly1305@openssh.com uses the
original DJB construction instead: a 64-bit block counter in state
words 12..13 and a 64-bit nonce in words 14..15 (libtomcrypt's
chacha_ivctr64). The two layouts produce different keystreams for the
same key, so an SSH server cannot interoperate with OpenSSH clients
through the IETF variant.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-06 17:48:23 +08:00
makejian
b9c63dc7ce crypto: Add ChaCha20/ChaCha20-Poly1305 to /dev/crypto, fix RFC 8439 nonce.
Expose the ChaCha20 stream cipher and the ChaCha20-Poly1305 AEAD through
the OCF crypto framework (/dev/crypto) so applications such as an SSH
server (chacha20-poly1305) can use them directly, and fix the underlying
ChaCha nonce/counter layout so both match RFC 8439.

RFC 8439 nonce layout fix
-------------------------
chacha_ivsetup() previously used the original DJB layout: a 64-bit block
counter (input[12..13]) followed by a 64-bit nonce (input[14..15]). RFC
8439 defines a 32-bit block counter (input[12]) and a 96-bit / 12-byte
nonce (input[13..15]). With the old layout the existing ChaCha20-Poly1305
AEAD could not reproduce the RFC 8439 test vectors (the last 4 bytes of a
12-byte nonce were consumed as the high half of the counter). This
commit switches chacha_ivsetup() to the RFC 8439 layout and updates the
ChaCha20-Poly1305 one-shot helpers to pass a 12-byte nonce accordingly.

Standalone ChaCha20 on the unified enc path
-------------------------------------------
Instead of introducing a separate multi-buffer stream path (parallel
encrypt_multi/decrypt_multi callbacks), extend the existing enc_xform
encrypt/decrypt callback signature with a length argument:

  void (*encrypt)(caddr_t, FAR uint8_t *, size_t len);
  void (*decrypt)(caddr_t, FAR uint8_t *, size_t len);

With that single change every cipher, block or stream, flows through the
same swcr_encdec path. swcr_encdec already handles a short final block
via buflen = MIN(i, blocksize), so arbitrary-length data works without a
second code path. This is exactly how the existing stream ciphers
(AES-CTR/OFB/CFB) already behave: the cipher keeps its own counter in the
context and swcr_encdec feeds it whole blocks (only the last one may be
shorter). chacha20_crypt likewise relies on the underlying chacha state
block counter (input[12]) to continue the keystream across calls, so no
per-call keystream caching is needed.

  * chacha_private.h: chacha_ivsetup uses a 4-byte counter and a 12-byte
    nonce (RFC 8439).
  * chachapoly.c / chachapoly.h: split reinit into chacha20_reinit (raw,
    counter 0) and chachapoly_reinit (AEAD, counter 1); chacha20_crypt
    takes a length and encrypts it in one pass, mirroring aes_ctr_crypt;
    12-byte nonce for the one-shot AEAD helpers.
  * xform.h / xform.c: add size_t len to encrypt/decrypt; add
    enc_xform_chacha20 (blocksize 64, 12-byte IV).
  * cryptodev.c / cryptosoft.c: register CRYPTO_CHACHA20 as a txform
    cipher, route new sessions to enc_xform_chacha20, feed the AEAD AAD
    through crp_aad/crp_aadlen, and handle the short final block in
    swcr_encdec.
  * cryptodev.h: add CRYPTO_CHACHA20; bump EALG_MAX_BLOCK_LEN to 64.

This keeps all ciphers on one uniform path instead of maintaining two,
and any future stream cipher drops in with just an xform table entry.

Impact: extends an internal kernel callback signature (enc_xform
encrypt/decrypt). All in-tree implementations are updated in the same
commit and the user-facing /dev/crypto ABI is unchanged, so this is
self-contained and not a breaking change for existing configurations.

Testing:
  Build host: Ubuntu Linux x86_64, GCC (host sim toolchain)
  Target: sim:crypto (CONFIG_ARCH=sim)
  Ran the crypto test apps. ChaCha20 uses RFC 8439 2.4.2 vectors
  (including a 375-byte multi-block vector exercising cross-block counter
  continuity); ChaCha20-Poly1305 uses the RFC 8439 2.8.2 AEAD vector.
  A full regression of the other ciphers was run to confirm the extended
  encrypt/decrypt signature does not change their behaviour:

    nsh> chacha20
    chacha20: 2/2 vectors passed
    nsh> chachapoly
    OK test vector 0
    chachapoly: 1/1 vectors passed
    nsh> des3cbc          -> all vectors OK
    nsh> aescbc           -> all vectors OK
    nsh> aesctr           -> all vectors OK
    nsh> aesxts           -> 14 vectors OK (encrypt + decrypt)
    nsh> hmac             -> md5 / sha1 / sha256 all success

Signed-off-by: makejian <makejian@xiaomi.com>
2026-08-06 17:48:23 +08:00
Peter Barada
83cfeb7c4e crypto: Support SHA2_224_HMAC
Since already have support for SHA2-224, extend cryptodev/cryptosoft
to support HMAC version of SHA2-224.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-08-06 17:48:23 +08:00
Xiang Xiao
db9531fe96 drivers/serial: add job-control TTY ioctls and libc wrappers
NuttX has no real session/process-group abstraction, so the TTY layer
collapses the foreground process group onto the single dev->pid field
(pgrp == pid, one member per group).  Extend the controlling-terminal
support so portable software (e.g. dropbear, socat) that relies on
job-control primitives works without losing the existing NuttX-specific
behaviour.

Driver (serial.c, pty.c):
- TIOCSCTTY now accepts a flag: arg > 0 keeps the historical "target
  PID in arg" semantics (NSH registers the foreground command it just
  spawned), while arg == 0 selects the calling task via
  nxsched_getpid(), matching the POSIX flag convention used by
  dropbear/socat/apue.  This preserves all existing callers and makes
  the previously-dead arg==0 path deliver SIGINT correctly.
- Add TIOCGPGRP/TIOCGSID (return dev->pid) and TIOCSPGRP (set it).
- pty.c gains the same handlers against pd_pid and includes
  nuttx/sched.h for nxsched_getpid().

ioctl numbers (tioctl.h): TIOCGPGRP/TIOCSPGRP/TIOCGSID at 0x37-0x39.

libc wrappers:
- termios: tcgetpgrp(), tcsetpgrp(), tcgetsid() over the new ioctls.
- unistd: setsid()/getsid()/setpgid() stubs consistent with the
  existing getpgrp()/getpgid() single-session model (sid == pgid ==
  pid; setpgid only succeeds for pgid == pid).

Declare the new prototypes in unistd.h (tcgetsid was already in
termios.h) and register all sources in the Make.defs/CMakeLists.

Group-broadcast signalling (kill(-pgrp)) remains unsupported, so
tty signals still target the single dev->pid; a real session/process
group model is left as a follow-up.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-08-06 17:48:04 +08:00
Jiri Vlasak
25eae573e5 kinetis/rtc: Enable global lock for all
g_rtc_lock is used by the up_rtc_settime, a base RTC function.
Therefore, it should be available even for this procedure, not just when
CONFIG_RTC_HIRES.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-08-06 02:39:39 +08:00
raiden00pl
804249a0b2 arch/x86_64: fix page table levels in pgalloc
Two level errors corrupted kernel memory when a user process extended
its heap with sbrk:

- PGT_LAST was X86_MMU_PT_LEVELS (4), but valid levels are 0-3, so the
  final level entry was written with an out-of-range index.

- x86_64_get_pgtable indexed the PD (level 2) with level 3, installing
  newly allocated page tables into the wrong PD slot.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-05 10:43:58 -04:00
Abhishek Mishra
c25a5021b4 boards/stm32f746g-disco: add explicit CRYPTO/CODECS deps for dropbear defconfig
nuttx-apps#3557 switches FSUTILS_PASSWD and NETUTILS_DROPBEAR to depend on
CRYPTO, CRYPTO_RANDOM_POOL, NETUTILS_CODECS and CODECS_BASE64 instead of
selecting them. stm32f746g-disco/dropbear must enable these explicitly so
olddefconfig/CI normalize keeps dropbear and FSUTILS_PASSWD enabled.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
0679c97502 boards/sim: add explicit CRYPTO deps for dropbear defconfig
nuttx-apps#3557 switches NETUTILS_DROPBEAR to depend on CRYPTO and
CRYPTO_RANDOM_POOL instead of selecting them.  sim/dropbear must enable
CONFIG_CRYPTO and CONFIG_CRYPTO_RANDOM_POOL explicitly so olddefconfig and
CI normalize keep dropbear and FSUTILS_PASSWD enabled.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
d70e6735e9 Documentation/netutils/dropbear: add Dropbear SSH server documentation
Add application-level documentation for the Dropbear SSH server port,
covering prerequisites, configuration options, usage and troubleshooting.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
c9337eacb6 boards/sim: drop unused FSUTILS_PASSWD from sim defconfigs
Remove CONFIG_FSUTILS_PASSWD from 31 sim configs that do not use NSH
login or other passwd features.  These configs lacked a cryptodev
backend required by FSUTILS_PASSWD after the PBKDF2 Kconfig tightening,
causing olddefconfig normalization failures in CI.

Fixes #19573

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
d4a7e23525 boards/Kconfig: require FSUTILS_PASSWD and cryptodev for ROMFS passwd
BOARD_ETC_ROMFS_PASSWD_ENABLE now depends on FSUTILS_PASSWD and a
cryptodev backend so PBKDF2 passwd autogen cannot be enabled without
the runtime login stack. Fixes #19573.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
95beafba43 boards/sim: add ROMFS passwd and crypto deps for NSH console login
Enable BOARD_ETC_ROMFS_PASSWD_ENABLE and software cryptodev options on
all sim configs with CONFIG_NSH_CONSOLE_LOGIN so PBKDF2 login works on
NuttX 13.0+. Fixes #19573.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
87d12f458e Documentation: PBKDF2 login docs, board Kconfig, and CI password
Document PBKDF2-HMAC-SHA256 ROMFS passwd generation and update board
Kconfig help text accordingly.  Set the documented sim/login CI credential
in GitHub Actions.

Enable CONFIG_CODECS_BASE64 and CONFIG_NETUTILS_CODECS on sim:dropbear for
link compatibility with dropbear's bundled libtomcrypt.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
a7a27fc732 !boards/moxart: Use ROMFS PBKDF2 passwd login
Migrate moxa:nsh from fixed telnet password to build-time ROMFS
/etc/passwd with PBKDF2-HMAC-SHA256 and cryptodev.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
aa314d7ca5 !tools/mkpasswd: PBKDF2 host tool and ROMFS passwd build integration
Add standalone host PBKDF2-HMAC-SHA256 mkpasswd, board_romfs_mkpasswd.sh,
and promptpasswd.sh with confirm-password support. Integrate ROMFS passwd
generation in Board.mk and CMake. Drop TEA key checks from passwd_keys.mk.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Alin Jerpelea
ec9fdcf31a boards/Kconfig: fix merge conflict
merge conflict introduced in master by https://github.com/apache/nuttx/pull/19422
which changed the spaces without a separate commit

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
c18c439e0b stm32f746g-disco: enable CRYPTO_CRYPTODEV for dropbear
apache/nuttx-apps#3636 depends on it; without it NETUTILS_DROPBEAR
silently disables on reconfigure.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00