From 8e18e41b8c4e51294bb09bb98fbb9b8cf7033651 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 30 Dec 2024 15:28:23 +0900 Subject: [PATCH] RISC-V: Blacklist ffi_call_int for ASan and HWASan build The same dynamic-stack-buffer-overflow issues are reported from riscv64 asan runtime. So, port the commit bdea00c1c77d to riscv also. Ref: https://github.com/libffi/libffi/issues/255 Ref: https://git.tizen.org/cgit/platform/upstream/libffi/commit/?id=bdea00c1c77d Ref: https://git.tizen.org/cgit/platform/upstream/libffi/commit/?id=77df4e341d83 Change-Id: Ib957b2369e6a287a3903d82f6589c26dbecf02ab Signed-off-by: Seung-Woo Kim --- src/riscv/ffi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/riscv/ffi.c b/src/riscv/ffi.c index c910858..798f0aa 100644 --- a/src/riscv/ffi.c +++ b/src/riscv/ffi.c @@ -328,6 +328,9 @@ extern void ffi_call_asm (void *stack, struct call_context *regs, void (*fn) (void), void *closure) FFI_HIDDEN; static void +#if defined(__SANITIZE_ADDRESS__) || defined(__SANITIZE_HWADDRESS__) +__attribute__((__noinline__,__no_sanitize_address__,__no_sanitize_hwaddress__)) +#endif ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, void *closure) { -- 2.34.1