]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line
authorYang Jihong <yangjihong1@huawei.com>
Tue, 29 Nov 2022 11:30:09 +0000 (19:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:48 +0000 (11:41 +0100)
commitd2bdf6d3c589333ea3e4304099908a084bf6a64e
tree9761493a627afc8b085ead241bccb3e926cd8882
parent8cfefef701203fbd327382abcfcf00fd576714ff
tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line

commit edb3abd17909b20755ed1f701a150b6ca75efbbb upstream.

print_trace_line may overflow seq_file buffer. If the event is not
consumed, the while loop keeps peeking this event, causing a infinite loop.

Link: https://lkml.kernel.org/r/20221129113009.182425-1-yangjihong1@huawei.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Fixes: b4a8f77d7292d ("ftrace: pipe fixes")
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace.c