From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
Ingo Molnar <mingo@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe
Date: Wed, 27 Jul 2016 23:52:33 -0400 [thread overview]
Message-ID: <20160727235233.6d64628b@grimm.local.home> (raw)
In-Reply-To: <CA+55aFy+MbU62-x7n27YRyxNG0Kkw1MKWViyAo_xqdpVAOKvAQ@mail.gmail.com>
On Wed, 27 Jul 2016 20:21:50 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Wed, Jul 27, 2016 at 6:58 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > On Wed, 27 Jul 2016 16:00:54 -0700
> > Linus Torvalds <torvalds@linux-foundation.org> wrote:
> >>
> >> I can just add a
> >>
> >> KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
> >
> > I like this solution.
>
> Ok. Pushed out. As long as people are aware of this, and are hopefully
> at least looking for potential alternatives, it's fine.
I just looked at your patch. Would this work if you moved that
KBUILD_CFLAGS to the tracing directory? Something like the below (never
compiled or tested).
This way we still get warnings from other users.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
diff --git a/Makefile b/Makefile
index 393b615..d384848 100644
--- a/Makefile
+++ b/Makefile
@@ -620,7 +620,6 @@ include arch/$(SRCARCH)/Makefile
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
-KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 979e7bf..48079dd 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -1,4 +1,7 @@
+# We are fully aware of the dangers of __builtin_return_address() > 0
+KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
+
# Do not instrument the tracer itself:
ifdef CONFIG_FUNCTION_TRACER
next prev parent reply other threads:[~2016-07-28 3:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-27 23:00 Linus Torvalds
2016-07-28 1:58 ` Steven Rostedt
2016-07-28 3:21 ` Linus Torvalds
2016-07-28 3:52 ` Steven Rostedt [this message]
2016-07-29 1:25 ` Linus Torvalds
2016-07-29 2:30 ` Steven Rostedt
2016-08-01 18:10 ` Steven Rostedt
2016-08-01 18:19 ` Linus Torvalds
2016-07-28 12:42 ` Josh Poimboeuf
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=20160727235233.6d64628b@grimm.local.home \
--to=rostedt@goodmis.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®