From: Greg Kroah-Hartman Date: Fri, 19 Apr 2024 11:14:30 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.15.157~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=27715a3a4551591a29a710752823ab26ecd8deca;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch --- diff --git a/queue-5.15/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch b/queue-5.15/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch new file mode 100644 index 00000000000..69404635eff --- /dev/null +++ b/queue-5.15/revert-tracing-trigger-fix-to-return-error-if-failed-to-alloc-snapshot.patch @@ -0,0 +1,52 @@ +From siddh.raman.pant@oracle.com Fri Apr 19 13:11:23 2024 +From: Siddh Raman Pant +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 , Steven Rostedt , Ingo Molnar +Cc: linux-trace-kernel , linux-kernel , stable@kernel.org +Message-ID: <20240418132806.159307-1-siddh.raman.pant@oracle.com> + +From: Siddh Raman Pant + +This reverts commit b5085b5ac1d96ea2a8a6240f869655176ce44197. + +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -1161,10 +1161,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.15/series b/queue-5.15/series index ed550d2c642..ee8e0f8174f 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -10,3 +10,4 @@ bpf-generally-fix-helper-register-offset-check.patch bpf-fix-out-of-bounds-access-for-ringbuf-helpers.patch bpf-fix-ringbuf-memory-type-confusion-when-passing-to-helpers.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