@@ -18,7 +18,8 @@ Currently, the allocator supports (was tested on) the following architectures:
18
18
- i386 (& i686) (32-bit);
19
19
- x86_64 (64-bit);
20
20
- armhf (32-bit);
21
- - AArch64 (64-bit).
21
+ - AArch64 (64-bit);
22
+ - MIPS (32-bit & 64-bit).
22
23
23
24
The name "Scudo" has been retained from the initial implementation (Escudo
24
25
meaning Shield in Spanish and Portuguese).
@@ -87,7 +88,7 @@ Randomness
87
88
----------
88
89
It is important for the allocator to not make use of fixed addresses. We use
89
90
the dynamic base option for the SizeClassAllocator, allowing us to benefit
90
- from the randomness of mmap .
91
+ from the randomness of the system memory mapping functions .
91
92
92
93
Usage
93
94
=====
@@ -111,14 +112,14 @@ You may also build Scudo like this:
111
112
112
113
cd $LLVM/projects/compiler-rt/lib
113
114
clang++ -fPIC -std=c++11 -msse4.2 -O2 -I. scudo/*.cpp \
114
- $(\ls sanitizer_common/*.{cc,S} | grep -v "sanitizer_termination\|sanitizer_common_nolibc") \
115
- -shared -o scudo-allocator .so -pthread
115
+ $(\ls sanitizer_common/*.{cc,S} | grep -v "sanitizer_termination\|sanitizer_common_nolibc\|sancov_\|sanitizer_unwind\|sanitizer_symbol ") \
116
+ -shared -o libscudo .so -pthread
116
117
117
118
and then use it with existing binaries as follows:
118
119
119
120
.. code ::
120
121
121
- LD_PRELOAD=`pwd`/scudo-allocator .so ./a.out
122
+ LD_PRELOAD=`pwd`/libscudo .so ./a.out
122
123
123
124
Clang
124
125
-----
@@ -130,15 +131,20 @@ Scudo will also enforce PIE for the output binary.
130
131
131
132
Options
132
133
-------
133
- Several aspects of the allocator can be configured through the following ways:
134
+ Several aspects of the allocator can be configured on a per process basis
135
+ through the following ways:
136
+
137
+ - at compile time, by defining ``SCUDO_DEFAULT_OPTIONS `` to the options string
138
+ you want set by default;
134
139
135
140
- by defining a ``__scudo_default_options `` function in one's program that
136
141
returns the options string to be parsed. Said function must have the following
137
- prototype: ``extern "C" const char* __scudo_default_options(void) ``.
142
+ prototype: ``extern "C" const char* __scudo_default_options(void) ``, with a
143
+ default visibility. This will override the compile time define;
138
144
139
145
- through the environment variable SCUDO_OPTIONS, containing the options string
140
146
to be parsed. Options defined this way will override any definition made
141
- through ``__scudo_default_options ``;
147
+ through ``__scudo_default_options ``.
142
148
143
149
The options string follows a syntax similar to ASan, where distinct options
144
150
can be assigned in the same string, separated by colons.
@@ -167,15 +173,19 @@ The following options are available:
167
173
| | | | the actual deallocation of chunks. Lower value |
168
174
| | | | may reduce memory usage but decrease the |
169
175
| | | | effectiveness of the mitigation; a negative |
170
- | | | | value will fallback to the defaults. |
176
+ | | | | value will fallback to the defaults. Setting |
177
+ | | | | *both * this and ThreadLocalQuarantineSizeKb to |
178
+ | | | | zero will disable the quarantine entirely. |
171
179
+-----------------------------+----------------+----------------+------------------------------------------------+
172
180
| QuarantineChunksUpToSize | 2048 | 512 | Size (in bytes) up to which chunks can be |
173
181
| | | | quarantined. |
174
182
+-----------------------------+----------------+----------------+------------------------------------------------+
175
183
| ThreadLocalQuarantineSizeKb | 1024 | 256 | The size (in Kb) of per-thread cache use to |
176
184
| | | | offload the global quarantine. Lower value may |
177
185
| | | | reduce memory usage but might increase |
178
- | | | | contention on the global quarantine. |
186
+ | | | | contention on the global quarantine. Setting |
187
+ | | | | *both * this and QuarantineSizeKb to zero will |
188
+ | | | | disable the quarantine entirely. |
179
189
+-----------------------------+----------------+----------------+------------------------------------------------+
180
190
| DeallocationTypeMismatch | true | true | Whether or not we report errors on |
181
191
| | | | malloc/delete, new/free, new/delete[], etc. |
@@ -188,7 +198,6 @@ The following options are available:
188
198
+-----------------------------+----------------+----------------+------------------------------------------------+
189
199
190
200
Allocator related common Sanitizer options can also be passed through Scudo
191
- options, such as ``allocator_may_return_null ``. A detailed list including those
192
- can be found here:
201
+ options, such as ``allocator_may_return_null `` or `` abort_on_error `` . A detailed
202
+ list including those can be found here:
193
203
https://github.com/google/sanitizers/wiki/SanitizerCommonFlags.
194
-
0 commit comments