2016-08-27 04:52:22 +08:00
|
|
|
add_compiler_rt_component(scudo)
|
[sanitizer] Initial implementation of a Hardened Allocator
Summary:
This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator.
It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast.
The following were implemented:
- additional consistency checks on the allocation function parameters and on the heap chunks;
- use of checksum protected chunk header, to detect corruption;
- randomness to the allocator base;
- delayed freelist (quarantine), to mitigate use after free and overall determinism.
Additional mitigations are in the works.
Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc
Subscribers: kubabrecka, filcab, llvm-commits
Differential Revision: http://reviews.llvm.org/D20084
llvm-svn: 271968
2016-06-07 09:20:26 +08:00
|
|
|
|
|
|
|
include_directories(..)
|
|
|
|
|
|
|
|
set(SCUDO_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
2017-01-11 00:39:36 +08:00
|
|
|
# SANITIZER_COMMON_CFLAGS include -fno-builtin, but we actually want builtins!
|
|
|
|
list(APPEND SCUDO_CFLAGS -fbuiltin)
|
[sanitizer] Initial implementation of a Hardened Allocator
Summary:
This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator.
It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast.
The following were implemented:
- additional consistency checks on the allocation function parameters and on the heap chunks;
- use of checksum protected chunk header, to detect corruption;
- randomness to the allocator base;
- delayed freelist (quarantine), to mitigate use after free and overall determinism.
Additional mitigations are in the works.
Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc
Subscribers: kubabrecka, filcab, llvm-commits
Differential Revision: http://reviews.llvm.org/D20084
llvm-svn: 271968
2016-06-07 09:20:26 +08:00
|
|
|
append_rtti_flag(OFF SCUDO_CFLAGS)
|
|
|
|
|
|
|
|
set(SCUDO_SOURCES
|
|
|
|
scudo_allocator.cpp
|
|
|
|
scudo_flags.cpp
|
2017-01-11 00:39:36 +08:00
|
|
|
scudo_crc32.cpp
|
[sanitizer] Initial implementation of a Hardened Allocator
Summary:
This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator.
It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast.
The following were implemented:
- additional consistency checks on the allocation function parameters and on the heap chunks;
- use of checksum protected chunk header, to detect corruption;
- randomness to the allocator base;
- delayed freelist (quarantine), to mitigate use after free and overall determinism.
Additional mitigations are in the works.
Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc
Subscribers: kubabrecka, filcab, llvm-commits
Differential Revision: http://reviews.llvm.org/D20084
llvm-svn: 271968
2016-06-07 09:20:26 +08:00
|
|
|
scudo_interceptors.cpp
|
|
|
|
scudo_new_delete.cpp
|
|
|
|
scudo_termination.cpp
|
|
|
|
scudo_utils.cpp)
|
|
|
|
|
2017-01-11 00:39:36 +08:00
|
|
|
if (COMPILER_RT_HAS_MSSE4_2_FLAG)
|
|
|
|
set_source_files_properties(scudo_crc32.cpp PROPERTIES COMPILE_FLAGS -msse4.2)
|
|
|
|
endif()
|
|
|
|
|
[sanitizer] Initial implementation of a Hardened Allocator
Summary:
This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator.
It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast.
The following were implemented:
- additional consistency checks on the allocation function parameters and on the heap chunks;
- use of checksum protected chunk header, to detect corruption;
- randomness to the allocator base;
- delayed freelist (quarantine), to mitigate use after free and overall determinism.
Additional mitigations are in the works.
Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc
Subscribers: kubabrecka, filcab, llvm-commits
Differential Revision: http://reviews.llvm.org/D20084
llvm-svn: 271968
2016-06-07 09:20:26 +08:00
|
|
|
if(COMPILER_RT_HAS_SCUDO)
|
|
|
|
foreach(arch ${SCUDO_SUPPORTED_ARCH})
|
|
|
|
add_compiler_rt_runtime(clang_rt.scudo
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
|
|
|
SOURCES ${SCUDO_SOURCES}
|
|
|
|
$<TARGET_OBJECTS:RTInterception.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonNoTermination.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
|
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
|
|
|
PARENT_TARGET scudo)
|
|
|
|
endforeach()
|
|
|
|
endif()
|