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
Showing the changes to kernel (2 of 4 files). Show all
Unified · Split
| @@ -1,4 +1,8 @@ | |||
| 1 | 1 | ||
| 2 | # We are fully aware of the dangers of __builtin_return_address() | ||
| 3 | FRAME_CFLAGS := $(call cc-disable-warning,frame-address) | ||
| 4 | KBUILD_CFLAGS += $(FRAME_CFLAGS) | ||
| 5 | |||
| 2 | # Do not instrument the tracer itself: | 6 | # Do not instrument the tracer itself: |
| 3 | 7 | ||
| 4 | ifdef CONFIG_FUNCTION_TRACER | 8 | ifdef CONFIG_FUNCTION_TRACER |
| @@ -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 | ||
| 1501 | static void hist_unreg_all(struct trace_event_file *file) | 1501 | static 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 | ||
| 1700 | static void hist_enable_unreg_all(struct trace_event_file *file) | 1700 | static 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); |