--- Comment #23 from Martin Liška <marxin at gcc dot> ---
> 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

Reply via email to