[HOME] [DOWNLOAD] [DOCS] [NEWS] [SUPPORT] [TIPS] [ISSUES] [DONATE]

hardened_malloc

Security researcher, Daniel Micay has created hardened_malloc which is a hardened memory allocator that protects against heap corruption vulnerabilities.

It isn’t available in the Debian repos but is very easy to build and takes a few seconds. It can be used by changing the LD_PRELOAD variable. For example, to use it with the Tor Browser you should run

LD_PRELOAD="/usr/lib/libhardened_malloc.so" torbrowser

It can be configured globally in /etc/ld.so.preload but this breaks a few things like Xorg and man.

This sounds like it’d be good to add to Whonix. I haven’t tested this on Whonix myself though but it should work. It works fine on my host (Arch).

It can also be easily used with Firejail.

https://wiki.archlinux.org/index.php/Firejail#Use_With_hardened_malloc

Daniel Micay is very trusted and respected in the infosec community. He has put a lot of work into hardening Android and Linux in general. A lot of his patches have even been accepted upstream.

2 Likes
  • What are other options in this space? I’m familiar with Micay’s great work, but I’m curious what other advances/implementations are available.

  • What is the effect on Tor Browser fingerprinting? I think we should ask upstream about their opinion on this just in case.

EDIT:
Related ticket:
https://trac.torproject.org/projects/tor/ticket/10281

Ideally we would have them support this upstream so anyTBB cross acrch support is automatically rolled in.

3 Likes

Needs a Debian RFP:

(Similar to: https://github.com/theupdateframework/tuf/issues/263)

2 Likes

I don’t know any other hardened memory allocators. The ticket you linked seems to have some.

I doubt a website could access that kind of information. It seems unlikely but not impossible.

2 Likes

There is a related issue about Xorg and man.

It seems some syscalls just need to be added to the whitelist.

2 Likes

I’m not against it if this if you will be available to maintain it/deal with breakage and if it is simple to reverse it via an apt update to the default malloc until the breakage is fixed.

2 Likes

It’d probably be best to use it just for high-risk applications like the Tor Browser. I’d imagine using it system-wide would cause a lot of problems.

2 Likes

Agreed. That’s what my comments apply to.

2 Likes

I’ve just tested hardened_malloc with the Tor Browser on the Workstation and it works flawlessly.

There was just a compilation error due to Debian using an outdated GCC that is now resolved as I raised an issue on the github repo.

2 Likes