Commit 575570f0 authored by Shaohua Li's avatar Shaohua Li Committed by Steven Rostedt

tracing: Fix an unallocated memory access in function_graph

With CONFIG_DEBUG_PAGEALLOC, I observed an unallocated memory access in
function_graph trace. It appears we find a small size entry in ring buffer,
but we access it as a big size entry. The access overflows the page size
and touches an unallocated page.

Cc: <>
Signed-off-by: default avatarShaohua Li <>
LKML-Reference: <>
[ Added a comment to explain the problem - SDR ]
Signed-off-by: default avatarSteven Rostedt <>
parent 8a4fd31e
......@@ -507,7 +507,15 @@ get_return_for_leaf(struct trace_iterator *iter,
* if the output fails.
data->ent = *curr;
data->ret = *next;
* If the next event is not a return type, then
* we only care about what type it is. Otherwise we can
* safely copy the entire event.
if (next->ent.type == TRACE_GRAPH_RET)
data->ret = *next;
data->ret.ent.type = next->ent.type;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment