Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7 |
|
#
ecb85b5c |
| 03-Jan-2023 |
Fangrui Song <i@maskray.me> |
[dfsan] Remove injectMetadataGlobals
D97409 added injectMetadataGlobals to differentiate the shadow mode. This feature has been unused and is unneeded after D103745 removed fast16 mode.
Reviewed By
[dfsan] Remove injectMetadataGlobals
D97409 added injectMetadataGlobals to differentiate the shadow mode. This feature has been unused and is unneeded after D103745 removed fast16 mode.
Reviewed By: browneee
Differential Revision: https://reviews.llvm.org/D140797
show more ...
|
#
14ce567f |
| 29-Dec-2022 |
Weining Lu <luweining@loongson.cn> |
[DFSan] Add `zeroext` attribute for callbacks with 8bit shadow variable arguments
Add `zeroext` attribute for below callbacks' first parameter (8bit shadow variable arguments) to conform to many pla
[DFSan] Add `zeroext` attribute for callbacks with 8bit shadow variable arguments
Add `zeroext` attribute for below callbacks' first parameter (8bit shadow variable arguments) to conform to many platforms' ABI calling convention and some compiler behavior. - __dfsan_load_callback - __dfsan_store_callback - __dfsan_cmp_callback - __dfsan_conditional_callback - __dfsan_conditional_callback_origin - __dfsan_reaches_function_callback - __dfsan_reaches_function_callback_origin
The type of these callbacks' first parameter is u8 (see the definition of `dfsan_label`). First, many platforms' ABI requires unsigned integer data types (except unsigned int) are zero-extended when stored in general-purpose register. Second, the problem is that compiler optimization may assume the arguments are zero-extended and, if not, misbehave, e.g. it uses an `i8` argument to index into a jump table. If the argument has non-zero high bits, the output executable may crash at run-time. So we need to add the `zeroext` attribute when declaring and calling them.
Reviewed By: browneee, MaskRay
Differential Revision: https://reviews.llvm.org/D140689
show more ...
|
Revision tags: llvmorg-15.0.6 |
|
#
66c3444f |
| 27-Nov-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
DataFlowSanitizer: Convert most tests to opaque pointers
This was pain every step of the way; there's still one to go.
|
#
1e55d5b1 |
| 21-Nov-2022 |
Manuel Brito <manuel.brito@tecnico.ulisboa.pt> |
Use poison instead of undef as placeholder for vector construction [NFC]
Differential Revision: https://reviews.llvm.org/D138450
|
Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2 |
|
#
3e8eff37 |
| 02-Oct-2022 |
Arthur Eubanks <aeubanks@google.com> |
[opt] Don't initialize legacy instrumentation passes
So that we require `opt -passes=` syntax for instrumentation passes.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D135042
|
Revision tags: llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
#
61ec2148 |
| 04-Oct-2021 |
Andrew Browne <browneee@google.com> |
[DFSan] Remove -dfsan-args-abi support in favor of TLS.
ArgsABI was originally added in https://reviews.llvm.org/D965
Current benchmarking does not show a significant difference. There is no need t
[DFSan] Remove -dfsan-args-abi support in favor of TLS.
ArgsABI was originally added in https://reviews.llvm.org/D965
Current benchmarking does not show a significant difference. There is no need to maintain both ABIs.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D111097
show more ...
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3 |
|
#
c6b5a25e |
| 17-Jun-2021 |
George Balatsouras <gbalats@google.com> |
[dfsan] Replace dfs$ prefix with .dfsan suffix
The current naming scheme adds the `dfs$` prefix to all DFSan-instrumented functions. This breaks mangling and prevents stack trace printers and other
[dfsan] Replace dfs$ prefix with .dfsan suffix
The current naming scheme adds the `dfs$` prefix to all DFSan-instrumented functions. This breaks mangling and prevents stack trace printers and other tools from automatically demangling function names.
This new naming scheme is mangling-compatible, with the `.dfsan` suffix being a vendor-specific suffix: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-structure
With this fix, demangling utils would work out-of-the-box.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D104494
show more ...
|
Revision tags: llvmorg-12.0.1-rc2 |
|
#
5b4dda55 |
| 04-Jun-2021 |
George Balatsouras <gbalats@google.com> |
[dfsan] Add full fast8 support
Complete support for fast8: - amend shadow size and mapping in runtime - remove fast16 mode and -dfsan-fast-16-labels flag - remove legacy mode and make fast8 mode the
[dfsan] Add full fast8 support
Complete support for fast8: - amend shadow size and mapping in runtime - remove fast16 mode and -dfsan-fast-16-labels flag - remove legacy mode and make fast8 mode the default - remove dfsan-fast-8-labels flag - remove functions in dfsan interface only applicable to legacy - remove legacy-related instrumentation code and tests - update documentation.
Reviewed By: stephan.yichao.zhao, browneee
Differential Revision: https://reviews.llvm.org/D103745
show more ...
|
Revision tags: llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
#
d10f173f |
| 16-Mar-2021 |
George Balatsouras <gbalats@google.com> |
[dfsan] Add -dfsan-fast-8-labels flag
This is only adding support to the dfsan instrumentation pass but not to the runtime.
Added more RUN lines for testing: for each instrumentation test that had
[dfsan] Add -dfsan-fast-8-labels flag
This is only adding support to the dfsan instrumentation pass but not to the runtime.
Added more RUN lines for testing: for each instrumentation test that had a -dfsan-fast-16-labels invocation, a new invocation was added using fast8.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D98734
show more ...
|
Revision tags: llvmorg-12.0.0-rc3 |
|
#
46f52fb6 |
| 04-Mar-2021 |
George Balatsouras <gbalats@google.com> |
[dfsan] Remove hardcoded shadow width in array.ll
As a preparation step for fast8 support, we need to update the tests to pass in both modes. That requires generalizing the shadow width and remove a
[dfsan] Remove hardcoded shadow width in array.ll
As a preparation step for fast8 support, we need to update the tests to pass in both modes. That requires generalizing the shadow width and remove any hard coded references that assume it's always 2 bytes.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D97988
show more ...
|
Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1 |
|
#
ea981165 |
| 23-Nov-2020 |
Jianzhou Zhao <jianzhouzh@google.com> |
[dfsan] Track field/index-level shadow values in variables
************* * The problem ************* See motivation examples in compiler-rt/test/dfsan/pair.cpp. The current DFSan always uses a 16bit
[dfsan] Track field/index-level shadow values in variables
************* * The problem ************* See motivation examples in compiler-rt/test/dfsan/pair.cpp. The current DFSan always uses a 16bit shadow value for a variable with any type by combining all shadow values of all bytes of the variable. So it cannot distinguish two fields of a struct: each field's shadow value equals the combined shadow value of all fields. This introduces an overtaint issue.
Consider a parsing function
std::pair<char*, int> get_token(char* p);
where p points to a buffer to parse, the returned pair includes the next token and the pointer to the position in the buffer after the token.
If the token is tainted, then both the returned pointer and int ar tainted. If the parser keeps on using get_token for the rest parsing, all the following outputs are tainted because of the tainted pointer.
The CL is the first change to address the issue.
************************** * The proposed improvement ************************** Eventually all fields and indices have their own shadow values in variables and memory.
For example, variables with type {i1, i3}, [2 x i1], {[2 x i4], i8}, [2 x {i1, i1}] have shadow values with type {i16, i16}, [2 x i16], {[2 x i16], i16}, [2 x {i16, i16}] correspondingly; variables with primary type still have shadow values i16.
*************************** * An potential implementation plan ***************************
The idea is to adopt the change incrementially.
1) This CL Support field-level accuracy at variables/args/ret in TLS mode, load/store/alloca still use combined shadow values.
After the alloca promotion and SSA construction phases (>=-O1), we assume alloca and memory operations are reduced. So if struct variables do not relate to memory, their tracking is accurate at field level.
2) Support field-level accuracy at alloca 3) Support field-level accuracy at load/store
These two should make O0 and real memory access work.
4) Support vector if necessary. 5) Support Args mode if necessary. 6) Support passing more accurate shadow values via custom functions if necessary.
*************** * About this CL. *************** The CL did the following
1) extended TLS arg/ret to work with aggregate types. This is similar to what MSan does.
2) implemented how to map between an original type/value/zero-const to its shadow type/value/zero-const.
3) extended (insert|extract)value to use field/index-level progagation.
4) for other instructions, propagation rules are combining inputs by or. The CL converts between aggragate and primary shadow values at the cases.
5) Custom function interfaces also need such a conversion because all existing custom functions use i16. It is unclear whether custome functions need more accurate shadow propagation yet.
6) Added test cases for aggregate type related cases.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D92261
show more ...
|