aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-19 13:14:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-19 13:14:22 +0200
commitca1452430166fdd0d2931ecabfa46aefa9a1d154 (patch)
tree0eaa0b66e2618755bcc4b73aa0bb2dc5dd152621
parent085d4bd5549884b6337155ca7133aa643ddf7536 (diff)
downloadstable-queue-ca1452430166fdd0d2931ecabfa46aefa9a1d154.tar.gz
5.10-stable patches
added patches: revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch
-rw-r--r--queue-5.10/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch53
-rw-r--r--queue-5.10/series1
2 files changed, 54 insertions, 0 deletions
diff --git a/queue-5.10/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch b/queue-5.10/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch
new file mode 100644
index 0000000000..663a0d2f9d
--- /dev/null
+++ b/queue-5.10/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch
@@ -0,0 +1,53 @@
+From siddh.raman.pant@oracle.com Fri Apr 19 13:11:23 2024
+From: Siddh Raman Pant <siddh.raman.pant@oracle.com>
+Date: Thu, 18 Apr 2024 18:58:06 +0530
+Subject: Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>
+Cc: linux-trace-kernel <linux-trace-kernel@vger.kernel.org>, linux-kernel <linux-kernel@vger.kernel.org>, stable@kernel.org
+Message-ID: <20240418132806.159307-1-siddh.raman.pant@oracle.com>
+
+From: Siddh Raman Pant <siddh.raman.pant@oracle.com>
+
+This reverts commit 56cfbe60710772916a5ba092c99542332b48e870 which is
+commit 0958b33ef5a04ed91f61cef4760ac412080c4e08 upstream.
+
+The change has an incorrect assumption about the return value because
+in the current stable trees for versions 5.15 and before, the following
+commit responsible for making 0 a success value is not present:
+b8cc44a4d3c1 ("tracing: Remove logic for registering multiple event triggers at a time")
+
+The return value should be 0 on failure in the current tree, because in
+the functions event_trigger_callback() and event_enable_trigger_func(),
+we have:
+
+ ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file);
+ /*
+ * The above returns on success the # of functions enabled,
+ * but if it didn't find any functions it returns zero.
+ * Consider no functions a failure too.
+ */
+ if (!ret) {
+ ret = -ENOENT;
+
+Cc: stable@kernel.org # 5.15, 5.10, 5.4, 4.19
+Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/trace/trace_events_trigger.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/kernel/trace/trace_events_trigger.c
++++ b/kernel/trace/trace_events_trigger.c
+@@ -1140,10 +1140,8 @@ register_snapshot_trigger(char *glob, st
+ struct event_trigger_data *data,
+ struct trace_event_file *file)
+ {
+- int ret = tracing_alloc_snapshot_instance(file->tr);
+-
+- if (ret < 0)
+- return ret;
++ if (tracing_alloc_snapshot_instance(file->tr) != 0)
++ return 0;
+
+ return register_trigger(glob, ops, data, file);
+ }
diff --git a/queue-5.10/series b/queue-5.10/series
index 8fead0b133..83637f15b5 100644
--- a/queue-5.10/series
+++ b/queue-5.10/series
@@ -33,3 +33,4 @@ riscv-process-fix-kernel-gp-leakage.patch
ring-buffer-only-update-pages_touched-when-a-new-pag.patch
selftests-ftrace-limit-length-in-subsystem-enable-tests.patch
kprobes-fix-possible-use-after-free-issue-on-kprobe-registration.patch
+revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch