This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715

--- Comment #23 from Martin Liška <marxin at gcc dot gnu.org> ---
> One side issue that is not solved at all by the patch is
> -fsanitize-address-use-after-scope, since that still leads to extreme stack
> usage in the kernel. The problem here is that it forces many local variables
> into separate stack slots even when they could get reused without
> -fsanitize-address-use-after-scope, making it still actively dangerous to
> run kernels built with this option.

Note that's crucial to have separate stack slots to properly catch usage of a
stack variable that's our of scope.

> My workaround in the kernel is now to have that option disabled by default
> and only enabled when users explicitly turn it on. I still think it would be
> nice to address that in the way I originally suggested, by copying the
> behavior that LLVM uses with its variably sized redzone area.

That's definitely possible for GCC 9. Question is whether such change will be
sufficient for you. Do you expect it will reduce stack usage in the desired
way?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]