]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tracing: fprobe: do not zero out unused fgraph_data
authorMartin Kaiser <martin@kaiser.cx>
Tue, 24 Mar 2026 15:47:01 +0000 (00:47 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 24 Mar 2026 15:47:01 +0000 (00:47 +0900)
If fprobe_entry does not fill the allocated fgraph_data completely, the
unused part does not have to be zeroed.

fgraph_data is a short-lived part of the shadow stack. The preceding
length field allows locating the end regardless of the content.

Link: https://lore.kernel.org/all/20260324084804.375764-1-martin@kaiser.cx/
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/fprobe.c

index dcadf1d23b8a31f571392d0c49cbd22df1716b4f..56d1450179027241cfe4142b72d6910d0a80f170 100644 (file)
@@ -450,8 +450,6 @@ static int fprobe_fgraph_entry(struct ftrace_graph_ent *trace, struct fgraph_ops
                                used += FPROBE_HEADER_SIZE_IN_LONG + size_words;
                }
        }
-       if (used < reserved_words)
-               memset(fgraph_data + used, 0, reserved_words - used);
 
        /* If any exit_handler is set, data must be used. */
        return used != 0;