ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
Go to the source code of this file.
Classes | |
struct | __sanitizer_sandbox_arguments |
Macros | |
#define | __has_feature(x) 0 |
Functions | |
void | __sanitizer_set_report_path (const char *path) |
void | __sanitizer_set_report_fd (void *fd) |
void | __sanitizer_sandbox_on_notify (__sanitizer_sandbox_arguments *args) |
void | __sanitizer_report_error_summary (const char *error_summary) |
uint16_t | __sanitizer_unaligned_load16 (const void *p) |
Loads a 16-bit unaligned value. | |
uint32_t | __sanitizer_unaligned_load32 (const void *p) |
Loads a 32-bit unaligned value. | |
uint64_t | __sanitizer_unaligned_load64 (const void *p) |
Loads a 64-bit unaligned value. | |
void | __sanitizer_unaligned_store16 (void *p, uint16_t x) |
Stores a 16-bit unaligned value. | |
void | __sanitizer_unaligned_store32 (void *p, uint32_t x) |
Stores a 32-bit unaligned value. | |
void | __sanitizer_unaligned_store64 (void *p, uint64_t x) |
Stores a 64-bit unaligned value. | |
int | __sanitizer_acquire_crash_state () |
void | __sanitizer_annotate_contiguous_container (const void *beg, const void *end, const void *old_mid, const void *new_mid) |
Annotates the current state of a contiguous container, such as std::vector , std::string , or similar. | |
int | __sanitizer_verify_contiguous_container (const void *beg, const void *mid, const void *end) |
Returns true if the contiguous container [beg, end) is properly poisoned. | |
const void * | __sanitizer_contiguous_container_find_bad_address (const void *beg, const void *mid, const void *end) |
Similar to __sanitizer_verify_contiguous_container() but also returns the address of the first improperly poisoned byte. | |
void | __sanitizer_print_stack_trace (void) |
Prints the stack trace leading to this call (useful for calling from the debugger). | |
void | __sanitizer_symbolize_pc (void *pc, const char *fmt, char *out_buf, size_t out_buf_size) |
void | __sanitizer_symbolize_global (void *data_ptr, const char *fmt, char *out_buf, size_t out_buf_size) |
void | __sanitizer_set_death_callback (void(*callback)(void)) |
Sets the callback to be called immediately before death on error. | |
void | __sanitizer_weak_hook_memcmp (void *called_pc, const void *s1, const void *s2, size_t n, int result) |
Interceptor hook for memcmp() . | |
void | __sanitizer_weak_hook_strncmp (void *called_pc, const char *s1, const char *s2, size_t n, int result) |
Interceptor hook for strncmp() . | |
void | __sanitizer_weak_hook_strncasecmp (void *called_pc, const char *s1, const char *s2, size_t n, int result) |
Interceptor hook for strncasecmp() . | |
void | __sanitizer_weak_hook_strcmp (void *called_pc, const char *s1, const char *s2, int result) |
Interceptor hook for strcmp() . | |
void | __sanitizer_weak_hook_strcasecmp (void *called_pc, const char *s1, const char *s2, int result) |
Interceptor hook for strcasecmp() . | |
void | __sanitizer_weak_hook_strstr (void *called_pc, const char *s1, const char *s2, char *result) |
Interceptor hook for strstr() . | |
void | __sanitizer_weak_hook_strcasestr (void *called_pc, const char *s1, const char *s2, char *result) |
void | __sanitizer_weak_hook_memmem (void *called_pc, const void *s1, size_t len1, const void *s2, size_t len2, void *result) |
void | __sanitizer_print_memory_profile (size_t top_percent, size_t max_number_of_contexts) |
void | __sanitizer_start_switch_fiber (void **fake_stack_save, const void *bottom, size_t size) |
Notify ASan that a fiber switch has started (required only if implementing your own fiber library). | |
void | __sanitizer_finish_switch_fiber (void *fake_stack_save, const void **bottom_old, size_t *size_old) |
Notify ASan that a fiber switch has completed (required only if implementing your own fiber library). | |
int | __sanitizer_get_module_and_offset_for_pc (void *pc, char *module_path, size_t module_path_len, void **pc_offset) |
#define __has_feature | ( | x | ) | 0 |
Definition at line 20 of file common_interface_defs.h.
int __sanitizer_acquire_crash_state | ( | ) |
void __sanitizer_annotate_contiguous_container | ( | const void * | beg, |
const void * | end, | ||
const void * | old_mid, | ||
const void * | new_mid | ||
) |
Annotates the current state of a contiguous container, such as std::vector
, std::string
, or similar.
A contiguous container is a container that keeps all of its elements in a contiguous region of memory. The container owns the region of memory [beg, end)
; the memory [beg, mid)
is used to store the current elements, and the memory [mid, end)
is reserved for future elements (beg <= mid <= end
). For example, in std::vector<> v
:
This annotation tells the Sanitizer tool about the current state of the container so that the tool can report errors when memory from [mid, end)
is accessed. Insert this annotation into methods like push_back()
or pop_back()
. Supply the old and new values of mid
(old_mid
and new_mid
). In the initial state mid == end
, so that should be the final state when the container is destroyed or when the container reallocates the storage.
For ASan, beg
should be 8-aligned and end
should be either 8-aligned or it should point to the end of a separate heap-, stack-, or global-allocated buffer. So the following example will not work:
The following, however, will work:
beg | Beginning of memory region. |
end | End of memory region. |
old_mid | Old middle of memory region. |
new_mid | New middle of memory region. |
const void * __sanitizer_contiguous_container_find_bad_address | ( | const void * | beg, |
const void * | mid, | ||
const void * | end | ||
) |
Similar to __sanitizer_verify_contiguous_container()
but also returns the address of the first improperly poisoned byte.
Returns NULL if the area is poisoned properly.
beg | Beginning of memory region. |
mid | Middle of memory region. |
end | Old end of memory region. |
void __sanitizer_finish_switch_fiber | ( | void * | fake_stack_save, |
const void ** | bottom_old, | ||
size_t * | size_old | ||
) |
Notify ASan that a fiber switch has completed (required only if implementing your own fiber library).
When code starts running on the new stack, it must call __sanitizer_finish_switch_fiber()
to finalize the switch. For usage details, see the description of __sanitizer_start_switch_fiber()
.
fake_stack_save | Fake stack save location. |
bottom_old | [out] Bottom address of old stack. |
size_old | [out] Size of old stack in bytes. |
int __sanitizer_get_module_and_offset_for_pc | ( | void * | pc, |
char * | module_path, | ||
size_t | module_path_len, | ||
void ** | pc_offset | ||
) |
void __sanitizer_print_stack_trace | ( | void | ) |
Prints the stack trace leading to this call (useful for calling from the debugger).
void __sanitizer_report_error_summary | ( | const char * | error_summary | ) |
void __sanitizer_sandbox_on_notify | ( | __sanitizer_sandbox_arguments * | args | ) |
void __sanitizer_set_death_callback | ( | void(*)(void) | callback | ) |
Sets the callback to be called immediately before death on error.
Passing 0 will unset the callback.
callback | User-provided callback. |
void __sanitizer_set_report_fd | ( | void * | fd | ) |
void __sanitizer_set_report_path | ( | const char * | path | ) |
void __sanitizer_start_switch_fiber | ( | void ** | fake_stack_save, |
const void * | bottom, | ||
size_t | size | ||
) |
Notify ASan that a fiber switch has started (required only if implementing your own fiber library).
Before switching to a different stack, you must call __sanitizer_start_switch_fiber()
with a pointer to the bottom of the destination stack and with its size. When code starts running on the new stack, it must call __sanitizer_finish_switch_fiber()
to finalize the switch. The __sanitizer_start_switch_fiber()
function takes a void**
pointer argument to store the current fake stack if there is one (it is necessary when the runtime option detect_stack_use_after_return
is enabled).
When restoring a stack, this void**
pointer must be given to the __sanitizer_finish_switch_fiber()
function. In most cases, this pointer can be stored on the stack immediately before switching. When leaving a fiber definitely, NULL must be passed as the first argument to the __sanitizer_start_switch_fiber()
function so that the fake stack is destroyed. If your program does not need stack use-after-return detection, you can always pass NULL to these two functions.
fake_stack_save | [out] Fake stack save location. |
bottom | Bottom address of stack. |
size | Size of stack in bytes. |
void __sanitizer_symbolize_global | ( | void * | data_ptr, |
const char * | fmt, | ||
char * | out_buf, | ||
size_t | out_buf_size | ||
) |
void __sanitizer_symbolize_pc | ( | void * | pc, |
const char * | fmt, | ||
char * | out_buf, | ||
size_t | out_buf_size | ||
) |
uint16_t __sanitizer_unaligned_load16 | ( | const void * | p | ) |
Loads a 16-bit unaligned value.
p | Pointer to unaligned memory. |
uint32_t __sanitizer_unaligned_load32 | ( | const void * | p | ) |
Loads a 32-bit unaligned value.
p | Pointer to unaligned memory. |
uint64_t __sanitizer_unaligned_load64 | ( | const void * | p | ) |
Loads a 64-bit unaligned value.
p | Pointer to unaligned memory. |
void __sanitizer_unaligned_store16 | ( | void * | p, |
uint16_t | x | ||
) |
Stores a 16-bit unaligned value.
p | Pointer to unaligned memory. |
x | 16-bit value to store. |
void __sanitizer_unaligned_store32 | ( | void * | p, |
uint32_t | x | ||
) |
Stores a 32-bit unaligned value.
p | Pointer to unaligned memory. |
x | 32-bit value to store. |
void __sanitizer_unaligned_store64 | ( | void * | p, |
uint64_t | x | ||
) |
Stores a 64-bit unaligned value.
p | Pointer to unaligned memory. |
x | 64-bit value to store. |
int __sanitizer_verify_contiguous_container | ( | const void * | beg, |
const void * | mid, | ||
const void * | end | ||
) |
Returns true if the contiguous container [beg, end)
is properly poisoned.
Proper poisoning could occur, for example, with __sanitizer_annotate_contiguous_container
), that is, if [beg, mid)
is addressable and [mid, end)
is unaddressable. Full verification requires O (end - beg
) time; this function tries to avoid such complexity by touching only parts of the container around beg
, mid
, and end
.
beg | Beginning of memory region. |
mid | Middle of memory region. |
end | Old end of memory region. |
[beg, end)
is properly poisoned. void __sanitizer_weak_hook_memcmp | ( | void * | called_pc, |
const void * | s1, | ||
const void * | s2, | ||
size_t | n, | ||
int | result | ||
) |
Interceptor hook for memcmp()
.
called_pc | PC (program counter) address of the original call. |
s1 | Pointer to block of memory. |
s2 | Pointer to block of memory. |
n | Number of bytes to compare. |
result | Value returned by the intercepted function. |
void __sanitizer_weak_hook_memmem | ( | void * | called_pc, |
const void * | s1, | ||
size_t | len1, | ||
const void * | s2, | ||
size_t | len2, | ||
void * | result | ||
) |
void __sanitizer_weak_hook_strcasecmp | ( | void * | called_pc, |
const char * | s1, | ||
const char * | s2, | ||
int | result | ||
) |
Interceptor hook for strcasecmp()
.
called_pc | PC (program counter) address of the original call. |
s1 | Pointer to block of memory. |
s2 | Pointer to block of memory. |
result | Value returned by the intercepted function. |
void __sanitizer_weak_hook_strcasestr | ( | void * | called_pc, |
const char * | s1, | ||
const char * | s2, | ||
char * | result | ||
) |
void __sanitizer_weak_hook_strcmp | ( | void * | called_pc, |
const char * | s1, | ||
const char * | s2, | ||
int | result | ||
) |
Interceptor hook for strcmp()
.
called_pc | PC (program counter) address of the original call. |
s1 | Pointer to block of memory. |
s2 | Pointer to block of memory. |
result | Value returned by the intercepted function. |
void __sanitizer_weak_hook_strncasecmp | ( | void * | called_pc, |
const char * | s1, | ||
const char * | s2, | ||
size_t | n, | ||
int | result | ||
) |
Interceptor hook for strncasecmp()
.
called_pc | PC (program counter) address of the original call. |
s1 | Pointer to block of memory. |
s2 | Pointer to block of memory. |
n | Number of bytes to compare. |
result | Value returned by the intercepted function. |
void __sanitizer_weak_hook_strncmp | ( | void * | called_pc, |
const char * | s1, | ||
const char * | s2, | ||
size_t | n, | ||
int | result | ||
) |
Interceptor hook for strncmp()
.
called_pc | PC (program counter) address of the original call. |
s1 | Pointer to block of memory. |
s2 | Pointer to block of memory. |
n | Number of bytes to compare. |
result | Value returned by the intercepted function. |
void __sanitizer_weak_hook_strstr | ( | void * | called_pc, |
const char * | s1, | ||
const char * | s2, | ||
char * | result | ||
) |
Interceptor hook for strstr()
.
called_pc | PC (program counter) address of the original call. |
s1 | Pointer to block of memory. |
s2 | Pointer to block of memory. |
result | Value returned by the intercepted function. |