OpenBSD’s omalloc: Bug and buffer overflow detection

For quite a long time now, OpenBSD has, among numerous exploit mitigation techniques, had a very strict mmap()-based malloc() implementation. Recently re-written by Otto Moerbeek, it is even harsher now. I find that this feature makes OpenBSD one of the best platforms to develop C programs on. If you have a double-free, use-after-free, off-by-one, or other typical mistake in your program, chances are OpenBSD’s omalloc will trip up on it eventually. Especially on a strict-alignment, long-pointer architecture like sparc64, running it under OpenBSD is a great way to gain confidence that your program is solid.

Anyway, recently Otto has made OpenBSD’s malloc even stricter. I upgraded my home machine over the weekend to the latest snapshot with these commits, and I’m currently running a bunch of Unworkable BitTorrent download processes on it to make sure my code still holds up. So far so good!

If you have some C code you care about, I’d recommend taking the time to run it under OpenBSD for a while - you might find you catch some bugs which even Valgrind missed. Enjoy!

Share this on a social bookmarking site:
  • Digg
  • del.icio.us
  • Netvouz
  • description
  • ThisNext
  • MisterWong
  • Reddit
  • StumbleUpon

Tags: , , ,

Related posts:
  • Porting software from OpenBSD to Linux II
  • OpenBSD 4.2, FFS2 and large disks
  • Porting software from OpenBSD to Linux
  • Keyboard-only X, cwm hacks and Vimperator
  • Leave a Reply