Commit graph

62260 commits

Author SHA1 Message Date
Old-Ding
9094795bba tools: kconfig2html: Explain blank-line guard
Explain why the guard runs before checking for a continuation marker.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-18 10:07:36 +08:00
Old-Ding
c4d0fb4ca3 tools: kconfig2html: Handle blank input lines
read_line() removes a trailing newline and then checks g_line[len - 1]
for a line-continuation backslash. A blank line leaves len at zero, so
the continuation check reads before g_line.

Return the empty line to the caller before checking for a continuation.
kconfig_line() already skips empty lines, so parser behavior is
unchanged.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-08 21:57:33 +08:00
liang.huang
1fc6f2bac8 arch/riscv: reject overlapping leaf PTE in riscv_fillpage
riscv_fillpage() is the LOADPF/STOREPF handler used under
CONFIG_PAGING. It checked whether intermediate page table levels were
already allocated, but never checked the final leaf PTE before
installing a new mapping.

RISC-V raises the same LOADPF/STOREPF cause both when a leaf PTE is
absent (a real fault) and when it is present but its permission bits
don't satisfy the access, e.g. a store to a .text page whose write
access was revoked after ELF loading. The two cases are
indistinguishable from mcause alone.

Treating both cases as "page missing" let riscv_fillpage silently
allocate a fresh, zeroed physical page over an existing mapping,
discarding the old page (a leak) and defeating whatever permission
that mapping was enforcing. Reproduced on real hardware: a user-space
store to an already-loaded .text page got a fresh writable page
instead of being rejected.

Check the leaf PTE's valid bit before allocating; if a mapping already
exists, panic instead of overwriting it.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-07-08 10:19:04 -03:00
Old-Ding
02a99e3377 boards: xtensa: refresh cardputer lvglterm defconfig
The CI refresh step removes the explicit LVGL terminal keyboard input selection from the esp32s3-m5-cardputer lvglterm defconfig.

Update the saved defconfig so unrelated pull requests do not fail the normalize check on this board.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-08 09:33:40 -03:00
Alan Carvalho de Assis
ae96aa0f5e boards/nucleo-f302r8: disable some interfaces to reduce size
This board config is reaching the 64KB Flash limit, so disable some
not used interface to reduce size.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-08 11:32:02 +08:00
Alan Carvalho de Assis
43d1fe35b0 boards/mps3-an547: Fix error caused by updating nsh Kconfig
After the NSH modification to avoid disabling NSH errors this config
needs to be normalized.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-08 11:32:02 +08:00
Tomasz 'CeDeROM' CEDRO
b204496690 .github: SECURITY.md update.
* Added 12.0.x to security policy table.
* Updated contact info private@ -> security@.
* Added link to NuttX Security Documentation.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2026-07-08 09:52:09 +08:00
raul_chen
cce73da215 Documentation: rework Realtek RTL8721Dx and RTL8720F chip/board pages
Rewrite the RTL8721Dx / PKE8721DAF and RTL8720F / RTL8720F-EVB pages against
the official Realtek product specifications, from an application-developer
point of view:

- Describe the application core NuttX runs on -- an Arm Cortex-M55-compatible
  core, up to 345 MHz on RTL8721Dx (KM4) and up to 320 MHz on RTL8720F (KM4TZ)
  -- and the on-chip memory, instead of the internal multi-core / IPC
  arrangement that is not relevant to application developers.
