Patch "tracing: Fix trace_event_raw_event_synth() if else statement" has been added to the 6.1-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: Fix trace_event_raw_event_synth() if else statement

to the 6.1-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-fix-trace_event_raw_event_synth-if-else-statement.patch
and it can be found in the queue-6.1 subdirectory.

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


>From 9971c3f944489ff7aacb9d25e0cde841a5f6018a Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
Date: Tue, 31 Jan 2023 09:52:37 -0500
Subject: tracing: Fix trace_event_raw_event_synth() if else statement

From: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

commit 9971c3f944489ff7aacb9d25e0cde841a5f6018a upstream.

The test to check if the field is a stack is to be done if it is not a
string. But the code had:

    } if (event->fields[i]->is_stack) {

and not

   } else if (event->fields[i]->is_stack) {

which would cause it to always be tested. Worse yet, this also included an
"else" statement that was only to be called if the field was not a string
and a stack, but this code allows it to be called if it was a string (and
not a stack).

Also fixed some whitespace issues.

Link: https://lore.kernel.org/all/202301302110.mEtNwkBD-lkp@xxxxxxxxx/
Link: https://lore.kernel.org/linux-trace-kernel/20230131095237.63e3ca8d@xxxxxxxxxxxxxxxxxx

Cc: Tom Zanussi <zanussi@xxxxxxxxxx>
Fixes: 00cf3d672a9d ("tracing: Allow synthetic events to pass around stacktraces")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 kernel/trace/trace_events_synth.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -576,8 +576,8 @@ static notrace void trace_event_raw_even
 					   event->fields[i]->is_dynamic,
 					   data_size, &n_u64);
 			data_size += len; /* only dynamic string increments */
-		} if (event->fields[i]->is_stack) {
-		        long *stack = (long *)(long)var_ref_vals[val_idx];
+		} else if (event->fields[i]->is_stack) {
+			long *stack = (long *)(long)var_ref_vals[val_idx];
 
 			len = trace_stack(entry, event, stack,
 					   data_size, &n_u64);


Patches currently in stable-queue which might be from rostedt@xxxxxxxxxxx are

queue-6.1/tracing-fix-trace_event_raw_event_synth-if-else-statement.patch
queue-6.1/tracing-probes-fix-to-avoid-double-count-of-the-stri.patch
queue-6.1/tracing-fix-warning-in-trace_buffered_event_disable.patch
queue-6.1/tracing-probes-fix-to-record-0-length-data_loc-in-fe.patch
queue-6.1/tracing-allow-synthetic-events-to-pass-around-stackt.patch
queue-6.1/revert-tracing-add-fault-name-injection-to-kernel-pr.patch
queue-6.1/ring-buffer-fix-wrong-stat-of-cpu_buffer-read.patch



[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