Commit graph

62301 commits

Author SHA1 Message Date
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
Felipe Moura
1124d5365a boards/sim: 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
Felipe Moura
7c88a4a631 Documentation/stm32f746g-disco: document Dropbear SSH server setup
Document the new stm32f746g-disco:dropbear configuration, mirroring
the existing esp32c3-devkit Dropbear documentation.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
28e763e0bd stm32f746g-disco: Add Dropbear SSH server defconfig
Add a stm32f746g-disco:dropbear config for NSH over SSH on the
board's Ethernet, with the password file and Dropbear host key
persisted on QSPI flash (LittleFS) instead of RAM.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
91090a9990 stm32f746g-disco: Add LittleFS support for N25Q QSPI flash
Add a LittleFS mount option for the on-board N25Q QSPI flash,
mirroring the existing NXFFS/LittleFS toggle already used by the
sibling stm32_w25q.c driver. Needed because NXFFS does not support
rename(), which the companion Dropbear config depends on.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
2edfa031e6 boards/esp32c3-devkit: Remove Dropbear SSH server support
Drop the esp32c3-devkit:dropbear defconfig and its documentation.
The companion apps#3636 (Dropbear over /dev/crypto for this board)
is stuck on an unrelated Espressif CI dependency issue, and the
port is moving to different hardware.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
612b3f4c81 boards/dropbear: retain child exit status for NSH PTY session
Dropbear's NSH PTY session reaps the child task with waitpid() and needs
CONFIG_SCHED_CHILD_STATUS (which depends on SCHED_HAVE_PARENT).  Without it
the session fails with ECHILD right after authentication
("NSH session wait failed: Unknown error 10").

netutils/dropbear now "depends on SCHED_CHILD_STATUS" per the project's
depends-on-over-select policy (apache/nuttx-apps#3648), so enable it in the
sim and esp32c3-devkit Dropbear defconfigs (SCHED_HAVE_PARENT is already
enabled there).

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
22254476b5 boards/esp32c3-devkit/dropbear: enable SCHED_HAVE_PARENT
Dropbear's NSH PTY session reaps the child task with waitpid() and needs
CONFIG_SCHED_CHILD_STATUS, which depends on SCHED_HAVE_PARENT.  The
netutils/dropbear Kconfig now depends on SCHED_HAVE_PARENT and selects
SCHED_CHILD_STATUS (apache/nuttx-apps#3648); set SCHED_HAVE_PARENT here so
the dropbear defconfig stays consistent and the session no longer fails
with ECHILD after authentication.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
44ef93ac56 Documentation/esp32c3-devkit: document Dropbear SSH server setup
Describe how to enable and use the Dropbear SSH server on the ESP32-C3
DevKit, including Wi-Fi, host key, and login configuration.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
e5253da874 boards/esp32c3-devkit: add Dropbear SSH server support
Add a board configuration that enables the Dropbear SSH server on the ESP32-C3 DevKit with Wi-Fi networking and the required crypto support.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
00ac49d5a3 Documentation/sim: document dropbear configuration
Describe how to build and use the Dropbear SSH server configuration on
the simulator, including host TAP network setup, user creation and the
volatile /tmp host key/passwd caveat.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Felipe Moura
36dbc7c61d boards/sim: add dropbear config for local SSH/crypto testing
Add config to use Dropbear in sim environment.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
2ecbd0026b docs/nsh: document id, su, whoami, and privilege prompt markers
Document NSH identity commands and how login/su update the prompt
(# for effective root, $ for non-root). Cover flat-build euid
semantics, related Kconfig options, and session identity behavior
 after login.
2026-08-05 15:26:28 +02:00
Abhishek Mishra
84606c113c cmake/romfs: invoke passwd helper scripts via POSIX shell
Run update_romfs_password.sh, check_passwd_keys.sh, and
gen_passwd_keys.sh through an explicit sh/bash interpreter so CMake
configure works on Linux, macOS, MSYS2, and Cygwin instead of relying
on direct script execution.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
102f96859e boards: add CI ROMFS passwd credentials and refresh docs
Support NUTTX_ROMFS_PASSWD_PASSWORD via update_romfs_password.sh for
configs that enable ROMFS passwd without a defconfig password (sim/login
CI). Enable RANDOMIZE_KEYS in sim/login defconfig. Update mkpasswd.c
header, platform docs, and the mkpasswd_autogen guide.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Abhishek Mishra
9a30bf8527 !boards: enforce secure ROMFS passwd and TEA key setup
Remove implicit default credentials and add build-time validation.
Add check_passwd_keys.sh and gen_passwd_keys.sh; run key setup via
passwd_keys.mk before config.h is generated. Mirror the same logic in
cmake/nuttx_add_romfs.cmake for CMake builds.

BREAKING CHANGE: Builds with CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y now
require an explicit admin password and non-default TEA keys. The
Kconfig default password "Administrator" and default TEA keys are no
longer accepted. Fix: run make menuconfig, set Admin password under
Board Selection -> Auto-generate /etc/passwd, enable random TEA keys or
set CONFIG_FSUTILS_PASSWD_KEY1..4 manually, and use NSH login with
Encrypted password file verification.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-05 15:26:28 +02:00
Alin Jerpelea
1017d76dd9 Revert "!boards: enforce secure ROMFS passwd and TEA key setup"
This reverts commit f5291a8df1.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-08-05 15:26:28 +02:00
zhekunren
c96ed0119a net/tcp/tcp_send: Remove work_available check when updating retransmit timer
The condition work_available(&conn->work) && tx_unacked != 0
prevented tcp_update_retrantimer from being called when the work
queue was still busy, leaving conn->timer stale or zero on
subsequent sends. This caused the RTT estimation to compute a
false RTT (m = rto - 0 = rto), creating a positive feedback loop
that inflated the RTO to extreme values (e.g., 232 half-seconds
= ~116 seconds).

Fix: remove the work_available check so that tcp_update_retrantimer
is always called when there is unacknowledged data. The decision to
re-queue the work is handled internally by tcp_update_timer.

Signed-off-by: zhekunren <zhekunren@qq.com>
2026-08-05 20:46:17 +08:00
fangyibo
6c4adb118e Documentation/audio: document the audio upper half interface
The audio subsystem page listed the source files and the configuration
options, but nothing about the interface the upper half presents to
applications.  PR #18348 added a device state machine, a second buffer
allocation mode, poll and mmap support and several new ioctls, none of
which were described anywhere, so the only way to learn the expected
call sequence was to read audio/audio.c.

Document what the upper half now guarantees:

  - the device state machine, and the fact that AUDIOIOC_START is
    rejected until AUDIOIOC_CONFIGURE has moved the device out of
    AUDIO_STATE_OPEN;
  - the normal open/configure/allocate/enqueue/start sequence;
  - the two AUDIOIOC_ALLOCBUFFER modes selected by u.pbuffer, who owns
    the buffers in each, and that a shared ring request may return zero
    when the ring is already populated;
  - that AUDIOIOC_GETBUFFERINFO also establishes the shared ring depth,
    so a lower half which does not implement it disables that mode;
  - the poll event semantics and how mmap() selects between a ring
    buffer and the device status by requested length;
  - all ioctls handled by the upper half, grouped by purpose;
  - how per-open state is aggregated into the device state when several
    applications share one device.

No functional change.

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-08-05 16:00:32 +08:00
fangyibo
28e628f0b4 audio: limit the buffer count guard to shared ring requests
The upper->periods >= upper->nbuffers check sat at the top of
audio_allocbuffer(), but upper->periods is only incremented for shared
ring requests (u.pbuffer == NULL), so for private buffer callers the
check degenerated into "nbuffers == 0" and rejected every allocation
when the lower half does not implement AUDIOIOC_GETBUFFERINFO, which is
the only place nbuffers is ever assigned.

Move the guard inside the shared ring branch so private buffers, which
never enter upper->apbs[] and are unrelated to the ring depth, stay
allocatable. The zero return value is kept as-is because a second
application attaching to the same device relies on it to skip
allocation and go straight to AUDIOIOC_ENQUEUEBUFFER.

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-08-05 16:00:32 +08:00