Skip to content

Commit 5232196

Browse files
committed
ftrace: Make ftrace_graph_ent depth field signed
The code has integrity checks to make sure that depth never goes below zero. But the depth field has recently been converted to unsigned long from "int" (for alignment reasons). As unsigned long can never be less than zero, the integrity checks no longer work. Convert depth to long from unsigned long to allow the integrity checks to work again. Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: pengdonglin <pengdonglin@xiaomi.com> Link: https://patch.msgid.link/20260102143148.251c2e16@gandalf.local.home Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/aS6kGi0maWBl-MjZ@stanley.mountain/ Fixes: f83ac75 ("function_graph: Enable funcgraph-args and funcgraph-retaddr to work simultaneously") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 parent 6435ffd commit 5232196

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/ftrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ static inline void ftrace_init(void) { }
11671167
*/
11681168
struct ftrace_graph_ent {
11691169
unsigned long func; /* Current function */
1170-
unsigned long depth;
1170+
long depth; /* signed to check for less than zero */
11711171
} __packed;
11721172

11731173
/*

0 commit comments

Comments
 (0)