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

Check jl_calloc for integer wrapping on multiplication #42761

Merged
merged 1 commit into from
Oct 23, 2021

Conversation

mkitti
Copy link
Contributor

@mkitti mkitti commented Oct 22, 2021

This adds a check to the C function jl_calloc to prevent overflow. The specific change here was previously reviewed by @vtjnash in #42704 and includes a revision by him to use SSIZE_MAX rather than SIZE_MAX. I've extracted the relevant code from the large set of changes.

This makes jl_calloc SCI CERT MEM07-C compliant such that it avoids issues as in RUS-CERT Advisory 2002-08:02 or CVE-2002-039.

Fixes #42673

@mkitti mkitti changed the title Check jl_calloc Check jl_calloc for integer wrapping on multiplication Oct 22, 2021
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Oct 23, 2021
@dkarrasch dkarrasch merged commit 5f11f5b into JuliaLang:master Oct 23, 2021
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Oct 25, 2021
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
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.

jl_calloc is subject to unchecked unsigned integer wrapping
4 participants