-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Heap protect #747
Heap protect #747
Conversation
@oliverlavery Thank you for the PR. The PR is perhaps missing some changes to
|
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #747 +/- ##
=======================================
Coverage 94.35% 94.35%
=======================================
Files 6 6
Lines 2446 2446
Branches 598 598
=======================================
Hits 2308 2308
Misses 85 85
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8f0289f
to
28dae93
Compare
@ydhuang28 Sure thing. I force pushed another commit to this PR to add configENABLE_HEAP_PROTECTOR to FreeRTOS.h |
28dae93
to
ea6a7f7
Compare
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
* To assist debugging, update a subset of demos to store the line number on which an error is detected rather than just storing a boolean as to whether an error detected or not. * Correct return value of xAreInterruptSemaphoreTasksStillRunning() made incorrect by the prior commit. * Uncrustify: triggered by comment. --------- Co-authored-by: none <> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Rahul Kar <karahulx@amazon.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Implement configENABLE_HEAP_PROTECTOR.
Description
configENABLE_HEAP_PROTECTOR
to1
obfuscates heap block pointers by XORing them with an application supplied canary value. This obfuscation helps to catch heap corruption should a heap buffer overflow occur.Test Steps
Test harnesses to verify the effect of the change in the POSIX simulator are available here:
With
configENABLE_HEAP_PROTECTOR
set to 1, overwriting a free list block leads to an assert on an out of bounds heap pointer. I have also manually verified allocation, free, and corruption in GDB.The POSIX simulator full demo works correctly with both heap_4.c and heap_5.c regardless of the
configENABLE_HEAP_PROTECTOR
setting.Checklist:
Related Issue
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.