nuttx/boards
Marco Casaroli 802ccef86f xtensa/esp32s3: Abort the faulting user task on an unrecoverable fault.
When an unprivileged task takes a fault the system cannot recover from, it
now gets a fatal SIGSEGV and only that task ends.  A fault in privileged code
still panics.

What decides it is the interrupted context, not the cause: the saved PS says
whether the fault was taken in User Mode.  A list of causes would leave every
cause off the list as a way for a user task to stop the machine, and there
are many -- a divide by zero, a privileged instruction, a load/store error,
and an illegal instruction, which is how a refused fetch from kernel text
arrives on this chip (TRM v1.8 p.699: a denied external-memory access is
answered with 0xdeadbeaf instead of trapping).  PS.UM is clear in a kernel
thread, in a system call made on the user's behalf and in an interrupt
handler, so those still panic.  If the recoverable-fault dispatcher is
enabled it still gets first refusal on causes 28, 29 and 20, the only ones
re-executing can help.

esp32s3_userfault_abort() records the exception frame as the task's context,
dispatches SIGSEGV, and returns the redirected frame, so the vector's RFE
resumes the task in the signal trampoline, whose default action exits it.
CONFIG_ESP32S3_USERFAULT_ABORT enables it, default y wherever there is an
unprivileged world, and selects SIG_DEFAULT and SIG_SIGKILL_ACTION.

Verified on an ESP32-S3 DevKitC with a WROOM-2 module,
esp32s3-devkit:kernel_oct: a user task that writes through NULL, reads a wild
address, divides by zero, calls into a buffer of garbage or branches into
kernel text is terminated on its own, while an unrelated task keeps running.

Stack overflow is not contained.  On the windowed ABI it faults inside the
window overflow handler and arrives as a double exception with PS.UM already
clear; guard pages are the answer, and separate work.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-09-29 11:13:47 -03:00
..
arm arch/arm/imxrt: Add board-specific clock configuration tables for imxrt118x 2026-09-29 18:40:10 +08:00
arm64 boards/qemu-armv8a: add S2OPC server configuration 2026-09-15 14:55:24 +02:00
avr !arch/arm: Use r9 as the PIC base register. 2026-08-06 01:38:23 +08:00
dummy
hc/m9s12 !arch/arm: Use r9 as the PIC base register. 2026-08-06 01:38:23 +08:00
mips arch/mips/jz4780: Add HDMI EDID parsing and dynamic display modes 2026-08-29 11:08:25 -03:00
misoc/lm32/misoc
or1k/mor1kx/or1k !arch/arm: Use r9 as the PIC base register. 2026-08-06 01:38:23 +08:00
renesas !arch/arm: Use r9 as the PIC base register. 2026-08-06 01:38:23 +08:00
risc-v boards/risc-v/eic7700x: Enable the pinctrl procfs entry. 2026-09-28 16:19:01 +08:00
sim/sim/sim boards/sim: Fix coding style to let the PR pass 2026-09-25 10:36:28 +02:00
sparc
tricore
x86/qemu/qemu-i486 boards/x86/qemu/qemu-i486: Switch nsh/vga_fb from nsh to nxinit. 2026-09-17 16:21:59 +08:00
x86_64/qemu/qemu-intel64 boards/qemu-intel64: add citest configuration 2026-09-15 18:33:47 +08:00
xtensa xtensa/esp32s3: Abort the faulting user task on an unrecoverable fault. 2026-09-29 11:13:47 -03:00
z16/z16f/z16f2800100zcog
z80
.gitignore
Board.mk !tools/mkpasswd: PBKDF2 host tool and ROMFS passwd build integration 2026-07-21 20:19:14 +08:00
boardctl.c !boards/boardctl: Remove BOARDIOC_INIT 2026-05-26 09:57:29 +08:00
CMakeLists.txt cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
dummy.c
Kconfig boards/arm/ra8m1: Add Renesas EK-RA8M1 board support 2026-09-29 06:46:52 -03:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00