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

[libc] Make malloc resistant to overflow #122978

Closed
mysterymath opened this issue Jan 14, 2025 · 1 comment
Closed

[libc] Make malloc resistant to overflow #122978

mysterymath opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels

Comments

@mysterymath
Copy link
Contributor

The malloc implmentation in libc has been only spoaradically careful to prevent overflow, but it hasn't been systematically careful. It should be the case that no value provided to any surface area of the allocator (the allocation functions, _end, and __llvm_libc_heap_limit) can cause it to produce erroneous behavior due to overflow. Tests should be added for the various possible overflow corner cases, checks added to secure against this possibility, and any spurious checks removed.

@mysterymath mysterymath self-assigned this Jan 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 14, 2025

@llvm/issue-subscribers-libc

Author: Daniel Thornburgh (mysterymath)

The malloc implmentation in libc has been only spoaradically careful to prevent overflow, but it hasn't been systematically careful. It should be the case that no value provided to any surface area of the allocator (the allocation functions, `_end`, and `__llvm_libc_heap_limit`) can cause it to produce erroneous behavior due to overflow. Tests should be added for the various possible overflow corner cases, checks added to secure against this possibility, and any spurious checks removed.

@mysterymath mysterymath closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants