aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/trace/ftrace.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index a05524fa245d..f64fbaae781a 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -648,6 +648,9 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
648 * char raw_data[__entry_size]; <- allocate our sample in the stack 648 * char raw_data[__entry_size]; <- allocate our sample in the stack
649 * struct trace_entry *ent; 649 * struct trace_entry *ent;
650 * 650 *
651 * zero dead bytes from alignment to avoid stack leak to userspace:
652 *
653 * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL;
651 * entry = (struct ftrace_raw_<call> *)raw_data; 654 * entry = (struct ftrace_raw_<call> *)raw_data;
652 * ent = &entry->ent; 655 * ent = &entry->ent;
653 * tracing_generic_entry_update(ent, irq_flags, pc); 656 * tracing_generic_entry_update(ent, irq_flags, pc);
@@ -698,6 +701,7 @@ static void ftrace_profile_##call(proto) \
698 char raw_data[__entry_size]; \ 701 char raw_data[__entry_size]; \
699 struct trace_entry *ent; \ 702 struct trace_entry *ent; \
700 \ 703 \
704 *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \
701 entry = (struct ftrace_raw_##call *)raw_data; \ 705 entry = (struct ftrace_raw_##call *)raw_data; \
702 ent = &entry->ent; \ 706 ent = &entry->ent; \
703 tracing_generic_entry_update(ent, irq_flags, pc); \ 707 tracing_generic_entry_update(ent, irq_flags, pc); \