Hardened Malloc Light

From Kicksecure
(Redirected from Hardened Malloc Kicksecure)
Jump to navigation Jump to search

Kicksecurehardenedmalloc.jpg
Hardened Malloc (Default) Hardened Malloc Light

Introduction[edit]

Hardened Malloc is a hardened memory allocator which can be used with many applications to increase security.

According to the author's GitHub description: [1]

This is a security-focused general purpose memory allocator providing the malloc API along with various extensions. It provides substantial hardening against heap corruption vulnerabilities. The security-focused design also leads to much less metadata overhead and memory waste from fragmentation than a more traditional allocator design. It aims to provide decent overall performance with a focus on long-term performance and memory usage rather than allocator micro-benchmarks. It offers scalability via a configurable number of entirely independently arenas, with the internal locking within arenas further divided up per size class.

Hardened Malloc (Default) unfortunately cannot be globally enabled by default due to Hardened Malloc (Default) Issues.

The development goal of Hardened Malloc Light is pre-installation by default.

Hardened Malloc Light uses different compile time options.

Both, Hardened Malloc (Default) and Hardened Malloc Light are already installed by default but not yet enabled by default.

Hardened Malloc Light is not yet enabled by default since there are still various known issues. Most notably, it breaks possibly VirtualBox host software crashes, which haven't been reproduced by testers yet.

Advanced users may still wish to use Hardened Malloc (Default) for specific high risk applications.

Before getting started with Hardened Malloc (Light) it is recommended to first test the host operating system using memtest86+ (link) since hardware issues with RAM might be more likely be resulting in system crashes with Hardened Malloc (Light) enabled. [2]

Readers who wish to discuss the integration of Hardened Malloc with Kicksecure ™ should refer to this forum thread.

Enable Hardened Malloc Light[edit]

Testers only! Ambox warning pn.svg.png Warning: This is for testers-only!

Package hardened-malloc-light-enable [3] is provided as an easy way to enable Hardened Malloc Light globally.

Install hardened-malloc-light-enable. To accomplish that, the following steps A. to D. need to be done.

A. Update the package lists.

sudo apt update

B. Upgrade the system.

sudo apt full-upgrade

C. Install the hardened-malloc-light-enable package.

Using apt command line parameter --no-install-recommends is in most cases optional.

sudo apt install --no-install-recommends hardened-malloc-light-enable

D. Done.

The procedure of installing hardened-malloc-light-enable is complete.

Check If Hardened Malloc Enabled[edit]

Same instructions as for Hardened Malloc (Original).

Disable Hardened Malloc Light[edit]

Hardened Malloc Light can be disabled either per application or globally.

Disable Hardened Malloc per Application[edit]

See Disable Hardened Malloc per Application.

Disable Hardened Malloc Light Globally[edit]

Apply the following steps to globally disable Hardened Malloc Light.

If the system is still fully functional, the easiest way is to uninstall the hardened-malloc-light-enable package.

sudo apt purge hardened-malloc-light-enable

Otherwise...

1) Boot into recovery mode. Optional.

This is only required if the system is no longer bootable. In this case, refer to boot into recovery mode.

2) View the /etc/ld.so.preload configuration file.

cat /etc/ld.so.preload

3) Remove /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so from /etc/ld.so.preload.

If not using /etc/ld.so.preload for anything else, it is the easiest to simply delete the configuration file.

Warning: this removes all entries from /etc/ld.so.preload.

sudo rm /etc/ld.so.preload

Issues[edit]

Same as Hardened Malloc (Default) Issues.

Credits and Source Code[edit]

The Hardened Malloc upstream source code is maintained by security researcher, Daniel Micay.

This website is the software fork homepage for Hardened Malloc, with a focus on easy installation, added user documentation, and integration with Kicksecure ™, Whonix ™, Debian, and other distributions. The Kicksecure ™ software fork source code can be found here. Continuous integration: travis CI

Footnotes[edit]

  1. https://github.com/GrapheneOS/hardened_malloc
  2. In the experience of Kicksecure ™ developer Patrick, the VirtualBox host software crashed with Hardened Malloc (Light) enabled with different error messages when faulty RAM banks where used compared to VirtualBox host software crashes with RAM banks that did not show any errors in memtest86+.
  3. https:/github.com/Kicksecure/hardened_malloc/-/blob/master/debian/control#L42


Unfinished: This wiki is a work in progress. Please do not report broken links until this notice is removed, use Search Engines First and contribute improving this wiki.