[PATCH] D139254: Enhance stack protector

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 03:21:18 PST 2023


smeenai added a comment.

In D139254#4030325 <https://reviews.llvm.org/D139254#4030325>, @xiangzhangllvm wrote:

> In D139254#4029517 <https://reviews.llvm.org/D139254#4029517>, @smeenai wrote:
>
>> Would there be any objections to adding a flag to restore the previous behavior? This is a fairly hefty size increase for us, and we don't think the additional checking is worth the size increase in our case. We also intend to look into the size increases more to determine how much is from guarding calls to e.g. `__cxa_throw`, where you will reuse the stack frame, vs. calls to e.g. `abort` or `_Unwind_Resume`, where the stack frame should never be reused and checking the stack cookie doesn't seem worthwhile (if my logic is sound, which I'm not 100% sure of).
>
> I agree to add a option to go in previous behavior. (e.g  -fstack-protector-weak or -fstack-protector-return)
> But this enhance for no-return function is necessary for a security. We meet such cases in user code. That is why I did it.

Yup, I'm not at all doubting the value of this work :) Adding the option will just let everyone make the appropriate trade-off between size and security for their use cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139254/new/

https://reviews.llvm.org/D139254



More information about the llvm-commits mailing list