Skip to content
Commit 8b55af51 authored by Keith Packard's avatar Keith Packard Committed by Stephanos Ioannidis
Browse files

arch/arm: Make MPU stack guard large enough to hold an exception frame



When a stack overflow is caught by an MPU region, the stack pointer will
end up inside that area when the exception is handled. Handling the
exception involves pushing an exception frame onto the same stack. If
there's not enough space remaining below the faulting SP value, the
memory region below the stack will get corrupted.

We protect against this by making the stack guard larger than the 0x20
bytes necessary to hold an exception frame. To avoid lots of conditional
complexity here, the guard is set to 0x40 bytes if the MPU minimum size
is not larger than 0x20 bytes.

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent 1638d485
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment