[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2023-07-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Richard Biener changed: What|Removed |Added Target Milestone|10.5|---

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2023-05-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #36 from CVS Commits --- The master branch has been updated by Andreas Schwab : https://gcc.gnu.org/g:456cf52c0d35bdf66f5d86cce45a6af49a9ce1d8 commit r14-1399-g456cf52c0d35bdf66f5d86cce45a6af49a9ce1d8 Author: Andreas Schwab Date:

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2022-06-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Jakub Jelinek changed: What|Removed |Added Target Milestone|10.4|10.5 --- Comment #35 from Jakub Jelinek

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2021-04-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Richard Biener changed: What|Removed |Added Target Milestone|10.3|10.4 --- Comment #34 from Richard

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2020-07-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Richard Biener changed: What|Removed |Added Target Milestone|10.2|10.3 --- Comment #33 from Richard

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2020-05-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Jakub Jelinek changed: What|Removed |Added Target Milestone|10.0|10.2 --- Comment #32 from Jakub Jelinek

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-04-03 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #31 from Andrey Drobyshev --- (In reply to Jakub Jelinek from comment #30) > in a couple of most common data sections In which sections exactly? If we cover only the most common ones (thus leaving other sections which might need

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #30 from Jakub Jelinek --- (In reply to Andrey Drobyshev from comment #26) > > I would like to ask, has the idea of adding an artificial object linked with > > -fsanitize=address early on the link line which would register artificial

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-21 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #29 from Andrey Drobyshev --- (In reply to Segher Boessenkool from comment #28) > Patches should go to gcc-patches@. That is where reviews happen, too. That's still a patch candidate. I want to hear other folks' opinion before it

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-21 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #28 from Segher Boessenkool --- Patches should go to gcc-patches@. That is where reviews happen, too.

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-21 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Andrey Drobyshev changed: What|Removed |Added Attachment #45751|0 |1 is obsolete|

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-18 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #26 from Andrey Drobyshev --- (In reply to Jakub Jelinek from comment #24) > (In reply to Martin Liška from comment #23) > > (In reply to Andrey Drobyshev from comment #22) > > > Created attachment 45851 [details] > > >

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-18 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #25 from Andrey Drobyshev --- (In reply to Martin Liška from comment #23) > (In reply to Andrey Drobyshev from comment #22) > > Created attachment 45851 [details] > > Work-in-progress fix considering relocations > > > > I'm a bit

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #24 from Jakub Jelinek --- (In reply to Martin Liška from comment #23) > (In reply to Andrey Drobyshev from comment #22) > > Created attachment 45851 [details] > > Work-in-progress fix considering relocations > > > > I'm a bit

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-03-01 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #23 from Martin Liška --- (In reply to Andrey Drobyshev from comment #22) > Created attachment 45851 [details] > Work-in-progress fix considering relocations > > I'm a bit stuck. I managed to precompute reloc value for the globals

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-28 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #22 from Andrey Drobyshev --- Created attachment 45851 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45851=edit Work-in-progress fix considering relocations I'm a bit stuck. I managed to precompute reloc value for the globals

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-26 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #21 from Martin Liška --- Thanks for the test-case. > > So I guess we still have to detect relocations. I cannot see limitations > coming particularly from approach #2 from > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501#c1.

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-26 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #20 from Martin Liška --- (In reply to Andrey Drobyshev from comment #18) > (In reply to Martin Liška from comment #16) > > Created attachment 45797 [details] > > Patch candidate > > > > Patch candidate where I made some refactoring

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-25 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #19 from Andrey Drobyshev --- (In reply to Martin Liška from comment #17) > > 2. What should we do with sections like .data.rel.ro, .data.rel.ro.local? > > They suffer from this bug too, but it's not that easy to put globals there, >

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-25 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #18 from Andrey Drobyshev --- (In reply to Martin Liška from comment #16) > Created attachment 45797 [details] > Patch candidate > > Patch candidate where I made some refactoring and come up with tests. > Works fine on x86_64, on

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-22 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #17 from Martin Liška --- > 2. What should we do with sections like .data.rel.ro, .data.rel.ro.local? > They suffer from this bug too, but it's not that easy to put globals there, > as you must set various attributes onto decl to

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-22 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #16 from Martin Liška --- Created attachment 45797 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45797=edit Patch candidate Patch candidate where I made some refactoring and come up with tests. Works fine on x86_64, on

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-22 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #15 from Martin Liška --- (In reply to Franz Sirl from comment #3) > Created attachment 43650 [details] > another testcase > > On x86_64-linux, when compiled with "gcc-7 -O2 -fsanitize=address" this > testcase prints nothing. With

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-21 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #14 from Andrey Drobyshev --- (In reply to Martin Liška from comment #12) > However: > g++-8 -fsanitize=address global4.c -fno-common && ./a.out > = > ==12713==ERROR:

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #13 from Martin Liška --- Not true for: $ cat global5.c const char c1[] = "a"; int main() { return *([0]+3); } $ gcc-8 -fsanitize=address global5.c -fno-common && ./a.out

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #12 from Martin Liška --- While playing with the patch I noticed that there's a significant different in between GCC 7 and GCC8: $ cat global4.c int f; int main() { return *(+1); } $ g++-7 -fsanitize=address global4.c

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-18 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #11 from Andrey Drobyshev --- (In reply to Martin Liška from comment #9) > (In reply to Andrey Drobyshev from comment #8) > > Great you've been working on that Andrey. > > > I recently started to work on this issue as well. I

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-18 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #10 from Andrey Drobyshev --- Created attachment 45751 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45751=edit Work-in-progress fix This patch is pretty raw. It only handles .data, .rodata and .bss. It does not handle

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-02-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #9 from Martin Liška --- (In reply to Andrey Drobyshev from comment #8) Great you've been working on that Andrey. > I recently started to work on this issue as well. I managed to put a dummy > global variable into .data, .rodata

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2019-01-29 Thread a.drobyshev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Andrey Drobyshev changed: What|Removed |Added CC||a.drobyshev at samsung dot com ---

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2018-11-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Martin Liška changed: What|Removed |Added Target Milestone|9.0 |10.0

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2018-09-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #7 from Martin Liška --- I started working on this, but it's not easy to register dummy global variables. If I see correctly, global vars are emitted into assembly here: #0 assemble_variable (decl=, top_level=0, at_end=1,

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2018-04-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #6 from Martin Liška --- (In reply to Jakub Jelinek from comment #1) > As discussed on IRC, with current libasan __asan_register_globals, we have 2 > options: > 1) add an object that we link early with -fsanitize=address that

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2018-04-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Martin Liška changed: What|Removed |Added CC||segher at gcc dot gnu.org --- Comment #5

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2018-04-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #4 from Martin Liška --- Small note: on powerpc sanitization does not work for last global variable: volatile int v; __attribute__((noipa)) void foo (char *p, char *q) { *p = 123; // v = p > q; } char __attribute__((used))

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2018-03-14 Thread sirl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Franz Sirl changed: What|Removed |Added CC||sirl at gcc dot gnu.org --- Comment #3

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

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

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2017-10-16 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 Martin Liška changed: What|Removed |Added URL||https://github.com/google/s

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

2017-10-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501 --- Comment #1 from Jakub Jelinek --- As discussed on IRC, with current libasan __asan_register_globals, we have 2 options: 1) add an object that we link early with -fsanitize=address that contains zero sized variables with following redzone

[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable

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