[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
//===-- ubsan_interface.inc -----------------------------------------------===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Ubsan interface list.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_add_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_add_overflow_abort)
|
[compiler-rt][UBSan] Sanitization for alignment assumptions.
Summary:
This is the compiler-rt part.
The clang part is D54589.
This is a second commit, the original one was r351106,
which was mass-reverted in r351159 because 2 compiler-rt tests were failing.
Now, i have fundamentally changed the testing approach:
i malloc a few bytes, intentionally mis-align the pointer
(increment it by one), and check that. Also, i have decreased
the expected alignment. This hopefully should be enough to pacify
all the bots. If not, i guess i might just drop the two 'bad' tests.
Reviewers: filcab, vsk, #sanitizers, vitalybuka, rsmith, morehouse
Reviewed By: morehouse
Subscribers: rjmccall, krytarowski, rsmith, kcc, srhines, kubamracek, dberris, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D54590
llvm-svn: 351178
2019-01-15 17:44:27 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_alignment_assumption)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_alignment_assumption_abort)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_builtin_unreachable)
|
2017-09-16 07:37:22 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_cfi_bad_type)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_cfi_check_fail)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_cfi_check_fail_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_divrem_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_divrem_overflow_abort)
|
2017-09-19 02:46:19 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_dynamic_type_cache_miss)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_dynamic_type_cache_miss_abort)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_float_cast_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_float_cast_overflow_abort)
|
2019-07-16 14:23:27 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_function_type_mismatch_v1)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_function_type_mismatch_v1_abort)
|
[compiler-rt][ubsan] Implicit Conversion Sanitizer - integer truncation - compiler-rt part
Summary:
This is a compiler-rt part.
The clang part is D48958.
See [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], https://github.com/google/sanitizers/issues/940.
Reviewers: #sanitizers, samsonov, vsk, rsmith, pcc, eugenis, kcc, filcab
Reviewed By: #sanitizers, vsk, filcab
Subscribers: llvm-commits, eugenis, filcab, kubamracek, dberris, #sanitizers, regehr
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D48959
llvm-svn: 338287
2018-07-31 02:58:30 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_implicit_conversion)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_implicit_conversion_abort)
|
2017-07-29 08:20:02 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_invalid_builtin)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_invalid_builtin_abort)
|
2020-07-15 02:16:09 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_invalid_objc_cast)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_invalid_objc_cast_abort)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_load_invalid_value)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_load_invalid_value_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_missing_return)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_mul_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_mul_overflow_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_negate_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_negate_overflow_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nonnull_arg)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nonnull_arg_abort)
|
2017-06-24 05:32:48 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nonnull_return_v1)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nonnull_return_v1_abort)
|
2017-03-15 00:36:03 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nullability_arg)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nullability_arg_abort)
|
2017-06-24 05:32:48 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nullability_return_v1)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_nullability_return_v1_abort)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_out_of_bounds)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_out_of_bounds_abort)
|
2017-06-02 03:40:59 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_pointer_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_pointer_overflow_abort)
|
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
2017-02-01 04:23:21 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_shift_out_of_bounds)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_shift_out_of_bounds_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_sub_overflow)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_sub_overflow_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_type_mismatch_v1)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_type_mismatch_v1_abort)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_vla_bound_not_positive)
|
|
|
|
INTERFACE_FUNCTION(__ubsan_handle_vla_bound_not_positive_abort)
|
|
|
|
INTERFACE_WEAK_FUNCTION(__ubsan_default_options)
|
2018-06-23 04:15:33 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_on_report)
|
2018-06-23 01:21:17 +08:00
|
|
|
INTERFACE_FUNCTION(__ubsan_get_current_report_data)
|