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

2018-11-30 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 Martin Liška changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

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

2018-11-30 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #35 from Martin Liška --- Author: marxin Date: Fri Nov 30 14:25:15 2018 New Revision: 24 URL: https://gcc.gnu.org/viewcvs?rev=24=gcc=rev Log: Make red zone size more flexible for stack variables (PR sanitizer/81715).

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

2018-09-26 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #34 from Martin Liška --- For the next version of the patch: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01529.html I seen even better results: TOTAL warnings: 23

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

2018-09-25 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #33 from Martin Liška --- (In reply to Arnd Bergmann from comment #32) > (In reply to Martin Liška from comment #31) > > (In reply to Arnd Bergmann from comment #30) > > > (In reply to Martin Liška from comment #29) > > > > Which is

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

2018-09-25 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #32 from Arnd Bergmann --- (In reply to Martin Liška from comment #31) > (In reply to Arnd Bergmann from comment #30) > > (In reply to Martin Liška from comment #29) > > > Which is very promising improvement I would say. > > > >

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

2018-09-25 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #31 from Martin Liška --- (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

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

2018-09-25 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #30 from Arnd Bergmann --- (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

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

2018-09-25 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #29 from Martin Liška --- 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

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

2018-02-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #28 from Martin Liška --- (In reply to Martin Liška from comment #27) > Let me decrypt how clang generates the red zones. I can probably quickly > come up with a patch that will do the dynamic red zone size allocation. > Having that

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

2018-02-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 Martin Liška changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

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

2018-02-20 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #26 from Arnd Bergmann --- (In reply to Martin Liška from comment #25) > (In reply to Arnd Bergmann from comment #24) > > Ok, I don't have problem to implement the similar behavior in GCC 9. Looks > most > of warnings are in

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

2018-02-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #25 from Martin Liška --- (In reply to Arnd Bergmann from comment #24) > (In reply to Martin Liška from comment #23) > > > That's definitely possible for GCC 9. Question is whether such change will > > be sufficient for you. Do you

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

2018-02-20 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #24 from Arnd Bergmann --- (In reply to Martin Liška from comment #23) > 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

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

2018-02-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #23 from Martin Liška --- > 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

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

2018-02-19 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #22 from Arnd Bergmann --- (In reply to Jakub Jelinek from comment #20) > I haven't heard any answer to #c16 whether it actually helped the kernel or > not. Sorry about that. Yes, it definitely helped the kernel a lot. At this

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

2018-02-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 Martin Liška changed: What|Removed |Added Assignee|marxin at gcc dot gnu.org |unassigned at gcc dot gnu.org

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

2018-02-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #20 from Jakub Jelinek --- I haven't heard any answer to #c16 whether it actually helped the kernel or not.

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

2018-02-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #19 from Martin Liška --- As it's fixed on GCC-7 and currect trunk, can we Jakub close that?

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

2018-01-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #18 from Jakub Jelinek --- Author: jakub Date: Thu Jan 18 20:30:33 2018 New Revision: 256861 URL: https://gcc.gnu.org/viewcvs?rev=256861=gcc=rev Log: PR sanitizer/81715 PR testsuite/83882 * function.h

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

2017-10-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #17 from Jakub Jelinek --- Author: jakub Date: Fri Oct 27 20:33:35 2017 New Revision: 254179 URL: https://gcc.gnu.org/viewcvs?rev=254179=gcc=rev Log: Backported from mainline 2017-09-21 Jakub Jelinek

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

2017-10-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #16 from Jakub Jelinek --- Did this change help? Would it be beneficial to backport to 7.x or even 6.x? As is it is certainly too dangerous, but wonder about additionally guarding the 3 hunks either with (flag_sanitize &

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

2017-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #15 from Jakub Jelinek --- Author: jakub Date: Thu Sep 21 12:26:34 2017 New Revision: 253065 URL: https://gcc.gnu.org/viewcvs?rev=253065=gcc=rev Log: PR sanitizer/81715 * tree-inline.c (expand_call_inline): Emit

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

2017-09-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #14 from Jakub Jelinek --- Note the patch failed bootstrap, but just the first hunk from it passed bootstrap and is being regtested right now. I'll need to debug what's wrong with the retval clobbers tomorrow.

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

2017-09-20 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #13 from Arnd Bergmann --- Tested the fix with an x86 allmodconfig kernel (linux-next, with -fsanitize-address-use-after-scope disabled manually). With an arbitrary limit of 1500 bytes (the default is no limit when

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

2017-09-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #12 from Jakub Jelinek --- Created attachment 42212 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42212=edit gcc8-pr81715.patch Untested fix.

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

2017-09-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #11 from Jakub Jelinek --- (In reply to Arnd Bergmann from comment #10) > As far as I can tell, gcc doesn't merge stack slots that came from inline > functions, as in comment 1, or this example: > > void baz (int *, int *, int *,

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

2017-09-20 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #10 from Arnd Bergmann --- As far as I can tell, gcc doesn't merge stack slots that came from inline functions, as in comment 1, or this example: void baz (int *, int *, int *, int *, int *, int *); static inline void foo (int a,

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

2017-09-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #9 from Jakub Jelinek --- Unless -fsanitize-user-after-scope (default for -fsanitize=address, but not for -fsanitize=kernel-address), GCC does reuse stack slots. Just try say: void foo (int *, int *, int *, int *, int *, int *);

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

2017-09-20 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #8 from Arnd Bergmann --- (In reply to Martin Liška from comment #7) > Ok, I'm quite opened for changes that will make smaller red zones for > smaller variables. However, in case of sanitization-aware inlining, it's > probably too

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

2017-09-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #7 from Martin Liška --- Ok, I'm quite opened for changes that will make smaller red zones for smaller variables. However, in case of sanitization-aware inlining, it's probably too complicated and I would rather use no_inline

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

2017-09-19 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #6 from Arnd Bergmann --- (In reply to Martin Liška from comment #5) > I can confirm that for the biggest function 'nl80211_send_wiphy', it really > contains majority of stack variables which are 4B large. Having an adaptive >

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

2017-09-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 Martin Liška changed: What|Removed |Added Status|WAITING |NEW --- Comment #5 from Martin Liška

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

2017-09-18 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #4 from Arnd Bergmann --- Created attachment 42195 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42195=edit preprocessed net/wireless/nl80211.c, compressed This is another file that shows the problem, in fact we hit this with

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

2017-09-15 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #3 from Arnd Bergmann --- (In reply to Arnd Bergmann from comment #2) > Created attachment 42178 [details] > preprocessed linux/drivers/media/dvb-frontends/stv090x.c, compressed > > This is one of the typical files showing the

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

2017-09-15 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 --- Comment #2 from Arnd Bergmann --- Created attachment 42178 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42178=edit preprocessed linux/drivers/media/dvb-frontends/stv090x.c, compressed This is one of the typical files showing the

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

2017-09-15 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed|