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!
|
2018-04-13 00:41:57 +08:00
|
|
|
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)
|
|
|
|
|
2021-08-13 01:52:24 +08:00
|
|
|
# Too many existing bugs, needs cleanup.
|
|
|
|
append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format SCUDO_CFLAGS)
|
|
|
|
|
2018-06-22 05:48:04 +08:00
|
|
|
set(SCUDO_MINIMAL_DYNAMIC_LIBS ${SANITIZER_COMMON_LINK_LIBS})
|
|
|
|
append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS)
|
2019-07-03 04:33:19 +08:00
|
|
|
append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer
|
|
|
|
SCUDO_CFLAGS)
|
2018-01-20 06:17:39 +08:00
|
|
|
|
2018-03-27 22:40:39 +08:00
|
|
|
set(SCUDO_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
|
[scudo] Use gc-sections by default
Summary:
If not using `-Wl,--gc-sections`, a whole lot of unused `sanitizer_common` code
and related static variables are pulled into the shared library.
Keep the binary size smaller, and its memory footprint smaller as well, by
using the compiler flags `-ffunction-section` & `-fdata-sections` by default,
as well as the linker flags `-Wl,--gc-sections`.
Current experiments show a large discrepency between binary sizes generated
by gcc (big) and clang (small). I am not sure yet how I can make a test that
would encompass both, so it's an outstanding work item.
Reviewers: alekseyshl, flowerhack
Reviewed By: alekseyshl
Subscribers: mgorny, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D44121
llvm-svn: 326833
2018-03-07 04:13:37 +08:00
|
|
|
# Use gc-sections by default to avoid unused code being pulled in.
|
|
|
|
list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -Wl,--gc-sections)
|
|
|
|
|
[sanitizer] Use -Wl,-z,global on Android for sanitizers except UBsan
Summary:
This essentially reverts r337010 since it breaks UBSan, which is used
for a few platform libraries. The "-z global" flag is now added for
Scudo as well. The only other sanitizer shared libraries are for asan
and hwasan, which have also been reinstated to use the global flag.
Reviewers: cryptoad, eugenis
Reviewed By: cryptoad
Subscribers: kubamracek, mgorny, delcypher, #sanitizers, nickdesaulniers, chh, kongyi, pirama, llvm-commits
Differential Revision: https://reviews.llvm.org/D52770
llvm-svn: 343599
2018-10-03 00:19:42 +08:00
|
|
|
if(ANDROID)
|
|
|
|
# Put most Sanitizer shared libraries in the global group. For more details, see
|
|
|
|
# android-changes-for-ndk-developers.md#changes-to-library-search-order
|
|
|
|
if (COMPILER_RT_HAS_Z_GLOBAL)
|
|
|
|
list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -Wl,-z,global)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-09-04 15:31:34 +08:00
|
|
|
# The minimal Scudo runtime does not include the UBSan runtime.
|
2018-06-22 05:48:04 +08:00
|
|
|
set(SCUDO_MINIMAL_OBJECT_LIBS
|
2018-03-27 22:40:39 +08:00
|
|
|
RTSanitizerCommonNoTermination
|
|
|
|
RTSanitizerCommonLibc
|
|
|
|
RTInterception)
|
2019-06-18 01:45:34 +08:00
|
|
|
|
|
|
|
if (COMPILER_RT_HAS_GWP_ASAN)
|
2021-05-15 01:28:09 +08:00
|
|
|
list(APPEND SCUDO_MINIMAL_OBJECT_LIBS
|
|
|
|
RTGwpAsan RTGwpAsanOptionsParser RTGwpAsanBacktraceLibc
|
|
|
|
RTGwpAsanSegvHandler)
|
2019-06-18 01:45:34 +08:00
|
|
|
list(APPEND SCUDO_CFLAGS -DGWP_ASAN_HOOKS)
|
|
|
|
endif()
|
|
|
|
|
2018-06-22 05:48:04 +08:00
|
|
|
set(SCUDO_OBJECT_LIBS ${SCUDO_MINIMAL_OBJECT_LIBS})
|
|
|
|
set(SCUDO_DYNAMIC_LIBS ${SCUDO_MINIMAL_DYNAMIC_LIBS})
|
2018-03-27 22:40:39 +08:00
|
|
|
|
|
|
|
if (FUCHSIA)
|
|
|
|
list(APPEND SCUDO_CFLAGS -nostdinc++)
|
|
|
|
list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -nostdlib++)
|
|
|
|
else()
|
2019-02-16 16:34:26 +08:00
|
|
|
list(APPEND SCUDO_DYNAMIC_LIBS ${SANITIZER_CXX_ABI_LIBRARIES})
|
[sanitizer] Split Symbolizer/StackTraces from core RTSanitizerCommon
Summary:
Host symbolizer & stacktraces related code in their own RT:
`RTSanitizerCommonSymbolizer`, which is "libcdep" by nature. Symbolizer &
stacktraces specific code that used to live in common files is moved to a new
file `sanitizer_symbolizer_report.cc` as is.
The purpose of this is the enforce a separation between code that relies on
symbolization and code that doesn't. This saves the inclusion of spurious code
due to the interface functions with default visibility, and the extra data
associated.
The following sanitizers makefiles were modified & tested locally:
- dfsan: doesn't require the new symbolizer RT
- esan: requires it
- hwasan: requires it
- lsan: requires it
- msan: requires it
- safestack: doesn't require it
- xray: doesn't require it
- tsan: requires it
- ubsan: requires it
- ubsan_minimal: doesn't require it
- scudo: requires it (but not for Fuchsia that has a minimal runtime)
This was tested locally on Linux, Android, Fuchsia.
Reviewers: alekseyshl, eugenis, dberris, kubamracek, vitalybuka, dvyukov, mcgrathr
Reviewed By: alekseyshl, vitalybuka
Subscribers: srhines, kubamracek, mgorny, krytarowski, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D45457
llvm-svn: 330131
2018-04-17 00:32:19 +08:00
|
|
|
list(APPEND SCUDO_OBJECT_LIBS
|
|
|
|
RTSanitizerCommonCoverage
|
|
|
|
RTSanitizerCommonSymbolizer
|
|
|
|
RTUbsan)
|
2018-03-27 22:40:39 +08:00
|
|
|
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
|
|
|
set(SCUDO_SOURCES
|
|
|
|
scudo_allocator.cpp
|
2017-01-11 00:39:36 +08:00
|
|
|
scudo_crc32.cpp
|
2018-06-16 00:45:19 +08:00
|
|
|
scudo_errors.cpp
|
2018-01-26 04:42:44 +08:00
|
|
|
scudo_flags.cpp
|
|
|
|
scudo_malloc.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_termination.cpp
|
[scudo] Scudo thread specific data refactor, part 3
Summary:
Previous parts: D38139, D38183.
In this part of the refactor, we abstract the Linux vs Android TSD dissociation
in favor of a Exclusive vs Shared one, allowing for easier platform introduction
and configuration.
Most of this change consist of shuffling the files around to reflect the new
organization.
We introduce `scudo_platform.h` where platform specific definition lie. This
involves the TSD model and the platform specific allocator parameters. In an
upcoming CL, those will be configurable via defines, but we currently stick
with conservative defaults.
Reviewers: alekseyshl, dvyukov
Reviewed By: alekseyshl, dvyukov
Subscribers: srhines, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D38244
llvm-svn: 314224
2017-09-27 01:20:02 +08:00
|
|
|
scudo_tsd_exclusive.cpp
|
|
|
|
scudo_tsd_shared.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_utils.cpp)
|
|
|
|
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
set(SCUDO_CXX_SOURCES
|
|
|
|
scudo_new_delete.cpp)
|
|
|
|
|
2018-07-10 21:00:17 +08:00
|
|
|
set(SCUDO_HEADERS
|
|
|
|
scudo_allocator.h
|
|
|
|
scudo_allocator_combined.h
|
|
|
|
scudo_allocator_secondary.h
|
|
|
|
scudo_crc32.h
|
|
|
|
scudo_errors.h
|
|
|
|
scudo_flags.h
|
|
|
|
scudo_flags.inc
|
|
|
|
scudo_interface_internal.h
|
|
|
|
scudo_platform.h
|
|
|
|
scudo_tsd.h
|
|
|
|
scudo_tsd_exclusive.inc
|
|
|
|
scudo_tsd_shared.inc
|
|
|
|
scudo_utils.h)
|
|
|
|
|
2022-03-31 15:55:25 +08:00
|
|
|
# Enable the necessary instruction set for scudo_crc32.cpp, if available.
|
|
|
|
# Newer compiler versions use -mcrc32 rather than -msse4.2.
|
|
|
|
if (COMPILER_RT_HAS_MCRC32_FLAG)
|
|
|
|
set_source_files_properties(scudo_crc32.cpp PROPERTIES COMPILE_FLAGS -mcrc32)
|
|
|
|
elseif (COMPILER_RT_HAS_MSSE4_2_FLAG)
|
2017-01-11 00:39:36 +08:00
|
|
|
set_source_files_properties(scudo_crc32.cpp PROPERTIES COMPILE_FLAGS -msse4.2)
|
|
|
|
endif()
|
|
|
|
|
[scudo] Refactor of CRC32 and ARM runtime CRC32 detection
Summary:
ARM & AArch64 runtime detection for hardware support of CRC32 has been added
via check of the AT_HWVAL auxiliary vector.
Following Michal's suggestions in D28417, the CRC32 code has been further
changed and looks better now. When compiled with full relro (which is strongly
suggested to benefit from additional hardening), the weak symbol for
computeHardwareCRC32 is read-only and the assembly generated is fairly clean
and straight forward. As suggested, an additional optimization is to skip
the runtime check if SSE 4.2 has been enabled globally, as opposed to only
for scudo_crc32.cpp.
scudo_crc32.h has no purpose anymore and was removed.
Reviewers: alekseyshl, kcc, rengolin, mgorny, phosek
Reviewed By: rengolin, mgorny
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D28574
llvm-svn: 292409
2017-01-19 01:11:17 +08:00
|
|
|
# Enable the AArch64 CRC32 feature for scudo_crc32.cpp, if available.
|
|
|
|
# Note that it is enabled by default starting with armv8.1-a.
|
|
|
|
if (COMPILER_RT_HAS_MCRC_FLAG)
|
|
|
|
set_source_files_properties(scudo_crc32.cpp PROPERTIES COMPILE_FLAGS -mcrc)
|
|
|
|
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)
|
2018-06-22 05:48:04 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.scudo_minimal
|
|
|
|
STATIC
|
|
|
|
ARCHS ${SCUDO_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SCUDO_SOURCES}
|
2018-07-10 21:00:17 +08:00
|
|
|
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
|
2018-06-22 05:48:04 +08:00
|
|
|
OBJECT_LIBS ${SCUDO_MINIMAL_OBJECT_LIBS}
|
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
|
|
|
PARENT_TARGET scudo)
|
|
|
|
add_compiler_rt_runtime(clang_rt.scudo_cxx_minimal
|
|
|
|
STATIC
|
|
|
|
ARCHS ${SCUDO_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SCUDO_CXX_SOURCES}
|
2018-07-10 21:00:17 +08:00
|
|
|
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
|
2018-06-22 05:48:04 +08:00
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
|
|
|
PARENT_TARGET scudo)
|
|
|
|
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.scudo
|
|
|
|
STATIC
|
|
|
|
ARCHS ${SCUDO_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SCUDO_SOURCES}
|
2018-07-10 21:00:17 +08:00
|
|
|
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
|
2018-03-27 22:40:39 +08:00
|
|
|
OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
|
|
|
PARENT_TARGET scudo)
|
|
|
|
add_compiler_rt_runtime(clang_rt.scudo_cxx
|
|
|
|
STATIC
|
|
|
|
ARCHS ${SCUDO_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SCUDO_CXX_SOURCES}
|
2018-07-10 21:00:17 +08:00
|
|
|
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
OBJECT_LIBS RTUbsan_cxx
|
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
|
|
|
PARENT_TARGET scudo)
|
|
|
|
|
2018-06-22 05:48:04 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.scudo_minimal
|
|
|
|
SHARED
|
|
|
|
ARCHS ${SCUDO_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SCUDO_SOURCES} ${SCUDO_CXX_SOURCES}
|
2018-07-10 21:00:17 +08:00
|
|
|
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
|
2018-06-22 05:48:04 +08:00
|
|
|
OBJECT_LIBS ${SCUDO_MINIMAL_OBJECT_LIBS}
|
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
|
|
|
LINK_FLAGS ${SCUDO_DYNAMIC_LINK_FLAGS}
|
|
|
|
LINK_LIBS ${SCUDO_MINIMAL_DYNAMIC_LIBS}
|
|
|
|
PARENT_TARGET scudo)
|
|
|
|
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.scudo
|
|
|
|
SHARED
|
|
|
|
ARCHS ${SCUDO_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SCUDO_SOURCES} ${SCUDO_CXX_SOURCES}
|
2018-07-10 21:00:17 +08:00
|
|
|
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
|
2018-03-27 22:40:39 +08:00
|
|
|
OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
CFLAGS ${SCUDO_CFLAGS}
|
2018-01-20 06:17:39 +08:00
|
|
|
LINK_FLAGS ${SCUDO_DYNAMIC_LINK_FLAGS}
|
[scudo] Implement stricter separation of C vs C++
Summary:
Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.
We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.
Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in D39334).
The changes in this patch:
- split the cxx specific code in the scudo cmake file into a new library;
(remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39461
llvm-svn: 317097
2017-11-01 23:28:20 +08:00
|
|
|
LINK_LIBS ${SCUDO_DYNAMIC_LIBS}
|
|
|
|
PARENT_TARGET 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
|
|
|
endif()
|