From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9319EB64DC for ; Fri, 21 Jul 2023 14:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbjGUOir (ORCPT ); Fri, 21 Jul 2023 10:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbjGUOin (ORCPT ); Fri, 21 Jul 2023 10:38:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F0592D7B for ; Fri, 21 Jul 2023 07:38:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B5F6661CD0 for ; Fri, 21 Jul 2023 14:38:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FF4EC433C7; Fri, 21 Jul 2023 14:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689950321; bh=H9+UPUot8wThCl7i4wqyt1Gf3RaCn1xsCJ7/6yMQiB4=; h=Subject:To:Cc:From:Date:From; b=WbiwbyyvrqXrIk348SGhX05gghxEBbvgUNvyMa2dIv+8TrSolGQlCEdqeP0pFZeOb TOL7Wt5n6pOBdR2kX+R6Y2tmCRu4zwz6YLkX1vK1B37wzy8ugWhSQ2trwNKSPucHfa BW3EmwDAui9h/GEu71J9t6j1tJtXGr7/zRtvgPcU= Subject: FAILED: patch "[PATCH] tracing/probes: Fix to avoid double count of the string" failed to apply to 6.1-stable tree To: mhiramat@kernel.org, dan.carpenter@linaro.org, rostedt@goodmis.org Cc: From: Date: Fri, 21 Jul 2023 16:38:38 +0200 Message-ID: <2023072138-nervous-shorten-9868@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 6.1-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 . 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-6.1.y git checkout FETCH_HEAD git cherry-pick -x 66bcf65d6cf0ca6540e2341e88ee7ef02dbdda08 # git commit -s git send-email --to '' --in-reply-to '2023072138-nervous-shorten-9868@gregkh' --subject-prefix 'PATCH 6.1.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") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 66bcf65d6cf0ca6540e2341e88ee7ef02dbdda08 Mon Sep 17 00:00:00 2001 From: "Masami Hiramatsu (Google)" 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. Link: https://lore.kernel.org/all/168908492917.123124.15076463491122036025.stgit@devnote2/ Reported-by: Dan Carpenter 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) Reviewed-by: Steven Rostedt (Google) diff --git a/kernel/trace/trace_probe_tmpl.h b/kernel/trace/trace_probe_tmpl.h index 00707630788d..4735c5cb76fa 100644 --- a/kernel/trace/trace_probe_tmpl.h +++ b/kernel/trace/trace_probe_tmpl.h @@ -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: