probes: Fixes for v6.9-rc6
Masami Hiramatsu (Google)
maintainerHi Linus,
Probes fixes for v6.9-rc6:
- probe-events: Fix memory leak in parsing probe argument. There is a memory leak (forget to free an allocated buffer) in a memory allocation failure path. Fixes it to jump to the correct error handling code.
Please pull the latest probes-fixes-v6.9-rc6 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes-fixes-v6.9-rc6
Tag SHA1: 7ecfa9b34f812e244746158de5abfdd5132a4a62 Head SHA1: dce3696271af7765f04428ec31b1b87dc7d016c6
LuMingYin (1):
tracing/probes: Fix memory leak in traceprobe_parse_probe_arg_body()
----
kernel/trace/trace_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --------------------------- commit dce3696271af7765f04428ec31b1b87dc7d016c6 Author: LuMingYin <[email protected]> Date: Sat Apr 27 08:23:47 2024 +0100
tracing/probes: Fix memory leak in traceprobe_parse_probe_arg_body()
If traceprobe_parse_probe_arg_body() failed to allocate 'parg->fmt', it jumps to the label 'out' instead of 'fail' by mistake.In the result, the buffer 'tmp' is not freed in this case and leaks its memory.
Thus jump to the label 'fail' in that error case.
kernel/trace/trace_probe.c +1 -1
@@ -1466,7 +1466,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size, parg->fmt =kmalloc (len,GFP_KERNEL );if (!parg->fmt) { ret = -ENOMEM ; - goto out; + goto fail; }snprintf (parg->fmt, len,"%s[%d]" , parg->type->fmttype, parg->count);
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
The pull request you sent on Sat, 4 May 2024 22:19:17 +0900:
The pull request you sent on Sat, 4 May 2024 22:19:17 +0900:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.gitprobes-fixes-v6.9-rc6
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/2c17a1cd90a5d385a7138c030e815e3effc45677
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html