ARM: userspace/test_bad_syscall fails on ARMv8-M #17177
Labels
area: ARM
ARM (32-bit) Architecture
area: Userspace
Userspace
bug
The issue is a bug, or the PR is fixing a bug
priority: high
High impact/importance bug
Milestone
After increasing the test coverage in
tests/kernel/mem_protect/userspace
(FYI @andrewboie), the test is failing for ARMv8-M platforms.To Reproduce
Steps to reproduce the behavior:
master
or pull-request branch [Backport v1.14-branch] 1.14 userspace backports coverage #17079 (for the LTS)tests/kernel/mem_protect/userspace
fornrf9160_pca10090
test_bad_syscall
fails.The logs are provided below:
The failure is not yet observed in v1.14-branch, since the PR with the test coverage increase has not yet been merged.
The root cause of the failing test is an implementation bug in system call handling for ARM platforms: the system call initialization code is using the default (un-privileged) stack before switching to the privilege stack.
The fail is only detected in ARMv8-M, because ARMv8-M has more strict rules for pushing to the stack, when stack-overflow mechanisms are activated (i.e. does not allow any push to stack memory below the stack limit; not only a push into a programmed read-only guard, as the traditional MPU-based guard mechanism).
Impact
Affects ARM builds with
CONFIG_USERSPACE=y
.The userspace test is failing
Any swap during system-call initialization in ARMv8-M builds will trigger a stack-overflow.
Fix
The fix is provided in #17146
The text was updated successfully, but these errors were encountered: