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

Missing error handling for a large allocation #11

Open
insuyun opened this issue Apr 20, 2021 · 1 comment
Open

Missing error handling for a large allocation #11

insuyun opened this issue Apr 20, 2021 · 1 comment

Comments

@insuyun
Copy link

insuyun commented Apr 20, 2021

Hi.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <malloc.h>

void* p[256];
uintptr_t buf[256];

int main() {
  p[0] = malloc(-8);
  fprintf(stderr, "%p\n", p[0]);
}

This program will crash if we run it with SlimGuard.
The reason is that SlimGuard checks mark_used without validating the return value from previous call, which could be zero( https://github.com/ssrg-vt/SlimGuard/blob/master/src/slimguard.c#L409)

Best,
Insu Yun.

@olivierpierre
Copy link
Collaborator

Hello, thank you very much for reporting this bug, you are correct, and it should be fixed in this commit.

Best,

Pierre

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