Enable/optimize AddressSanitizer function on RISC-V architecture. The major work is to port AddressSanitizer to RISC-V architecture both in GCC and LLVM, both for RV32 and RV64, both from pure software and hardware-software co-design.
The tool consists of a compiler instrumentation module which works as an LLVM pass and a run-time library which replaces the malloc function.
The instrumentation module is maintained in LLVM backend. (llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp)
The run-time libraries tailored for AddressSanitizer can be found in compiler-rt/lib/asan and compiler-rt/lib/sanitizer_common.
The instrumentation module is maintained in GCC backend.
(gcc/asan.c; gcc/config/riscv/riscv.c)
There are no individually developed run-time libraries for gcc. All the codes in libsanitzier/asan are merged from compiler-rt/lib/asan. So is sanitizer_common.
Compare to ARM, RISC-V developer can get a fully functional and efficient AddressSanitizer tool to find the bug in the application. There are three milestones for the project.
|
Replace malloc with Scudo in glibc, similar with what bionic does
Enable RISCV memory tagging for malloc in glibc
Enable AddressSanitizer for RISCV32 in GCC and LLVM. (develop completed, upstreaming)- depend on the timeline of 32bit linux kernel
Enable Scudo for RISCV64 in LLVM on both clang side and compiler-rt side.