lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240327232335.c817e6f17b84328f462d9e57@kernel.org>
Date: Wed, 27 Mar 2024 23:23:35 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Masami Hiramatsu (Google) <mhiramat@...nel.org>, Steven Rostedt
 <rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>,
 linux-kernel@...r.kernel.org
Subject: [GIT PULL] probes: Fixes for v6.9-rc1

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@...nel.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@...aro.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@...dmis.org>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.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@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