public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/108541] ASAN since GCC 9 missed a stack-buffer-overflow since r9-4503-g6e644a50045f8032 Date: Thu, 16 Mar 2023 14:30:53 +0000 [thread overview] Message-ID: <bug-108541-4-E12yTPzxrE@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108541-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108541 Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |WONTFIX --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- Ok, I've got a reduced test-case: cat pr108541.c struct S { // WORKS: char padding[48]; char padding[49]; }; struct S h, *i; int main() { int *dummy; &dummy; int m = 1; char *ptr = (char *)&m; *(struct S *)(char *)(ptr - 0) = h; return 0; } so the shadow memory looks like this: 0x7ffff5300000: f1 f1 f1 f1 f1 f1 04 f2 00 f3 f3 f3 [48, 52) 'm' (line 12) [64, 72) 'dummy' (line 9) what happens here: during the expansion of .ASAN_CHECK (5, ptr_5, 49, 1); we check for the memory area beginning (that's fine), and than the ending, which is out of the poisoned memory. It's unfortunate that the middle area of the 49B contains a poisoned memory. Closing as won't fix, we can't check every single byte of shadow memory, that would be very slow.
prev parent reply other threads:[~2023-03-16 14:30 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-25 16:41 [Bug sanitizer/108541] New: ASAN since GCC 9 missed a stack-buffer-overflow shaohua.li at inf dot ethz.ch 2023-01-26 9:24 ` [Bug sanitizer/108541] ASAN since GCC 9 missed a stack-buffer-overflow since r9-4503-g6e644a50045f8032 marxin at gcc dot gnu.org 2023-03-16 14:30 ` marxin at gcc dot gnu.org [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108541-4-E12yTPzxrE@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).