-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-mfunction-return=thunk-extern
does not affect sanitizer constructors
#56514
Labels
Milestone
Comments
@llvm/issue-subscribers-bug |
@nathanchance mentioned that this is a similar problem we've had with PAC/BTI: a88c722. It's not just the sanitizers,
so I should test gcov, too. |
@llvm/issue-subscribers-clang-codegen |
mem-frob
pushed a commit
to draperlaboratory/hope-llvm-project
that referenced
this issue
Oct 7, 2022
Follow up fix to commit 2240d72f15f3 ("[X86] initial -mfunction-return=thunk-extern support") https://reviews.llvm.org/D129572 @nathanchance reported that -mfunction-return=thunk-extern was failing to annotate the asan and tsan contructors. https://lore.kernel.org/llvm/Ys7pLq+tQk5xEa%2FB@dev-arch.thelio-3990X/ I then noticed the same occurring for gcov synthetic functions. Similar to commit 2786e67 ("[IR][sanitizer] Add module flag "frame-pointer" and set it for cc1 -mframe-pointer={non-leaf,all}") define a new module level MetaData, "fn_ret_thunk_extern", then when set adds the fn_ret_thunk_extern IR Fn Attr to synthetically created Functions. Fixes llvm/llvm-project#56514 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D129709
unicornx
pushed a commit
to aosp-riscv/toolchain-llvm-android
that referenced
this issue
Nov 28, 2022
This reverts commit 58201cc. Reason for revert: breaks testing branch and llvm/llvm-project#56514 Change-Id: I43f9249de3a89613311860bd53d83670db74ef7f
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As reported by @nathanchance here, mixing
-mfunction-return=thunk-extern
with various sanitizers is not producing mitigated sanitizer constructor functions.I know exactly what this is; the front-end attributes functions during clang's CodeGen of LLVM IR that they should be fn_ret_thunk_extern. Then LLVM synthesizes new functions without knowledge that new functions should have these attributes. We've seen this before, I think with stack protectors (
nossp
,ssp
, etc).I will fix this, but marking it a blocker for the clang-15 release, and to have something to point to so I can pause ongoing backporting issues related to retbleed for this.
cc @topperc @AaronBallman @kees
The text was updated successfully, but these errors were encountered: