Skip to contentSkip to conversation

probes: Fixes for v7.0-rc7

GIT PULL Merged Masami Hiramatsu (Google) 2 participants 2 messages Apr 11 Tracing

lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

Hi Linus,

Probes fixes for v7.0-rc7

- tracing/probe: reject non-closed empty immediate strings Fixed a buffer index underflow bug that occurred when passing an non-closed empty immediate string to the probe event.

Please pull the latest probes-fixes-v7.0-rc7 tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes-fixes-v7.0-rc7

Tag SHA1: 0c7333fa2ead5a8cd9bbd9825fd034eecf23fb70 Head SHA1: 4346be6577aaa04586167402ae87bbdbe32484a4

Pengpeng Hou (1):
tracing/probe: reject non-closed empty immediate strings

----

 kernel/trace/trace_probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---------------------------
commit 4346be6577aaa04586167402ae87bbdbe32484a4
Author: Pengpeng Hou <[email protected]>
Date:   Thu Apr 2 00:03:15 2026 +0800

tracing/probe: reject non-closed empty immediate strings

parse_probe_arg() accepts quoted immediate strings and passes the body after the opening quote to __parse_imm_string(). That helper currently computes strlen(str) and immediately dereferences str[len - 1], which underflows when the body is empty and not closed with double-quotation.

Reject empty non-closed immediate strings before checking for the closing quote.

Fixes a42e3c4de964 ("tracing/probe: Add immediate string parameter support")
kernel/trace/trace_probe.c +1 -1
index e0a5dc86c07e..e1c73065dae5 100644
@@ -1068,7 +1068,7 @@ static int __parse_imm_string(char *str, char **pbuf, int offs)
 {
 	size_t len = strlen(str);
 
-	if (str[len - 1] != '"') {
+	if (!len || str[len - 1] != '"') {
 		trace_probe_log_err(offs + len, IMMSTR_NO_CLOSE);
 		return -EINVAL;
 	}
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
merge bot Merged
#1 lore raw
The pull request you sent on Sat, 11 Apr 2026 20:27:59 +0900:

The pull request you sent on Sat, 11 Apr 2026 20:27:59 +0900:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git probes-fixes-v7.0-rc7

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/558b9206d59c317186786ec21c1b616ab6a6f0a4

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html