Skip to content

Missing error handling for a large allocation #11

@insuyun

Description

@insuyun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions