Patch "tracing/probes: Fix to update dynamic data counter if fetcharg uses it" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tracing/probes: Fix to update dynamic data counter if fetcharg uses it

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tracing-probes-fix-to-update-dynamic-data-counter-if.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9acb7d2b0dfbf735d4e03553a223690b37baa88c
Author: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Date:   Tue Jul 11 23:15:48 2023 +0900

    tracing/probes: Fix to update dynamic data counter if fetcharg uses it
    
    [ Upstream commit e38e2c6a9efc435f9de344b7c91f7697e01b47d5 ]
    
    Fix to update dynamic data counter ('dyndata') and max length ('maxlen')
    only if the fetcharg uses the dynamic data. Also get out arg->dynamic
    from unlikely(). This makes dynamic data address wrong if
    process_fetch_insn() returns error on !arg->dynamic case.
    
    Link: https://lore.kernel.org/all/168908494781.123124.8160245359962103684.stgit@devnote2/
    
    Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
    Link: https://lore.kernel.org/all/20230710233400.5aaf024e@xxxxxxxxxxxxxxxxxx/
    Fixes: 9178412ddf5a ("tracing: probeevent: Return consumed bytes of dynamic area")
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
    Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/trace/trace_probe_tmpl.h b/kernel/trace/trace_probe_tmpl.h
index bbb479b3ba8fd..cf14a37dff8c8 100644
--- a/kernel/trace/trace_probe_tmpl.h
+++ b/kernel/trace/trace_probe_tmpl.h
@@ -206,11 +206,13 @@ store_trace_args(void *data, struct trace_probe *tp, void *rec,
 		if (unlikely(arg->dynamic))
 			*dl = make_data_loc(maxlen, dyndata - base);
 		ret = process_fetch_insn(arg->code, rec, dl, base);
-		if (unlikely(ret < 0 && arg->dynamic)) {
-			*dl = make_data_loc(0, dyndata - base);
-		} else {
-			dyndata += ret;
-			maxlen -= ret;
+		if (arg->dynamic) {
+			if (unlikely(ret < 0)) {
+				*dl = make_data_loc(0, dyndata - base);
+			} else {
+				dyndata += ret;
+				maxlen -= ret;
+			}
 		}
 	}
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux