mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [GIT PULL] probes: Fixes for v6.9-rc1
Date: Wed, 27 Mar 2024 23:23:35 +0900	[thread overview]
Message-ID: <20240327232335.c817e6f17b84328f462d9e57@kernel.org> (raw)

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>

             reply	other threads:[~2024-03-27 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 14:23 Masami Hiramatsu [this message]
2024-03-27 17:05 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327232335.c817e6f17b84328f462d9e57@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®