public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xry111 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/112635] stack smash protection does not work when code is compiled with -O
Date: Thu, 07 Dec 2023 10:58:05 +0000 [thread overview]
Message-ID: <bug-112635-4-qAdeBJkG66@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112635-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112635
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xry111 at gcc dot gnu.org
--- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Agostino Sarubbo from comment #2)
> (In reply to Richard Biener from comment #1)
> > Yep, GCC fixes the code for you by eliding 'buf'. That's perfectly OK though
> > since the code invokes undefined behavior.
> >
> > I'm inclined to close this as INVALID/WONTFIX, it isn't really a bug
> > (but also not a feature you can rely on of course).
>
> Thanks for the response.
>
> So the question is: to have a reliable ssp, do I have to use -O0 ?
The SSP is reliable in this case because there is no stack smashing, as the
stack access has been optimized away. SSP is a hardening feature, not a debug
feature, so it's not designed for finding bugs in the program.
OTOH sanitizers are debugging features, and both ubsan and asan can detect this
bug.
prev parent reply other threads:[~2023-12-07 10:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-20 10:32 [Bug libgcc/112635] New: " ago at gentoo dot org
2023-11-20 10:45 ` [Bug tree-optimization/112635] " rguenth at gcc dot gnu.org
2023-11-20 10:52 ` ago at gentoo dot org
2023-12-07 8:20 ` ago at gentoo dot org
2023-12-07 10:58 ` xry111 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-112635-4-qAdeBJkG66@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: link
Be 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).