Skip to content

ARM: Cortex-M: CPU is not reporting Explicit MemManage Stacking Errors correctly #25612

Closed
@ioannisg

Description

@ioannisg

Describe the bug
Currently, Cortex-M has a bug in error reporting of Stacking Errors that are not, additionally, Data Access Violation Errors. The utility macro, IS_MPU_GUARD_VIOLATION(), implements the wrong logic wrt the input fault_addr (faulting address).

To Reproduce
To reproduce this, we need to trigger a Stacking error that is not, additionally, a MemManage Data Access Violation Error (to do that we need to make sure that the stack overflow occurs because the CPU tries to stack an exception frame and exactly this operation results in overflow). The Cortex-M fault mechanism will assert, complaining that the Stacking error is not due to a stack overflow.

Expected behavior
We expect the Cortex-M Core fault handing mechanism to not Assert when parsing processor memory violation faults.

Impact
Medium severity. There is definitely an error in the fault handing logic. Stack overflows are never missed (so it is not a very critical bug), however, the processor Asserts inside the fault handler. Only affects ARMv7-M architecture with HW_STACK_PROTECTION enabled.

Screenshots or console output
See #25348 , this contains an error log showing the assert statement being hit.

Additional context

  • Needs backporting to LTS.
  • Needs test coverage

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions