History

Merge tag 'trace-v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt: "A few updates and fixes: - move the suppressing of the __builtin_return_address >0 warning to the tracing directory only. - metag recordmcount fix for newer glibc's - two tracing histogram fixes that were reported by KASAN" * tag 'trace-v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix use-after-free in hist_register_trigger() tracing: Fix use-after-free in hist_unreg_all/hist_enable_unreg_all Makefile: Mute warning for __builtin_return_address(>0) for tracing only ftrace/recordmcount: Work around for addition of metag magic but not relocations

Linus Torvalds committed 10 years ago

Commit bf0f5002 parents 4b2e016 7522c034 files · +19 −9Browse files

Unified · Split

4 files
  1. Makefile +0 −1
  2. kernel/trace/Makefile +4 −0
  3. kernel/trace/trace_events_hist.c +7 −7
  4. scripts/recordmcount.c +8 −1
Makefile+0−1
@@ -621,7 +621,6 @@ include arch/$(SRCARCH)/Makefile · 620 unmodified lines
621 621
622KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)622KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
623KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)623KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
624KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
625 624
626ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE625ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
627KBUILD_CFLAGS += -Os626KBUILD_CFLAGS += -Os
kernel/trace/Makefile+4−0
@@ -1,4 +1,8 @@
1 1
2# We are fully aware of the dangers of __builtin_return_address()
3FRAME_CFLAGS := $(call cc-disable-warning,frame-address)
4KBUILD_CFLAGS += $(FRAME_CFLAGS)
5
2# Do not instrument the tracer itself:6# Do not instrument the tracer itself:
3 7
4ifdef CONFIG_FUNCTION_TRACER8ifdef CONFIG_FUNCTION_TRACER
kernel/trace/trace_events_hist.c+7−7
@@ -1441,6 +1441,9 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, · 1440 unmodified lines
1441 goto out;1441 goto out;
1442 }1442 }
1443 1443
1444 if (hist_data->attrs->pause)
1445 data->paused = true;
1446
1444 if (named_data) {1447 if (named_data) {
1445 destroy_hist_data(data->private_data);1448 destroy_hist_data(data->private_data);
1446 data->private_data = named_data->private_data;1449 data->private_data = named_data->private_data;
@@ -1448,9 +1451,6 @@ static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, · 1 unmodified line
1448 data->ops = &event_hist_trigger_named_ops;1451 data->ops = &event_hist_trigger_named_ops;
1449 }1452 }
1450 1453
1451 if (hist_data->attrs->pause)
1452 data->paused = true;
1453
1454 if (data->ops->init) {1454 if (data->ops->init) {
1455 ret = data->ops->init(data->ops, data);1455 ret = data->ops->init(data->ops, data);
1456 if (ret < 0)1456 if (ret < 0)
@@ -1500,9 +1500,9 @@ static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, · 43 unmodified lines
1500 1500
1501static void hist_unreg_all(struct trace_event_file *file)1501static void hist_unreg_all(struct trace_event_file *file)
1502{1502{
1503 struct event_trigger_data *test;1503 struct event_trigger_data *test, *n;
1504 1504
1505 list_for_each_entry_rcu(test, &file->triggers, list) {1505 list_for_each_entry_safe(test, n, &file->triggers, list) {
1506 if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) {1506 if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) {
1507 list_del_rcu(&test->list);1507 list_del_rcu(&test->list);
1508 trace_event_trigger_enable_disable(file, 0);1508 trace_event_trigger_enable_disable(file, 0);
@@ -1699,9 +1699,9 @@ hist_enable_get_trigger_ops(char *cmd, char *param) · 190 unmodified lines
1699 1699
1700static void hist_enable_unreg_all(struct trace_event_file *file)1700static void hist_enable_unreg_all(struct trace_event_file *file)
1701{1701{
1702 struct event_trigger_data *test;1702 struct event_trigger_data *test, *n;
1703 1703
1704 list_for_each_entry_rcu(test, &file->triggers, list) {1704 list_for_each_entry_safe(test, n, &file->triggers, list) {
1705 if (test->cmd_ops->trigger_type == ETT_HIST_ENABLE) {1705 if (test->cmd_ops->trigger_type == ETT_HIST_ENABLE) {
1706 list_del_rcu(&test->list);1706 list_del_rcu(&test->list);
1707 update_cond_flag(file);1707 update_cond_flag(file);
scripts/recordmcount.c+8−1
@@ -33,10 +33,17 @@ · 32 unmodified lines
33#include <string.h>33#include <string.h>
34#include <unistd.h>34#include <unistd.h>
35 35
36/*
37 * glibc synced up and added the metag number but didn't add the relocations.
38 * Work around this in a crude manner for now.
39 */
36#ifndef EM_METAG40#ifndef EM_METAG
37/* Remove this when these make it to the standard system elf.h. */
38#define EM_METAG 17441#define EM_METAG 174
42#endif
43#ifndef R_METAG_ADDR32
39#define R_METAG_ADDR32 244#define R_METAG_ADDR32 2
45#endif
46#ifndef R_METAG_NONE
40#define R_METAG_NONE 347#define R_METAG_NONE 3
41#endif48#endif
42 49