* Patch "Disable "frame-address" warning" has been added to the 4.4-stable tree
@ 2016-09-26 9:47 gregkh
0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2016-09-26 9:47 UTC (permalink / raw)
To: torvalds, gregkh, rostedt; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
Disable "frame-address" warning
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
disable-frame-address-warning.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 124a3d88fa20e1869fc229d7d8c740cc81944264 Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed, 27 Jul 2016 19:03:04 -0700
Subject: Disable "frame-address" warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Linus Torvalds <torvalds@linux-foundation.org>
commit 124a3d88fa20e1869fc229d7d8c740cc81944264 upstream.
Newer versions of gcc warn about the use of __builtin_return_address()
with a non-zero argument when "-Wall" is specified:
kernel/trace/trace_irqsoff.c: In function ‘stop_critical_timings’:
kernel/trace/trace_irqsoff.c:433:86: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Wframe-address]
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
[ .. repeats a few times for other similar cases .. ]
It is true that a non-zero argument is somewhat dangerous, and we do not
actually have very many uses of that in the kernel - but the ftrace code
does use it, and as Stephen Rostedt says:
"We are well aware of the danger of using __builtin_return_address() of
> 0. In fact that's part of the reason for having the "thunk" code in
x86 (See arch/x86/entry/thunk_{64,32}.S). [..] it adds extra frames
when tracking irqs off sections, to prevent __builtin_return_address()
from accessing bad areas. In fact the thunk_32.S states: 'Trampoline to
trace irqs off. (otherwise CALLER_ADDR1 might crash)'."
For now, __builtin_return_address() with a non-zero argument is the best
we can do, and the warning is not helpful and can end up making people
miss other warnings for real problems.
So disable the frame-address warning on compilers that need it.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
--- a/Makefile
+++ b/Makefile
@@ -617,6 +617,7 @@ 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
Patches currently in stable-queue which might be from torvalds@linux-foundation.org are
queue-4.4/disable-maybe-uninitialized-warning-globally.patch
queue-4.4/include-linux-kernel.h-change-abs-macro-so-it-uses-consistent-return-type.patch
queue-4.4/makefile-mute-warning-for-__builtin_return_address-0-for-tracing-only.patch
queue-4.4/add-braces-to-avoid-ambiguous-else-compiler-warnings.patch
queue-4.4/ocfs2-fix-start-offset-to-ocfs2_zero_range_for_truncate.patch
queue-4.4/tools-support-relative-directory-path-for-o.patch
queue-4.4/disable-frame-address-warning.patch
queue-4.4/ocfs2-dlm-fix-race-between-convert-and-migration.patch
queue-4.4/reiserfs-fix-new_insert_key-may-be-used-uninitialized.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Patch "Disable "frame-address" warning" has been added to the 4.4-stable tree
@ 2016-11-09 10:08 gregkh
0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2016-11-09 10:08 UTC (permalink / raw)
To: torvalds, gregkh, rostedt; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
Disable "frame-address" warning
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
disable-frame-address-warning.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 124a3d88fa20e1869fc229d7d8c740cc81944264 Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed, 27 Jul 2016 19:03:04 -0700
Subject: Disable "frame-address" warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Linus Torvalds <torvalds@linux-foundation.org>
commit 124a3d88fa20e1869fc229d7d8c740cc81944264 upstream.
Newer versions of gcc warn about the use of __builtin_return_address()
with a non-zero argument when "-Wall" is specified:
kernel/trace/trace_irqsoff.c: In function ‘stop_critical_timings’:
kernel/trace/trace_irqsoff.c:433:86: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Wframe-address]
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
[ .. repeats a few times for other similar cases .. ]
It is true that a non-zero argument is somewhat dangerous, and we do not
actually have very many uses of that in the kernel - but the ftrace code
does use it, and as Stephen Rostedt says:
"We are well aware of the danger of using __builtin_return_address() of
> 0. In fact that's part of the reason for having the "thunk" code in
x86 (See arch/x86/entry/thunk_{64,32}.S). [..] it adds extra frames
when tracking irqs off sections, to prevent __builtin_return_address()
from accessing bad areas. In fact the thunk_32.S states: 'Trampoline to
trace irqs off. (otherwise CALLER_ADDR1 might crash)'."
For now, __builtin_return_address() with a non-zero argument is the best
we can do, and the warning is not helpful and can end up making people
miss other warnings for real problems.
So disable the frame-address warning on compilers that need it.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
--- a/Makefile
+++ b/Makefile
@@ -617,6 +617,7 @@ 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
Patches currently in stable-queue which might be from torvalds@linux-foundation.org are
queue-4.4/mm-list_lru.c-avoid-error-path-null-pointer-deref.patch
queue-4.4/mm-memcontrol-do-not-recurse-in-direct-reclaim.patch
queue-4.4/disable-frame-address-warning.patch
queue-4.4/x86-xen-fix-upper-bound-of-pmd-loop-in-xen_cleanhighmap.patch
queue-4.4/mm-cma-silence-warnings-due-to-max-usage.patch
queue-4.4/h8300-fix-syscall-restarting.patch
queue-4.4/fix-potential-infoleak-in-older-kernels.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-09 10:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09 10:08 Patch "Disable "frame-address" warning" has been added to the 4.4-stable tree gregkh
-- strict thread matches above, loose matches on Subject: below --
2016-09-26 9:47 gregkh
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 NNTP newsgroup(s).