From: Greg Kroah-Hartman Date: Sun, 8 Sep 2024 12:09:08 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.19.322~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e00ca2ef26b93fc5929782781143a072fe8c9002;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: tracing-avoid-possible-softlockup-in-tracing_iter_reset.patch --- diff --git a/queue-5.10/series b/queue-5.10/series index 4b9476b30c9..f4d3c5c63a1 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -67,3 +67,4 @@ fuse-use-unsigned-type-for-getxattr-listxattr-size-truncation.patch clk-qcom-clk-alpha-pll-fix-the-pll-post-div-mask.patch clk-qcom-clk-alpha-pll-fix-the-trion-pll-postdiv-set-rate-api.patch can-mcp251x-fix-deadlock-if-an-interrupt-occurs-during-mcp251x_open.patch +tracing-avoid-possible-softlockup-in-tracing_iter_reset.patch diff --git a/queue-5.10/tracing-avoid-possible-softlockup-in-tracing_iter_reset.patch b/queue-5.10/tracing-avoid-possible-softlockup-in-tracing_iter_reset.patch new file mode 100644 index 00000000000..424c25d5b9b --- /dev/null +++ b/queue-5.10/tracing-avoid-possible-softlockup-in-tracing_iter_reset.patch @@ -0,0 +1,40 @@ +From 49aa8a1f4d6800721c7971ed383078257f12e8f9 Mon Sep 17 00:00:00 2001 +From: Zheng Yejian +Date: Tue, 27 Aug 2024 20:46:54 +0800 +Subject: tracing: Avoid possible softlockup in tracing_iter_reset() + +From: Zheng Yejian + +commit 49aa8a1f4d6800721c7971ed383078257f12e8f9 upstream. + +In __tracing_open(), when max latency tracers took place on the cpu, +the time start of its buffer would be updated, then event entries with +timestamps being earlier than start of the buffer would be skipped +(see tracing_iter_reset()). + +Softlockup will occur if the kernel is non-preemptible and too many +entries were skipped in the loop that reset every cpu buffer, so add +cond_resched() to avoid it. + +Cc: stable@vger.kernel.org +Fixes: 2f26ebd549b9a ("tracing: use timestamp to determine start of latency traces") +Link: https://lore.kernel.org/20240827124654.3817443-1-zhengyejian@huaweicloud.com +Suggested-by: Steven Rostedt +Signed-off-by: Zheng Yejian +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -3742,6 +3742,8 @@ void tracing_iter_reset(struct trace_ite + break; + entries++; + ring_buffer_iter_advance(buf_iter); ++ /* This could be a big loop */ ++ cond_resched(); + } + + per_cpu_ptr(iter->array_buffer->data, cpu)->skipped_entries = entries;