Update webpage "Documentation - hardened_malloc" from version "5.0.1" to "5.0.2"
This commit is contained in:
parent
44bba98767
commit
7dd30552d3
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<!-- Inferencium - Website - Documentation - hardened_malloc -->
|
<!-- Inferencium - Website - Documentation - hardened_malloc -->
|
||||||
<!-- Version: 5.0.1 -->
|
<!-- Version: 5.0.2 -->
|
||||||
|
|
||||||
<!-- Copyright 2023 Jake Winters -->
|
<!-- Copyright 2023 Jake Winters -->
|
||||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||||
@ -34,12 +34,16 @@
|
|||||||
<section id="introduction">
|
<section id="introduction">
|
||||||
<p>This documentation contains instructions to use
|
<p>This documentation contains instructions to use
|
||||||
<a href="https://github.com/GrapheneOS/hardened_malloc">hardened_malloc</a>
|
<a href="https://github.com/GrapheneOS/hardened_malloc">hardened_malloc</a>
|
||||||
memory allocator as the system's default memory allocator. These instructions apply to both musl and
|
memory allocator as the system's default memory allocator via dynamic linking as a shared library. These
|
||||||
glibc C libraries on Unix-based and Unix-like systems.</p>
|
instructions apply to both musl and glibc C libraries on Linux-based systems.</p>
|
||||||
<p>hardened_malloc can also be used per-application and/or per-user, in which case root permissions are
|
<p>hardened_malloc can also be used per-application and/or per-user, in which case root permissions are
|
||||||
not required; this documentation focuses on system-wide usage of hardened_malloc, assumes root
|
not required; this documentation focuses on system-wide usage of hardened_malloc, assumes root
|
||||||
privileges, and assumes the compiled library will be located in a path readable and executable by all
|
privileges, and assumes the compiled library will readable and executable by all users of the
|
||||||
users of the system.</p>
|
system.</p>
|
||||||
|
<p>This documentation uses
|
||||||
|
<a href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html">Linux Filesystem Hierarchy Standard</a>
|
||||||
|
paths, with the modern <code>/usr/</code> merge approach of most Linux distributions. For non-standard
|
||||||
|
configurations, adjust the paths accordingly.</p>
|
||||||
<p>For the complete hardened_malloc documentation, visit its
|
<p>For the complete hardened_malloc documentation, visit its
|
||||||
<a href="https://github.com/GrapheneOS/hardened_malloc#hardened_malloc">official documentation</a>.</p>
|
<a href="https://github.com/GrapheneOS/hardened_malloc#hardened_malloc">official documentation</a>.</p>
|
||||||
<p>This documentation is also available in portable AsciiDoc format in my
|
<p>This documentation is also available in portable AsciiDoc format in my
|
||||||
@ -58,26 +62,28 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<section id="memory_pages">
|
<section id="memory_pages">
|
||||||
<h2><a href="#memory_pages">Increase Permitted Amount of Memory Pages</a></h2>
|
<h2><a href="#memory_pages">Increase Permitted Amount of Memory Pages</a></h2>
|
||||||
<p>Add <code>vm.max_map_count = 1048576</code> to <code>/etc/sysctl.conf</code> to accommodate
|
<p>Add the following to <code>/etc/sysctl.conf</code> or a configuration file within
|
||||||
hardened_malloc's large amount of guard pages.</p>
|
<code>/etc/sysctl.d/</code>to accommodate hardened_malloc's large amount of guard pages:</p>
|
||||||
|
<pre>vm.max_map_count = 1048576</pre>
|
||||||
</section>
|
</section>
|
||||||
<section id="clone_source_code">
|
<section id="clone_source_code">
|
||||||
<h2><a href="#clone_source_code">Clone hardened_malloc Source Code</a></h2>
|
<h2><a href="#clone_source_code">Clone hardened_malloc Source Code</a></h2>
|
||||||
<p><code>$ git clone https://github.com/GrapheneOS/hardened_malloc.git</code></p>
|
<pre>$ git clone https://github.com/GrapheneOS/hardened_malloc.git</pre>
|
||||||
</section>
|
</section>
|
||||||
<section id="enter_local_repository">
|
<section id="enter_local_repository">
|
||||||
<h2><a href="#enter_local_repository">Enter hardened_malloc Local Git Repository</a></h2>
|
<h2><a href="#enter_local_repository">Enter hardened_malloc Local Git Repository</a></h2>
|
||||||
<p><code>$ cd hardened_malloc/</code></p>
|
<pre>$ cd hardened_malloc/</pre>
|
||||||
</section>
|
</section>
|
||||||
<section id="compile">
|
<section id="compile">
|
||||||
<h2><a href="#compile">Compile hardened_malloc</a></h2>
|
<h2><a href="#compile">Compile hardened_malloc</a></h2>
|
||||||
<p><code>$ make <var><arguments></var></code></p>
|
<pre>$ make <var><arguments></var></pre>
|
||||||
<p><code>CONFIG_N_ARENA=<var>n</var></code> can be adjusted to increase parallel performance at the
|
<p><code>CONFIG_N_ARENA=<var>n</var></code> can be adjusted to increase parallel performance at the
|
||||||
expense of memory usage, or decrease memory usage at the expense of parallel performance, where
|
expense of memory usage, or decrease memory usage at the expense of parallel performance, where
|
||||||
<code><var>n</var></code> is a non-negative integer. Higher values prefer parallel performance,
|
<code><var>n</var></code> is a non-negative integer. Higher values prefer parallel performance,
|
||||||
whereas lower values prefer lower memory usage. Note that having too many arenas may cause memory
|
whereas lower values prefer lower memory usage. Note that having too many arenas may cause memory
|
||||||
fragmentation and decrease system performance. The number of arenas has no impact on the security
|
fragmentation and decrease system performance. The number of arenas has no impact on the security
|
||||||
properties of hardened_malloc.</p>
|
properties of hardened_malloc.</p>
|
||||||
|
<div style="overflow-x:auto;">
|
||||||
<table align="center">
|
<table align="center">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -94,31 +100,35 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
<p>For extra security, <code>CONFIG_SEAL_METADATA=true</code> can be used in order to control
|
<p>For extra security, <code>CONFIG_SEAL_METADATA=true</code> can be used in order to control
|
||||||
whether
|
whether
|
||||||
<a href="https://www.kernel.org/doc/html/v6.7/core-api/protection-keys.html">Memory Protection Keys</a>
|
<a href="https://www.kernel.org/doc/html/v6.9/core-api/protection-keys.html">Memory Protection Keys</a>
|
||||||
are used to disable access to all writable allocator state outside of the memory allocator code.
|
are used to disable access to all writable allocator state outside of the memory allocator code.
|
||||||
It's currently disabled by default due to a significant performance cost for this use case on
|
It's currently disabled by default due to a significant performance cost for this use case on
|
||||||
current-generation hardware. Whether or not this feature is enabled, the metadata is all contained
|
current-generation hardware. Whether or not this feature is enabled, the metadata is all contained
|
||||||
within an isolated memory region with high-entropy random guard regions around it.</p>
|
within an isolated memory region with high-entropy random guard regions around it.</p>
|
||||||
<p>For low-memory systems, <code>VARIANT=light</code> can be used to compile the light variant of
|
<p>For low-memory systems, <code>VARIANT=light</code> can be used to compile the light variant of
|
||||||
hardened_malloc, which sacrifices some security for much less memory usage. This option still
|
hardened_malloc, which sacrifices some security for less memory usage. This option still produces a
|
||||||
produces a more hardened memory allocator than both the default musl and glibc allocators, despite
|
more hardened memory allocator than both the default musl and glibc allocators, despite the security
|
||||||
the security sacrifices over the full variant.</p>
|
sacrifices over the full variant.</p>
|
||||||
<p>For all compile-time options, see the
|
<p>For all compile-time options, see the
|
||||||
<a href="https://github.com/GrapheneOS/hardened_malloc#configuration">configuration section</a>
|
<a href="https://github.com/GrapheneOS/hardened_malloc#configuration">configuration section</a>
|
||||||
of hardened_malloc's extensive official documentation.</p>
|
of hardened_malloc's official documentation.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="copy_library">
|
<section id="copy_library">
|
||||||
<h2><a href="#copy_library">Copy Compiled hardened_malloc Library</a></h2>
|
<h2><a href="#copy_library">Copy Compiled hardened_malloc Library</a></h2>
|
||||||
<p><code># cp out/libhardened_malloc.so <var><target path></var></code></p>
|
<pre># cp out/libhardened_malloc.so /usr/local/lib/libhardened_malloc.so</pre>
|
||||||
</section>
|
</section>
|
||||||
<section id="preload_on_boot">
|
<section id="preload_on_boot">
|
||||||
<h2><a href="#preload_on_boot">Set System to Preload hardened_malloc on Boot</a></h2>
|
<h2><a href="#preload_on_boot">Set System to Preload hardened_malloc on Boot</a></h2>
|
||||||
<p><b>musl-based systems:</b> Add <code>LD_PRELOAD=<var><hardened_malloc path></var></code> to
|
<p>In order to preload the hardened_malloc shared library on boot, perform the following
|
||||||
<code>/etc/environment</code></p>
|
actions:</p>
|
||||||
<p><b>glibc-based systems:</b> Add <code><var><hardened_malloc path></var></code> to
|
<p><b>musl-based systems:</b> Add the following to <code>/etc/environment</code> or a configuration
|
||||||
<code>/etc/ld.so.preload</code></p>
|
file within <code>/etc/environment.d/</code>:</p>
|
||||||
|
<pre>LD_PRELOAD=/usr/local/lib/libhardened_malloc.so</pre>
|
||||||
|
<p><b>glibc-based systems:</b> Add the following to <code>/etc/ld.so.preload</code>:</p>
|
||||||
|
<pre>/usr/local/lib/libhardened_malloc.so</pre>
|
||||||
</section>
|
</section>
|
||||||
<div class="sitemap-small"><a href="../sitemap.xhtml">Sitemap</a></div>
|
<div class="sitemap-small"><a href="../sitemap.xhtml">Sitemap</a></div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user