Skip to contentSkip to conversation

FAILED: patch "[PATCH] tracing/probes: Fix to avoid double count of the string" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Jul 21, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 66bcf65d6cf0ca6540e2341e88ee7ef02dbdda08
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023072140-dropout-strep-a13c@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..

Possible dependencies:

66bcf65d6cf0 ("tracing/probes: Fix to avoid double count of the string length on the array") b26a124cbfa8 ("tracing/probes: Add symstr type for dynamic events") 7491e2c44278 ("tracing: Add a probe that attaches to trace events") 007517a01995 ("tracing/probe: Change traceprobe_set_print_fmt() to take a type") fcd9db51df8e ("tracing/probe: Have traceprobe_parse_probe_arg() take a const arg") bc87cf0a08d4 ("trace: Add a generic function to read/write u64 values from tracefs") d262271d0483 ("tracing/dynevent: Delegate parsing to create function")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 66bcf65d6cf0ca6540e2341e88ee7ef02dbdda08 Mon Sep 17 00:00:00 2001
From: "Masami Hiramatsu (Google)" <[email protected]>
Date: Tue, 11 Jul 2023 23:15:29 +0900
Subject: [PATCH] tracing/probes: Fix to avoid double count of the string
length on the array

If an array is specified with the ustring or symstr, the length of the strings are accumlated on both of 'ret' and 'total', which means the length is double counted.
Just set the length to the 'ret' value for avoiding double counting.

kernel/trace/trace_probe_tmpl.h +2 -2
index 00707630788d..4735c5cb76fa 100644
@@ -156,11 +156,11 @@ process_fetch_insn_bottom(struct fetch_insn *code, unsigned long val,
 			code++;
 			goto array;
 		case FETCH_OP_ST_USTRING:
-			ret += fetch_store_strlen_user(val + code->offset);
+			ret = fetch_store_strlen_user(val + code->offset);
 			code++;
 			goto array;
 		case FETCH_OP_ST_SYMSTR:
-			ret += fetch_store_symstrlen(val + code->offset);
+			ret = fetch_store_symstrlen(val + code->offset);
 			code++;
 			goto array;
 		default: