[PATCH 0/5] malloc: add options to zero-initialize buffers
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Nov 25 07:20:19 PST 2024
TO further harden barebox against attackers, add options to zero
registers on function exit, buffers on malloc and after free as well as
local variables.
Additionally, TLSF already has sanity checks, which are promoted to
panics with CONFIG_BUG_ON_DATA_CORRUPTION enabled.
Ahmad Fatoum (5):
dlmalloc: add aliases with dl as prefix
hardening: support zeroing all malloc buffers by default
hardening: support initializing stack variables by default
kbuild: support register zeroing on function exit
tlsf: panic in asserts if CONFIG_BUG_ON_DATA_CORRUPTION=y
Makefile | 17 ++++++
common/calloc.c | 7 +--
common/dlmalloc.c | 73 +++++++++++++----------
common/tlsf.c | 6 ++
include/dlmalloc.h | 15 +++++
include/malloc.h | 10 ++++
include/tlsf.h | 2 +
lib/Kconfig.hardening | 133 ++++++++++++++++++++++++++++++++++++++++++
8 files changed, 227 insertions(+), 36 deletions(-)
create mode 100644 include/dlmalloc.h
--
2.39.5
More information about the barebox
mailing list