tracing: probes: Fix to zero initialize a local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>

commit 0add699ad068d26e5b1da9ff28b15461fc4005df upstream.

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@xxxxxxxxxx>
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@xxxxxxxxxxx>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 kernel/trace/trace_probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -843,7 +843,7 @@ out:
 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)


Patches currently in stable-queue which might be from mhiramat@xxxxxxxxxx are

queue-6.6/uprobe-avoid-out-of-bounds-memory-access-of-fetching.patch
queue-6.6/tracing-probes-fix-max_trace_args-limit-handling.patch
queue-6.6/tracing-probes-support-argn-in-return-probe-kprobe-a.patch
queue-6.6/uprobes-prevent-mutex_lock-under-rcu_read_lock.patch
queue-6.6/tracing-fprobe-event-cleanup-fix-a-wrong-comment-in-.patch
queue-6.6/uprobes-encapsulate-preparation-of-uprobe-args-buffe.patch
queue-6.6/tracing-probes-cleanup-set-trace_probe-nr_args-at-tr.patch
queue-6.6/tracing-consider-the-null-character-when-validating-.patch
queue-6.6/uprobes-prepare-uprobe-args-buffer-lazily.patch
queue-6.6/tracing-probes-fix-to-zero-initialize-a-local-variable.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux