ARMmbed / ARMmbed/sal-stack-lwip
mempool region could be allocated across memory regions
- Dominant language
- C
- Stars
- 4
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
On MCUs with continuous memory addresses that span multiple memory regions, it's possible to allocate the mempool region across memory regions. While this is typically not a problem, it could become a very subtle bug.
If the following conditions are met, there will be a hard-fault:
- The mempool region is allocated across a two RAM regions
- The two RAM regions are on different AMBA busses
- Code attempts an unaligned access in the mempool, and it falls across the regions
This could prove very difficult to locate and could be circumvented by explicitly allocating a mempool region in a memory region large enough to contain it.
This is a larger problem with spanning regions, but it's easily solvable in this case.
cc @sg- @bogdanm
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue does not name files, tests, or an entry point. Start by locating how mempool regions are allocated and how MCU RAM regions are represented, then reproduce or test an unaligned access that crosses two regions on different AMBA busses. Done means mempool allocation prevents this unsafe spanning case and the behavior is covered by a relevant test or validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100