Hardened malloc
它是什么?
github [1] 上的摘录
这是一个以安全为中心通用目的内存分配器,提供 malloc API 以及各种扩展。它为堆损坏漏洞提供了实质性的强化。
如何使用
注意: 需要 Alpine Linux Edge 版本,并在 /etc/apk/repositories 中启用 testing 仓库
$ doas apk add hardened-malloc
然后,您可以在启动单个应用程序时或在窗口管理器启动之前设置 LD_PRELOAD="/usr/lib/libhardened_malloc.so"
(如果愿意)。对于更全局的设置,将 LD_PRELOAD 引用放入 /etc/profile 或 /etc/profile.d/ 可能会有帮助,对于基于 PAM 的系统,放入 /etc/environment 也是如此。
外部来源
Hardened malloc github