[GIT PULL] probes: Fixes for v6.9-rc1

Masami Hiramatsu (Google) posted 1 patch 1 year, 10 months ago
kernel/trace/trace_probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[GIT PULL] probes: Fixes for v6.9-rc1
Posted by Masami Hiramatsu (Google) 1 year, 10 months ago
Hi Linus,

Probes fixes for v6.9-rc1:

 - tracing/probes: initialize a 'val' local variable with zero. This variable
   is read by FETCH_OP_ST_EDATA in a loop, and is expected to be initialized
   by FETCH_OP_ARG in the same loop. Since this expectation is not obvious,
   thus smatch warns it. Initializing 'val' with zero fixes this warning.


Please pull the latest probes-fixes-v6.9-rc1 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes-fixes-v6.9-rc1

Tag SHA1: f7e169092950bdda7a36a77325e3490700668a66
Head SHA1: 0add699ad068d26e5b1da9ff28b15461fc4005df


Masami Hiramatsu (Google) (1):
      tracing: probes: Fix to zero initialize a local variable

----
 kernel/trace/trace_probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---------------------------
commit 0add699ad068d26e5b1da9ff28b15461fc4005df
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Wed Mar 20 17:10:38 2024 +0900

    tracing: probes: Fix to zero initialize a local variable
    
    Fix to initialize 'val' local variable with zero.
    Dan reported that Smatch static code checker reports an error that a local
    'val' variable needs to be initialized. Actually, the 'val' is expected to
    be initialized by FETCH_OP_ARG in the same loop, but it is not obvious. So
    initialize it with zero.
    
    Link: https://lore.kernel.org/all/171092223833.237219.17304490075697026697.stgit@devnote2/
    
    Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
    Closes: https://lore.kernel.org/all/b010488e-68aa-407c-add0-3e059254aaa0@moroto.mountain/
    Fixes: 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)")
    Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 217169de0920..dfe3ee6035ec 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -839,7 +839,7 @@ int traceprobe_get_entry_data_size(struct trace_probe *tp)
 void store_trace_entry_data(void *edata, struct trace_probe *tp, struct pt_regs *regs)
 {
 	struct probe_entry_arg *earg = tp->entry_arg;
-	unsigned long val;
+	unsigned long val = 0;
 	int i;
 
 	if (!earg)
-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>
Re: [GIT PULL] probes: Fixes for v6.9-rc1
Posted by pr-tracker-bot@kernel.org 1 year, 10 months ago
The pull request you sent on Wed, 27 Mar 2024 23:23:35 +0900:

> git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git probes-fixes-v6.9-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/962490525cffee6270422206c9d5bdb12d472c2b

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html