From 8b45d9c9178e2e1f3f09f93e761fda1c7ddcbac0 Mon Sep 17 00:00:00 2001 From: Oskar Wirga Date: Thu, 18 Jan 2024 18:53:51 -0800 Subject: [PATCH] Add dynamic_fn_ptr attribute to dynamic fn ptrs in M4A Summary: This list was generated using warnings logged to the console as part of D51514310. The warnings were then manually assessed as to whether they were true positives or false positives using either "dynamic_fn_ptr" or "ignore_dlsym" annotations. I repeated this process and compiled M4A until there were no warnings logged to the console. For files that touch open source or are just generally a pain to deal with, I left them ignorelisted as they really didn't seem to contain other function pointers we should be protecting. Reviewed By: sampriti-fb Differential Revision: D52634681 fbshipit-source-id: 73c3c84a44d1289a617d0721d8512854dc530848 --- cxx/lyra/cxa_throw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cxx/lyra/cxa_throw.cpp b/cxx/lyra/cxa_throw.cpp index ce09761..651947e 100644 --- a/cxx/lyra/cxa_throw.cpp +++ b/cxx/lyra/cxa_throw.cpp @@ -50,7 +50,7 @@ void enableCxaThrowHookBacktraces(bool enable) { enableBacktraces.store(enable, std::memory_order_relaxed); } -[[gnu::noreturn]] void ( +[[gnu::noreturn]] __attribute__((annotate("dynamic_fn_ptr"))) void ( *original_cxa_throw)(void*, const std::type_info*, void (*)(void*)); #if defined(_LIBCPP_VERSION)