All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] tracing/probes: Support $argN in return probe (kprobe and fprobe)
@ 2024-03-19  7:19 Dan Carpenter
  2024-03-19 14:10 ` Steven Rostedt
  2024-03-20  8:10 ` [PATCH] tracing: probes: Fix to zero initialize a local variable Masami Hiramatsu (Google)
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Carpenter @ 2024-03-19  7:19 UTC (permalink / raw)
  To: mhiramat; +Cc: linux-trace-kernel

Hello Masami Hiramatsu (Google),

Commit 25f00e40ce79 ("tracing/probes: Support $argN in return probe
(kprobe and fprobe)") from Mar 4, 2024 (linux-next), leads to the
following Smatch static checker warning:

	kernel/trace/trace_probe.c:856 store_trace_entry_data()
	error: uninitialized symbol 'val'.

kernel/trace/trace_probe.c
    846                 return;
    847 
    848         for (i = 0; i < earg->size; i++) {
    849                 struct fetch_insn *code = &earg->code[i];
    850 
    851                 switch (code->op) {
    852                 case FETCH_OP_ARG:
    853                         val = regs_get_kernel_argument(regs, code->param);
    854                         break;
    855                 case FETCH_OP_ST_EDATA:
--> 856                         *(unsigned long *)((unsigned long)edata + code->offset) = val;

Probably the earg->code[i] always has FETCH_OP_ARG before
FETCH_OP_ST_EDATA but Smatch isn't smart enough to figure that out...

    857                         break;
    858                 case FETCH_OP_END:
    859                         goto end;
    860                 default:
    861                         break;
    862                 }
    863         }
    864 end:
    865         return;
    866 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-20 22:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19  7:19 [bug report] tracing/probes: Support $argN in return probe (kprobe and fprobe) Dan Carpenter
2024-03-19 14:10 ` Steven Rostedt
2024-03-19 14:39   ` Dan Carpenter
2024-03-20  3:44   ` Masami Hiramatsu
2024-03-20 13:22     ` Steven Rostedt
2024-03-20  8:10 ` [PATCH] tracing: probes: Fix to zero initialize a local variable Masami Hiramatsu (Google)
2024-03-20 13:26   ` Steven Rostedt
2024-03-20 13:27   ` Steven Rostedt
2024-03-20 22:56     ` Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.