[Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 25 10:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
--- Comment #31 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Arnd Bergmann from comment #30)
> (In reply to Martin Liška from comment #29)
> > I'm got a patch candidate for which I did testing of allmodconfig
> > configuration.
> > Sorting all violations against 2KB of stack memory:
> >
> > Before:
> > TOTAL warnings: 185
> >
> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:5653:1: 23624
> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:4518:1: 14144
> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:3882:1: 11504
> > lib/atomic64_test.c:250:1: 11192
> > lib/atomic64_test.c:148:1: 10352
>
> This is with -fsanitize-address-use-after-scope, right?
Yes.
>
> > after:
> >
> > TOTAL warnings: 43
> >
> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:5653:1: 11880
> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:4518:1: 7264
> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:3882:1: 5840
> > lib/atomic64_test.c:250:1: 5656
> > lib/atomic64_test.c:148:1: 5232
> >
> > Which is very promising improvement I would say.
>
> Agreed, this looks great. With most of the warnings against the
> 2048 byte limit gone, we can probably work around the remaining
> ones by doing local code changes in the kernel. I had patches for
> some of these in the past, which I can dig up then.
Just out of curiosity. Am I right that you're using KASAN build for
syzkaller or an other fuzzer? If so, I bet you can't hit most of the
stack overflows in drivers as you very probably don't have the
real hardware?
More information about the Gcc-bugs
mailing list