mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/5] malloc: add options to zero-initialize buffers
@ 2024-12-02  8:18 Ahmad Fatoum
  2024-12-02  8:18 ` [PATCH v2 1/5] dlmalloc: add aliases with dl as prefix Ahmad Fatoum
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2024-12-02  8:18 UTC (permalink / raw)
  To: barebox

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.

v1 -> v2:
  - change config option help text for malloc buffer zeroing
    to be more appropriate for barebox instead of Linux (Sascha)

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
  hardening: 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 | 121 ++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 215 insertions(+), 36 deletions(-)
 create mode 100644 include/dlmalloc.h

-- 
2.39.5




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-02 11:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-02  8:18 [PATCH v2 0/5] malloc: add options to zero-initialize buffers Ahmad Fatoum
2024-12-02  8:18 ` [PATCH v2 1/5] dlmalloc: add aliases with dl as prefix Ahmad Fatoum
2024-12-02  8:18 ` [PATCH v2 2/5] hardening: support zeroing all malloc buffers by default Ahmad Fatoum
2024-12-02  8:18 ` [PATCH v2 3/5] hardening: support initializing stack variables " Ahmad Fatoum
2024-12-02  8:18 ` [PATCH v2 4/5] hardening: support register zeroing on function exit Ahmad Fatoum
2024-12-02  8:18 ` [PATCH v2 5/5] tlsf: panic in asserts if CONFIG_BUG_ON_DATA_CORRUPTION=y Ahmad Fatoum
2024-12-02 11:09 ` [PATCH v2 0/5] malloc: add options to zero-initialize buffers Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox