]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing/probes: Fix to avoid double count of the string length on the array
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 11 Jul 2023 14:15:29 +0000 (23:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:30 +0000 (10:22 +0200)
commite7b4d24fa090cfe4dc665fc067cd4d62b8e5ec7c
treed2fc7df636421f43510061e0a352c6356cf5af3c
parent3a1a229712efa8e72adaa44252c54b5e5e3f3dd7
tracing/probes: Fix to avoid double count of the string length on the array

[ Upstream commit 66bcf65d6cf0ca6540e2341e88ee7ef02dbdda08 ]

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.

Link: https://lore.kernel.org/all/168908492917.123124.15076463491122036025.stgit@devnote2/
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/8819b154-2ba1-43c3-98a2-cbde20892023@moroto.mountain/
Fixes: 88903c464321 ("tracing/probe: Add ustring type for user-space string")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace_probe_tmpl.h