OpenBSD Journal

Freelist Recycling Tweaks in OpenBSD

Contributed by tbert on from the four-card-monte dept.

Recently, Ted Unangst (tedu@) committed a tweak for malloc(3) freelists:

Module name:	src
Changes by:	2014/05/12 13:02:20

Modified files:
	lib/libc/stdlib: malloc.c 

Log message:
change to having four freelists per size, to reduce another source of
deterministic behavior. four selected because it's more than three, less
than five. i.e., no particular reason.

and astute readers will recall a similarly-themed change for kernel pool(9) freelists.

These changes make it much harder for bugs which require the immediate recycling of freed memory, an example of which was famously unearthed during the heartbleed fallout, to go undiscovered.

(Comments are closed)


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]