Patch "tracing: Fix the checking of stackidx in __ftrace_trace_stack" has been added to the 5.4-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 the checking of stackidx in __ftrace_trace_stack

to the 5.4-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-the-checking-of-stackidx-in-__ftrace_tra.patch
and it can be found in the queue-5.4 subdirectory.

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



commit ece8e71c052fddbc075df14f77e50c2aecd3f947
Author: Qiujun Huang <hqjagain@xxxxxxxxx>
Date:   Sat Oct 31 16:57:14 2020 +0800

    tracing: Fix the checking of stackidx in __ftrace_trace_stack
    
    [ Upstream commit 906695e59324635c62b5ae59df111151a546ca66 ]
    
    The array size is FTRACE_KSTACK_NESTING, so the index FTRACE_KSTACK_NESTING
    is illegal too. And fix two typos by the way.
    
    Link: https://lkml.kernel.org/r/20201031085714.2147-1-hqjagain@xxxxxxxxx
    
    Signed-off-by: Qiujun Huang <hqjagain@xxxxxxxxx>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2a357bda45cf0..f7cac11a90055 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2510,7 +2510,7 @@ trace_event_buffer_lock_reserve(struct ring_buffer **current_rb,
 	/*
 	 * If tracing is off, but we have triggers enabled
 	 * we still need to look at the event data. Use the temp_buffer
-	 * to store the trace event for the tigger to use. It's recusive
+	 * to store the trace event for the trigger to use. It's recursive
 	 * safe and will not be recorded anywhere.
 	 */
 	if (!entry && trace_file->flags & EVENT_FILE_FL_TRIGGER_COND) {
@@ -2832,7 +2832,7 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer,
 	stackidx = __this_cpu_inc_return(ftrace_stack_reserve) - 1;
 
 	/* This should never happen. If it does, yell once and skip */
-	if (WARN_ON_ONCE(stackidx > FTRACE_KSTACK_NESTING))
+	if (WARN_ON_ONCE(stackidx >= FTRACE_KSTACK_NESTING))
 		goto out;
 
 	/*



[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