Skip to content

ASLR entropy is very low in mimalloc-secure #289

@pr0cf5

Description

@pr0cf5

The execution environment is ubuntu 18.04 latest.

// address range [0x40000802000 - 0x40000917021] is allocated at a rate of 0.570000
// address range [0x40000942000 - 0x40000a57021] is allocated at a rate of 0.430000
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <malloc.h>

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

int main() {
  p[0] = malloc(378200);
  p[1] = malloc(1134626);
  return 0;
}

When executing the code above, the heap memory range is quite predictable. It is, by 100% either one of 0x40000802000 - 0x40000917021 or 0x40000942000 - 0x40000a57021, so it may be prone to heap spray attacks. The main reason is because the base address is fixed to 0x40000000000.

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