OpenBSD: Improved Memory Allocation, Beta Testing 3.8, from KernelTrap.

OpenBSD creator Theo de Raadt described a number of modifications to how OpenBSD allocates memory:

  • mmap system call return a random memory address, as well ensuring “that two objects are not mapped next to each other; in effect, this creates unallocated memory which we call a ‘guard page’”
  • malloc function was updated to use mmap to obtain memory
  • free function was updated to immediately return memory to the kernel and un-allocate it from the calling process

Theo points out that these changes have a couple of significant impacts. He explains that for over a decade efforts have been made to find and fix buffer overflows, and more recently bugs have been found in which software is reading before the start of a buffer, or beyond the end of the buffer. With these recent memory allocation changes, such an attempt will cause the application to coredump with a SIGSEGV signal.

Additionally, now that memory is unmapped as soon as it is freed, any attempt to access freed memory will also cause the application to coredump with a SIGSEGV signal.

Popularity: 13% [?]