diff options
author | Harshit Sharma <harshitsharmajs@gmail.com> | 2020-08-08 17:51:59 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-08-21 07:46:04 +0000 |
commit | 51593dd0c6cf1f69b813ba9c507f74f3641bdc68 (patch) | |
tree | da24930937f0f150e1a1cdec8965c7971474c4ca /src/include/asan.h | |
parent | c29c12376fee93da6654624b648f9c84233c6973 (diff) |
arch/x86: Add support for ASan to memory functions
Compiler's instrumentation cannot insert asan memory checks in
case of memory functions like memset, memcpy and memmove as they
are written in assembly.
So, we need to manually check the memory state before performing
each of these operations to ensure that ASan is triggered in case
of bad access.
Change-Id: I2030437636c77aea7cccda8efe050df4b77c15c7
Signed-off-by: Harshit Sharma <harshitsharmajs@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44307
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Diffstat (limited to 'src/include/asan.h')
-rw-r--r-- | src/include/asan.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/asan.h b/src/include/asan.h index 8816eafbf4..1fe798d97f 100644 --- a/src/include/asan.h +++ b/src/include/asan.h @@ -57,6 +57,8 @@ void asan_unpoison_shadow(const void *address, size_t size); void asan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip); void asan_init(void); +void check_memory_region(unsigned long addr, size_t size, bool write, + unsigned long ret_ip); uintptr_t __asan_shadow_offset(uintptr_t addr); void __asan_register_globals(struct asan_global *globals, size_t size); |