blob: c124738c1f3a712f84f320242cb93a07d90b6f46 [file] [log] [blame]
Kostya Serebryanya8e71542016-06-07 01:20:26 +00001//===-- scudo_flags.inc -----------------------------------------*- C++ -*-===//
2//
Chandler Carruth58d43602019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Kostya Serebryanya8e71542016-06-07 01:20:26 +00006//
7//===----------------------------------------------------------------------===//
8///
9/// Hardened Allocator runtime flags.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef SCUDO_FLAG
14# error "Define SCUDO_FLAG prior to including this file!"
15#endif
16
Kostya Kortchinsky044cfea2017-02-03 20:49:42 +000017SCUDO_FLAG(int, QuarantineSizeMb, -1,
Kostya Kortchinsky5884a662017-07-24 15:29:38 +000018 "Deprecated. Please use QuarantineSizeKb.")
19
20// Default value is set in scudo_flags.cpp based on architecture.
21SCUDO_FLAG(int, QuarantineSizeKb, -1,
22 "Size in KB of quarantine used to delay the actual deallocation of "
23 "chunks. Lower value may reduce memory usage but decrease the "
24 "effectiveness of the mitigation. Defaults to 64KB (32-bit) or "
25 "256KB (64-bit)")
Kostya Serebryanya8e71542016-06-07 01:20:26 +000026
Kostya Kortchinsky044cfea2017-02-03 20:49:42 +000027// Default value is set in scudo_flags.cpp based on architecture.
28SCUDO_FLAG(int, ThreadLocalQuarantineSizeKb, -1,
Kostya Kortchinsky5884a662017-07-24 15:29:38 +000029 "Size in KB of per-thread cache used to offload the global "
Kostya Serebryanya8e71542016-06-07 01:20:26 +000030 "quarantine. Lower value may reduce memory usage but might increase "
Kostya Kortchinsky5884a662017-07-24 15:29:38 +000031 "the contention on the global quarantine. Defaults to 16KB (32-bit) "
32 "or 64KB (64-bit)")
33
34// Default value is set in scudo_flags.cpp based on architecture.
35SCUDO_FLAG(int, QuarantineChunksUpToSize, -1,
36 "Size in bytes up to which chunks will be quarantined (if lower than"
37 "or equal to). Defaults to 256 (32-bit) or 2048 (64-bit)")
Kostya Serebryanya8e71542016-06-07 01:20:26 +000038
Kostya Kortchinskyd6524c12019-01-24 15:56:54 +000039// Disable the deallocation type check by default on Android, it causes too many
40// issues with third party libraries.
41SCUDO_FLAG(bool, DeallocationTypeMismatch, !SANITIZER_ANDROID,
Kostya Serebryanya8e71542016-06-07 01:20:26 +000042 "Report errors on malloc/delete, new/free, new/delete[], etc.")
43
44SCUDO_FLAG(bool, DeleteSizeMismatch, true,
45 "Report errors on mismatch between size of new and delete.")
46
47SCUDO_FLAG(bool, ZeroContents, false,
48 "Zero chunk contents on allocation and deallocation.")