- Fix the RTL8721Dx SRAM size: 512 KB (was incorrectly documented as 288 KB).
- Add per-part memory (RTL8721DAF and RTL8720FBF: 4 MB NOR flash, 512 KB
  SRAM), wireless (RTL8721Dx: Wi-Fi 4 dual-band + BLE; RTL8720F: Wi-Fi 6
  2.4 GHz + BLE + Thread), peripheral and security highlights.

Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
2026-07-07 09:23:41 -03:00
dependabot[bot]
e280ecf732 build(deps): bump pillow from 11.0.0 to 12.2.0 in /tools/pynuttx
Bumps [pillow](https://github.com/python-pillow/Pillow) from 11.0.0 to 12.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/11.0.0...12.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-version: 12.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-07 14:50:49 +08:00
raiden00pl
f27749b1b7 arch/stm32/serial: simplify ifdefs in ioctl
Simplify complex ifdefs by using UNUSED.
The current conditions do not cover all cases anyway,
and adding more conditions only complicates the code.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-07 01:57:51 +08:00
raul_chen
a60ac789a4 arch/arm/ameba: register wlan0 synchronously for boot WiFi auto-connect
rtl8720f_wifi_initialize() spawned a kthread to run the blocking WHC host
bring-up and register wlan0, so the netdev appeared only after netinit had
already run its one-shot associate -- the WiFi never auto-connected at
boot.  Do the bring-up synchronously on the board bring-up path (mirroring
rtl8721dx_wifi_initialize) so wlan0 exists before netinit runs.

Enable the standard netinit auto-connect machinery in both board
defconfigs: NETINIT_THREAD (runs associate + DHCP off the NSH init path so
the prompt is not blocked), NETINIT_DHCPC, and placeholder
NETINIT_WAPI_SSID/PASSPHRASE the user replaces with their own credentials
(WIRELESS_WAPI + the wapi cmdtool are already enabled).

Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
2026-07-07 01:57:09 +08:00
raul_chen
ac675ec653 arch/arm/ameba: move WiFi netdev to lower-half and enable TCP SACK
Rework the Ameba WHC WiFi driver from the legacy flat net_driver_s model
to the netdev lower-half framework (netdev_lowerhalf_s + netdev_ops_s with
.transmit/.receive, IOB-based quota backpressure and a dedicated
NETDEV_RX_THREAD).  This provides real TX backpressure and moves RX off
the IPC callback onto a bounded rx queue.

Raise the host TX skb pool (skb_num_ap) to a minimum of 16.  The SDK
default of 4 is too small for sustained TCP TX: the host send runs out of
buffers (-2), which exhausts retransmits and tears the connection down.

Enable CONFIG_NET_TCP_SELECTIVE_ACK (which selects OUT_OF_ORDER) in both
board defconfigs.  WiFi's occasional loss otherwise stalls TCP RX on RTO
timeouts (~2 Mbit/s); with SACK + out-of-order queuing RX recovers to
~12-13 Mbit/s.

Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
2026-07-07 01:57:09 +08:00
dependabot[bot]
0cf6b35833 build(deps): bump docker/setup-buildx-action from 4.1.0 to 4.2.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](d7f5e7f509...bb05f3f551)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-06 13:15:47 -04:00
dependabot[bot]
5b27a76e01 build(deps): bump docker/build-push-action from 7.2.0 to 7.3.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](f9f3042f7e...53b7df96c9)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-06 13:15:19 -04:00
dependabot[bot]
86b90f1bee build(deps): bump docker/login-action from 4.2.0 to 4.4.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.2.0 to 4.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](650006c6eb...af1e73f918)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-06 13:14:28 -04:00
Old-Ding
0841476239 arch: imx9: allow last CCM root index
CCM_CR_COUNT is defined as the last CCM root index in the non-SCMI tables, and CCM_CR_PALCAMESCAN also uses that value. Use a strict greater-than check so root 94 reaches the CCM register helpers.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 22:04:14 +08:00
raiden00pl
147134a3fb boards/sim: add Lely CANopen examples
add Lely CANopen examples for sim

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 11:02:46 -03:00
raiden00pl
418c80c633 Documentation: update Lely CANopen doc
update Lely CANopen doc

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 11:02:46 -03:00
hanzhijian
9f69e1c0e9 Documentation: fill in pass1 directory description in organization.rst
Replace the TODO placeholder with a description of the two-pass build
mechanism (CONFIG_BUILD_2PASS).  pass1/ supports two-pass builds where
application-generated source files are compiled and linked into the
kernel address space during pass 2, primarily for kernel symbol table
generation required by loadable kernel modules.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Author: hanzhijian <hanzhijian@zepp.com>
2026-07-06 10:18:42 -03:00
Old-Ding
d81c8bc923 boards: tiva: Fix CC13xx red LED selection
Compare the requested LED id with BOARD_RLED instead of assigning it. BOARD_RLED is nonzero, so the assignment made every non-green LED request select the red LED instead of rejecting invalid ids.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:35:49 +08:00
Old-Ding
bab2b4a5f2 libc/stream: Check lowout bounds before access
Check the provided length before reading the current lowoutstream byte. This avoids reading past zero-length or fully consumed buffers before the loop condition stops.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 09:02:22 +02:00
aineoae86-sys
0b37b86d68 drivers: 1wire: Fix DS2XXX device type bounds
EEPROM_DS_COUNT is the number of supported DS2XXX device types and is used as the size of the EEPROM geometry tables. Reject it before storing the device type for later table indexing.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-06 08:19:49 +02:00
Old-Ding
6b7f9619f0 arch/arm: nrf91: bound modem version parsing
Limit modem version tokens parsed from AT command responses to the LTE version field sizes. Also require both HWVERSION fields before copying them so a partial parse does not read an uninitialized temporary buffer.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 07:58:13 +02:00
Old-Ding
8eba77079e drivers: wireless: bound GS2200M sscanf fields
GS2200M response parsing copies device-provided text fields into fixed-size local buffers.

