From e82367e1bf1a07223d314cce863821ad7a2daa75 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 13 May 2020 03:06:49 -0400 Subject: [PATCH] include leaner sample configurations --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 7966b8d..9f0d493 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,32 @@ between portability, performance, memory usage or security. The core design choices are not configurable and the allocator remains very security-focused even with all the optional features disabled. +For reduced memory usage at the expense of performance (this will also reduce +the size of quarantines, saving a lot of memory, since that's currently based +on the size of the largest size class): + + make \ + N_ARENA=1 \ + CONFIG_EXTENDED_SIZE_CLASSES=false + +The default configuration has all normal security features enabled (just not +the niche `CONFIG_SEAL_METADATA`) and is quite aggressive in terms of +sacrificing performance and memory usage for security. An example of a leaner +configuration disabling expensive security features other than zero-on-free / +slab canaries along with using far fewer guard slabs: + + make \ + CONFIG_WRITE_AFTER_FREE_CHECK=false \ + CONFIG_SLOT_RANDOMIZE=false \ + CONFIG_SLAB_QUARANTINE_RANDOM_LENGTH=0 \ + CONFIG_SLAB_QUARANTINE_QUEUE_LENGTH=0 \ + CONFIG_GUARD_SLABS_INTERVAL=8 + +This is a more appropriate configuration for a more mainstream OS choosing to +use hardened\_malloc while making a smaller memory and performance sacrifice. +The slot randomization isn't particularly expensive but it's low value and is +one of the first things to disable when aiming for higher performance. + The following boolean configuration options are available: * `CONFIG_WERROR`: `true` (default) or `false` to control whether compiler