[Bug sanitizer/85230] asan: false positives in kernel on allocas

2021-12-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 Andrew Pinski changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #22 from Jakub Jelinek --- Author: jakub Date: Tue Apr 17 20:22:50 2018 New Revision: 259446 URL: https://gcc.gnu.org/viewcvs?rev=259446&root=gcc&view=rev Log: PR sanitizer/85230 * asan.c (handle_builtin_stack_restore

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-13 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #21 from Dmitry Vyukov --- I guess it just used my system binutils. Used to work before. I now used an older distribution to build it. Seems to work.

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #20 from Jakub Jelinek --- Are you configuring gcc against binutils 2.30+ and then assembling stuff with older binutils? You can always use -gno-as-locview-support even in that case, but the general assumption is if you configure agai

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #19 from Dmitry Vyukov --- When I am trying to build anything with -g on a machine with binutils 2.26.1 I am getting: /tmp/ccTFsPnM.s: Assembler messages: /tmp/ccTFsPnM.s:11: Error: unknown .loc sub-directive `view' /tmp/ccTFsPnM.s:1

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #18 from Jakub Jelinek --- I will, once I bootstrap/regtest it fully on a couple of targets.

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread chefmax at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #17 from chefmax at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #15) > (In reply to chefmax from comment #14) > > (In reply to Jakub Jelinek from comment #13) > > > or introduce a new virtual pseudo register that vregs

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #16 from Dmitry Vyukov --- Here is disasm of the function with the patch: https://gist.githubusercontent.com/dvyukov/e9dca961ceb436049cf5881b3307b104/raw/05ed3daff60d00eb71ca7a85be707d6d5eca3c47/gistfile1.txt And the epilogue:

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #15 from Jakub Jelinek --- (In reply to chefmax from comment #14) > (In reply to Jakub Jelinek from comment #13) > > or introduce a new virtual pseudo register that vregs pass would map > > directly to dynamic_offset. > > Yeah, that

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread chefmax at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #14 from chefmax at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #13) > or introduce a new virtual pseudo register that vregs pass would map directly > to dynamic_offset. Yeah, that's what I though about (LLVM does pre

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #13 from Jakub Jelinek --- Created attachment 43919 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43919&action=edit gcc8-pr85230.patch So, if you want to add STACK_DYNAMIC_OFFSET to new_sp for the second argument, then we coul

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #12 from Dmitry Vyukov --- When/if you have a patch I can test it on kernel. But seems this is a problem for user-space too. We just need a large alloca + signal handlers, or dirty manual SP manipulations (like we have in tsan to imp

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread chefmax at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #11 from chefmax at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #10) > Unfortunately that doesn't work, because the second argument to > __asan_allocas_unpoison is incorrect then. Unfortunately we can't use new_sp as a

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #10 from Jakub Jelinek --- Unfortunately that doesn't work, because the second argument to __asan_allocas_unpoison is incorrect then.

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #9 from Jakub Jelinek --- So (completely untested): --- gcc/asan.c.jj 2018-01-09 21:53:38.821577722 +0100 +++ gcc/asan.c 2018-04-12 12:30:43.360840432 +0200 @@ -554,14 +554,14 @@ get_last_alloca_addr () return last_alloca_ad

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-11 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #8 from Dmitry Vyukov --- Depending on how long the proper fix will take. If we are talking about, say, a week then I will just wait. We have to deal with hundreds of assorted kernel crashes all over the place anyway.

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-11 Thread chefmax at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #7 from chefmax at gcc dot gnu.org --- (In reply to Dmitry Vyukov from comment #6) > Right! > > Unpoisoning before restoring SP looks like a reasonable and simple solution > to me. I don't see any potential downsides. > > Do you mind

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-10 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #6 from Dmitry Vyukov --- Right! Unpoisoning before restoring SP looks like a reasonable and simple solution to me. I don't see any potential downsides. Do you mind submitting a fix for this? Thanks

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-10 Thread chefmax at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 chefmax at gcc dot gnu.org changed: What|Removed |Added CC||chefmax at gcc dot gnu.org -

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-05 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #4 from Dmitry Vyukov --- Removing these lines from runtime does not help unfortunately: - kasan_poison_shadow(left_redzone, KASAN_ALLOCA_REDZONE_SIZE, - KASAN_ALLOCA_LEFT); The right redzone is also someho

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-05 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #3 from Dmitry Vyukov --- Hummm, perhaps gcc expects that the left ASAN redzone will be within the 128-byte ABI redzone, but this becomes false with -mno-red-zone?

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-05 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #2 from Dmitry Vyukov --- The runtime callbacks look correct to me, and the shadow they produce also looks reasonable: 32-byte rezone before, 32 + (32 - object size) redzone after: 8800247b7180: 00 00 00 00 00 00 00 00 00 00 00

[Bug sanitizer/85230] asan: false positives in kernel on allocas

2018-04-05 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85230 --- Comment #1 from Dmitry Vyukov --- I am also looking at kernel callback implementation, maybe they disagree with compiler as to what's actually passed as arguments: /* Emitted by compiler to poison alloca()ed objects. */ void __asan_alloca_p