Add field widths to the sscanf string conversions so the parsed address, port, and command fields stay within their destination arrays.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 07:53:53 +02:00
Old-Ding
4b1a1bdca9 fs/partition: bound TXTABLE partition names
Limit the parsed TXTABLE name field to NAME_MAX and reject entries that do not provide all three required fields. This avoids writing past struct partition_s.name when a text partition table contains an overlong name.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 07:51:46 +02:00
aineoae86-sys
c3494e47e3 arch/arm: xmc4: fix VADC index bounds checks
The XMC_VADC_* constants describe counts, so the valid register, group, and channel indexes are below those values. The current checks allow the count itself through and then use it to index VADC group, channel, and result registers.

Reject those boundary values before the register array access.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-06 07:47:17 +02:00
aineoae86-sys
75b3c8e2a4 drivers: leds: Fix LP503X bank mode LED bounds
PWMIOC_ENABLE_LED_BANK_MODE uses the provided LED number to index the LP503X led_mode array. Reject values outside the RGB LED range before writing that array.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-06 07:44:22 +02:00
Old-Ding
bfc6df0fdc drivers/usbdev: rndis: Reject truncated responses
When several RNDIS responses are queued, the control request handler sends one complete response if the host wLength is smaller than the whole queue. If the first queued response is also larger than wLength, copying hdr->msglen bytes would overrun the requested transfer and the completion path would consume a partial message.

Return EMSGSIZE before copying in that case so the queued response remains intact for a retry with a large enough wLength.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 07:40:40 +02:00
Old-Ding
888711ac3c drivers: pci: Fix EPC MSI IRQ map validation
pci_epc_map_msi_irq() used && when checking the EPC pointer and map_msi_irq callback. If epc is NULL, the right-hand side dereferences it; if the callback is NULL on a valid EPC, the guard does not reject it before the call.

Match the surrounding EPC wrappers by rejecting a NULL EPC, an out-of-range function number, or a missing map_msi_irq callback before taking the lock and invoking the operation.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 07:35:54 +02:00
Old-Ding
74c79bbc05 drivers: pci: Fix EPF debug assertions
pci_epf_device_register() and pci_epf_unregister_driver() used || in DEBUGASSERT expressions that validate a pointer and a required field or callback. If the pointer is NULL, the right-hand side dereferences it; if the pointer is valid but the required member is NULL, the assertion passes.

Require both conditions in each assertion so the debug checks match the preconditions used later in the functions.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 13:35:04 +08:00
Alan Carvalho de Assis
acc06c38f0 boards/imx93-evk: Fix bootloader board config
After enabling the nsh error Kconfig we need to fix configs that were
enabling it manually.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-06 06:48:02 +02:00
Alan Carvalho de Assis
98c6c28688 boards/stm32f103-minimum: Add echo command to test audio tone
The easy way to test audio tone is sending the string directly from
nsh shell using echo command.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-06 12:18:23 +08:00
Old-Ding
115e0a97e9 Documentation: Fix kernel module wording.
Fix repeated and misspelled words in the kernel modules versus shared libraries implementation notes so the text reads correctly.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-05 19:43:23 +02:00
Matteo Golin
8b49e46b9e drivers/audio/i2s: Fix unsigned integers in function signatures
All I2S driver operation functions say in their signature description
that negative errno values are returned on failure. However, some of
these same functions had `uint32_t` return types. This would result in
incorrect comparison of the return value against signed error code
values.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-05 15:06:04 +08:00
raiden00pl
e9ac37e427 !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-07-04 16:31:29 -03:00
Alin Jerpelea
1a6ada7724 boards/risc-v/bl602: remove timers example
the timers example causes the following error:
iscv-none-elf-ld: /github/workspace/sources/nuttx/staging/libapps.a(timer_main.c.github.workspace.sources.apps.examples.timer_1.o): in function timer_main:
/github/workspace/sources/apps/examples/timer/timer_main.c:209:(.text.timer_main+0x1c2): undefined reference to sigaction
riscv-none-elf-ld: /github/workspace/sources/apps/examples/timer/timer_main.c:278:(.text.timer_main+0x30e): undefined reference to sigaction

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-07-04 13:26:04 -04:00
Alin Jerpelea
13e8486fce boards/risv-v/bl602: disable CONFIG_ENABLE_ALL_SIGNALS=y
If this configuration is enabled it will cause the build error

riscv-none-elf-ld: /github/workspace/sources/nuttx/nuttx section .text will not fit in region ilm
riscv-none-elf-ld: region ilm overflowed by 976 bytes

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-07-04 13:26:04 -04:00
raiden00pl
09e4bb45e4 !arch/stm32: unify and commonize stm32_uid for all STM32 families.
Replace the per-family stm32_get_uniqueid() implementations and the two
IP-versioned common variants with a single generic byte-array reader,
arch/arm/src/common/stm32/stm32_uid.c.

BREAKING CHANGE for STM32 M0 families: stm32_get_uniqueid() now always
takes a uint8_t[12] buffer.
Out-of-tree Cortex-M0 code that used the previous prototype
"void stm32_get_uniqueid(uint32_t *uid)" must change its buffer to
"uint8_t uniqueid[12]".

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-04 18:47:45 +08:00
Peter Barada
fb428899dc 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-07-04 14:15:17 +08:00
raiden00pl
70fd28f73b arch/arm/stm32f7: add stm32.h peripheral header
Add arch/arm/src/stm32f7/stm32.h to follow the pattern from other stm32 ports

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-03 17:02:21 -03:00
raiden00pl
f8d8d3bb71 arch/stm32: commonize stm32_waste across all STM32 families.
Remove duplicated family-local *_waste.c/.h copies (stm32l4, stm32l5, stm32wb,
stm32wl5, stm32u5, stm32f7) and use common implementation.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-03 17:01:50 -03:00
Jorge Guzman
7a4f270492 boards/arm/stm32h7: linum-stm32h753bi: add LVGL terminal configuration
Add an "lvglterm" configuration that runs the on-screen NuttShell terminal
(apps/examples/lvglterm, touch input variant) on the display: an on-screen
LVGL keyboard driven by the FT5X06 touchscreen feeds the shell and the NSH
output is rendered in an LVGL text area.

Update the apps/examples/lvglterm documentation to describe the two input
variants (on-screen touch keyboard and physical keyboard) and their
configuration options (input source, keyboard device and font choices).

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-04 02:01:56 +08:00
Jorge Guzman
1953a7449d boards/esp32s3: esp32s3-m5-cardputer: add keyboard and LVGL terminal
Add the 56-key matrix keyboard driver for the M5Stack Cardputer.  The keys
form an 8x7 matrix behind a 74HC138 3-to-8 demultiplexer; the driver scans it
on the low-priority work queue and registers a keyboard device at /dev/kbd0,
reporting ASCII codes with SHIFT/CTRL and Fn (cursor) handling.

Add an "lvglterm" configuration that runs the on-screen NuttShell terminal
(apps/examples/lvglterm, physical-keyboard input variant) on the ST7789
display: the shell output is rendered in an LVGL text area and the keyboard
feeds the input.  Wi-Fi is included so the on-screen shell can associate with
an access point using wapi.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-04 02:01:56 +08:00
Alan Carvalho de Assis
ae0210479d doc/nxdoom: Improve the nxdoom doc to let user play it
It is very easy to get NXDoom running on NuttX, but the instructions
was omitting the needed steps to get it running on Simulator.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-04 01:55:42 +08:00
hanzhijian
9e467388de stdlib/rand: replace weak LCG with xorshift32 PRNG
The existing first-order LCG (seed = 470001 * seed % 999563) has several
quality problems:
- Output range limited to [1, 999562] (~20 bits) instead of full 32-bit
- Lower bits have very short periods (8-bit period = 1, 16-bit = 105)
- Overall period only ~1M, far too short for many applications
- Causes mbedtls_rsa_gen_key to loop forever when rand() consumption
  aligns with the cycle length (issue #16760)

Replace the entire order-based LCG implementation (CONFIG_LIBC_RAND_ORDER
0-3) with Marsaglia's xorshift32:
- Full 32-bit output range
- Period 2^32 - 1 (~4.29 billion)
- Fast: just three XOR/shift operations
- No floating-point math needed
- No CONFIG_LIBC_RAND_ORDER configuration required

Remove the CONFIG_LIBC_RAND_ORDER Kconfig option and clean up all
defconfig references (12 boards) and related comments.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-07-03 15:08:12 +08:00
leisiji
85337c0efc boards/arm/qemu: Fix KASAN global sections placement in linker script
1. The .kasan.unused and .kasan.global sections contain compiler-generated
data with the WRITE flag (.data..LASAN*), but the linker script placed
them before .text without specifying a memory region. The linker could
not put writable sections into the read-only ROM (rx) region, so it
silently placed them at 0x40000000 in RAM, creating an extra LOAD
segment that conflicts with QEMU virt's RAM layout and causes boot
failure.
2. The .kasan.global should be placed before .data because .data
patten (*(.data*)) includes .kasan.global pattern (*(.data..LASAN0)),
and it cause kasan_global.py cannot find .kasan.global section to
generate the g_global_region array.
3. Move .kasan.shadows from before .text to after .rodata. Placing it
before .text causes .text to shift when .kasan.shadows transitions
from empty (pass 1) to populated (pass 2+), preventing the multi-pass
link addresses from converging. After .rodata it does not affect any
upstream section addresses.
4. Add CMake post-build step to strip .kasan.unused and .kasan.global
sections from the final binary, matching the Makefile build behavior.

Signed-off-by: leisiji <2265215145@qq.com>
2026-07-03 07:51:11 +02:00
leisiji
dd86c92405 mm/umm_heap: disable KASAN for user-space heap in kernel build
When CONFIG_BUILD_KERNEL is enabled, user-space and kernel-space have
separate address spaces. User-space addresses passed via syscalls
(e.g., open) are registered by KASAN but should not be monitored,
as they are not kernel heap allocations. This causes KASAN to
report false positives on user-space pointers accessed through
system calls.

Mark the user-space heap with nokasan=true so KASAN skips checking
its address range, consistent with how rptun already handles this.

Signed-off-by: leisiji <2265215145@qq.com>
2026-07-03 07:51:11 +02:00
leisiji
7253e70659 mm/kasan: fix build fail when CONFIG_MM_KASAN_GLOBAL and CONFIG_BUILD_KERNEL on
When CONFIG_MM_KASAN_GLOBAL is enabled, hook.c is also linked into
libmm.a. However, g_global_region (defined in global.c) is only
injected into the nuttx ELF by kasan_global.py — it does not process
the app binary. This causes undefined symbol errors when linking an
app against libmm.a.

Guard the inclusion of global.c with __KERNEL__ so that only kernel
builds pull in the global KASAN region, while app builds fall back
to the no-op stub.

Signed-off-by: leisiji <2265215145@qq.com>
2026-07-03 07:51:11 +02:00
Matteo Golin
51d0848b74 docs/sim: Include documentation about NXDoom configuration
Include docs about new NXDoom configurations for playing NXDoom.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-03 10:30:40 +08:00
Matteo Golin
fe6d58d124 boards/sim: Configuration for NXDoom on simulator
Includes a defconfig to play NXDoom on the simulator. Keyboard input is
available through X11, as well as graphics rendering. The `/data` folder
is used as the default home for game files.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-03 10:30:40 +08:00