There is no reason not to enable it ourselves.

This commit is contained in:
Florent Daigniere
2023-10-07 10:09:04 +02:00
parent 9e1bf76a0c
commit 92e861d4fa
4 changed files with 6 additions and 4 deletions

View File

@@ -81,7 +81,8 @@ def set_env(required_secrets=[], log_filters=[], log_file=None):
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", 'WARNING'))
if not 'LD_PRELOAD' in os.environ and _is_compatible_with_hardened_malloc():
log.warning('Your CPU has Advanced Vector Extensions available, we recommend you enable hardened-malloc by adding LD_PRELOAD=/usr/lib/libhardened_malloc.so to your mailu.env')
log.warning('Your CPU has Advanced Vector Extensions available, we recommend you enable hardened-malloc earlier in the boot process by adding LD_PRELOAD=/usr/lib/libhardened_malloc.so to your mailu.env')
os.environ['LD_PRELOAD'] = '/usr/lib/libhardened_malloc.so'
""" This will set all the environment variables and retains only the secrets we need """
if 'SECRET_KEY_FILE' in os.environ:

View File

@@ -155,5 +155,5 @@ LOG_LEVEL=WARNING
# If your CPU supports Advanced Vector Extensions
# (AVX2 on x86_64, lrcpc on ARM64), you should consider enabling
# hardened-malloc by uncommenting this
# hardened-malloc earlier by uncommenting this
# LD_PRELOAD=/usr/lib/libhardened_malloc.so

View File

@@ -77,7 +77,8 @@ After downloading the files, open ``mailu.env`` and review the variable settings
Make sure to read the comments in the file and instructions from the :ref:`common_cfg` page.
If your CPU supports Advanced Vector Extensions (AVX2 on x86_64, lrcpc on ARM64), you should
consider enabling hardened-malloc by adding the following to your mailu.env:
consider enabling hardened-malloc earlier in the boot process by adding the following to
your mailu.env:
.. code-block:: bash

View File

@@ -1,2 +1,2 @@
Update hardened malloc as the original package is not available from alpine anymore.
The newer version of hardened malloc requires AVX2: Disable it by default and hint in the logs when it should be enabled instead.
The newer version of hardened malloc requires AVX2: Disable it by default at startup and hint in the logs when it should be enabled instead.