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

Integer overflow in allocation size #7

Closed
insuyun opened this issue Mar 30, 2021 · 1 comment
Closed

Integer overflow in allocation size #7

insuyun opened this issue Mar 30, 2021 · 1 comment
Assignees

Comments

@insuyun
Copy link

insuyun commented Mar 30, 2021

Hi. I am testing a secure allocator and found integer overflow.
Here is PoC code.

#include <stdio.h>
#include <stdlib.h>

int main() {
  fprintf(stderr, "%p\n", malloc(-8));
}
$ LD_PRELOAD=$(pwd)/libisoalloc.so ./poc
0x7febb1fa3000

It seems because you don't have integer overflow check in ROUND_UP_PAGE(size).

size = ROUND_UP_PAGE(size);

Best,
Insu Yun.

@struct struct self-assigned this Apr 2, 2021
@struct
Copy link
Owner

struct commented Apr 3, 2021

Thanks @insuyun. This is indeed a bug, but I think it only affects the big zone allocation path. I will have a fix for it in the next code push probably in a few days. Thanks for filing this issue!

@struct struct closed this as completed Apr 4, 2021
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

No branches or pull requests

2 participants