-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add integer overflow check to the malloc wrappers #14408
Add integer overflow check to the malloc wrappers #14408
Conversation
Add a check that the combined size of the buffer to allocate and alloc_info_t does not exceed the maximum integer value representable by size_t.
@LDong-Arm, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @LDong-Arm !
We should schedule 5.15 jobs after we close the next 6.x release |
Test run: FAILEDSummary: 1 of 10 test jobs failed Failed test jobs:
|
The failures don't look related to this PR, but I can check on my local K64F and DISCO_L475VG_IOT01A (I don't have a NUCLEO_F429ZI). |
CI restarted |
Test run: FAILEDSummary: 1 of 10 test jobs failed Failed test jobs:
|
I locally checked on a K64F - the TLS socket test failures have nothing to do with this PR. |
CI restarted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
I meant, it's not a CI issue because I can reproduce it locally. |
I run couple of 5.15 jobs in the last days, they were green. I restarted here one more time. |
Test run: FAILEDSummary: 1 of 10 test jobs failed Failed test jobs:
|
Looks like greentea-test-lts is random - #14147 first failed then passed |
Test run: FAILEDSummary: 2 of 10 test jobs failed Failed test jobs:
|
I reported this to the test team (tls socket failures in the recent PRs) |
Test run: SUCCESSSummary: 10 of 10 test jobs passed |
Finally passed! |
Port the following security fix from mbed-os repository: ARMmbed/mbed-os#14408 Summary: Add a check that the combined size of the buffer to allocate and alloc_info_t does not exceed the maximum integer value representable by size_t.
Summary of changes
Backport of #14407
Add a check that the combined size of the buffer to allocate and
alloc_info_t
does not exceed the maximum integer value representable bysize_t
.Impact of changes
Migration actions required
Documentation
None.
Pull request type
Test results
Manual check:
malloc(SIZE_MAX)
now fails as expected.Reviewers
@evedon @donatieng