[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160727235233.6d64628b@grimm.local.home>
Date: Wed, 27 Jul 2016 23:52:33 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe
On Wed, 27 Jul 2016 20:21:50 -0700
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Wed, Jul 27, 2016 at 6:58 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
> > On Wed, 27 Jul 2016 16:00:54 -0700
> > Linus Torvalds <torvalds@...ux-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@...dmis.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
Powered by blists - more mailing lists