How OpenBSD’s malloc helps the developer - Otto Moerbeek - EuroBSDcon 2023
Channel: EuroBSDcon
Date: 2023-10-02

Otto Moerbeek:  How OpenBSD's malloc helps the developer 
  

It has been 15 years since my malloc implementation was imported into OpenBSD. It features randomization, keeping meta-data strictly separate from user data and detecting various forms of API misuse like use-after-free and writes inside the allocation but outside the requested size.

These features not only improve security but also help the developer to find bugs. We will discuss the malloc features that help the developer doing proper memory management, concentrating on memory leak detection. While available for some time, the leak detection code was not compiled in by default and cumbersome to use. Recently it was reworked to make it easier to use and it is now available by default.

Otto Moerbeek has been a OpenBSD developer for 20 years. His contributions to OpenBSD include major work on utilities like patch(1) and diff(1), new versions of dc(1) and bc(1), privilege separated tcpdump(8), work on ntpd(8) and kernel time code, unwind(8), large partition and ffs2 support, a complete rewrite of malloc(3) and work on the OpenBSD/loongson port.
Otto Moerbeek: