Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: armv7-a: Fix heap corruption in SMP mode #292

Merged

Conversation

masayuki2009
Copy link
Contributor

Summary

  • Currently up_allocate_heap() assumes that g_idle_topstack points top of the heap memory. However, g_idle_topstack pointed incorrect address in SMP mode which resulted in heap corruption. This PR moves g_idle_topstack at the end of .noinit to avoid this issue.

Impact

  • This PR affects Cortex-A architectures.

Testing

  • I tested sabre-6quad:smp and sabre-6quad:nsh with QEMU.

Currently up_allocate_heap() assumes that g_idle_topstack points
top of the heap memory. However, g_idle_topstack pointed incorrect
address in SMP mode which resulted in heap corruption. This PR
moves g_idle_topstack at the end of .noinit to avoid this issue.

Signed-off-by: Masayuki Ishikawa <[email protected]>
@patacongo patacongo merged commit e7d44ee into apache:master Feb 18, 2020
@xiaoxiang781216 xiaoxiang781216 linked an issue Feb 18, 2020 that may be closed by this pull request
@masayuki2009 masayuki2009 deleted the fix_heap_corruption_cortex-a_smp branch March 20, 2020 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SMP for Cortex-A MPcore is unstable
2 participants