nuttx/arch
buxiasen 93a2c4d2eb arch/arm/arm_dispatch_syscall: fix callee-saved reg corruption in protected
arm_dispatch_syscall in armv7-m clobbered r11 with 'mov r11, sp' and the
user-space callee-saved register value leaked back through the exception
frame when SYS_syscall_return restored the context, resulting in corrupted
parameters on subsequent syscalls and system hangs in protected builds.

In armv6-m, r4 was used to load g_stublookup (Thumb-1 cannot use ip for
indexed addressing) but was not restored before SYS_syscall_return,
causing the same class of register corruption.

Fix with minimal changes:
  - armv7-m: remove 'mov r11, sp' to stop clobbering user r11
  - armv6-m: restore r4 from the stack frame before SYS_syscall_return

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-07 14:51:10 +02:00
..
arm arch/arm/arm_dispatch_syscall: fix callee-saved reg corruption in protected 2026-04-07 14:51:10 +02:00
arm64 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
avr style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
ceva include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
dummy
hc style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
mips include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
misoc include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
or1k include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
renesas style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
risc-v style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
sim style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
sparc include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
tricore include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
x86 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
x86_64 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
xtensa style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
z16 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
z80 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
CMakeLists.txt
Kconfig arch/delays: Invalid default value for BOARD_LOOPSPERMSEC 2026-02-25 15:00:03 -03:00