Skip to content

Commit

Permalink
nixos/malloc: add graphene-hardened-light
Browse files Browse the repository at this point in the history
  • Loading branch information
surfaceflinger committed Apr 18, 2024
1 parent b1e8c3b commit af65b87
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions nixos/modules/config/malloc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,23 @@ let
graphene-hardened = {
libPath = "${pkgs.graphene-hardened-malloc}/lib/libhardened_malloc.so";
description = ''
An allocator designed to mitigate memory corruption attacks, such as
those caused by use-after-free bugs.
Hardened memory allocator coming from GrapheneOS project.
The default configuration template has all normal optional security
features enabled and is quite aggressive in terms of sacrificing
performance and memory usage for security.
'';
};

graphene-hardened-light = {
libPath = "${pkgs.graphene-hardened-malloc}/lib/libhardened_malloc-light.so";
description = ''
Hardened memory allocator coming from GrapheneOS project.
The light configuration template disables the slab quarantines,
write after free check, slot randomization and raises the guard
slab interval from 1 to 8 but leaves zero-on-free and slab canaries enabled.
The light configuration has solid performance and memory usage while still
being far more secure than mainstream allocators with much better security
properties.
'';
};

Expand Down

0 comments on commit af65b87

Please sign in to comment.