From a8b6fcf41028838453b14b6432ae8fbc7eb98eef Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 24 Jul 2023 08:33:07 +0200 Subject: [PATCH] 4.19-stable patches added patches: tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch --- queue-4.19/series | 1 + ...l-to-add-histogram-to-hist_vars-list.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 queue-4.19/tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch diff --git a/queue-4.19/series b/queue-4.19/series index fb8c9dbbe5d..a51d0ce25d0 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -215,3 +215,4 @@ tcp-annotate-data-races-around-tp-linger2.patch tcp-annotate-data-races-around-rskq_defer_accept.patch tcp-annotate-data-races-around-tp-notsent_lowat.patch tcp-annotate-data-races-around-fastopenq.max_qlen.patch +tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch diff --git a/queue-4.19/tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch b/queue-4.19/tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch new file mode 100644 index 00000000000..515fff4633c --- /dev/null +++ b/queue-4.19/tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch @@ -0,0 +1,38 @@ +From 4b8b3905165ef98386a3c06f196c85d21292d029 Mon Sep 17 00:00:00 2001 +From: Mohamed Khalfella +Date: Fri, 14 Jul 2023 20:33:41 +0000 +Subject: tracing/histograms: Return an error if we fail to add histogram to hist_vars list + +From: Mohamed Khalfella + +commit 4b8b3905165ef98386a3c06f196c85d21292d029 upstream. + +Commit 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if +they have referenced variables") added a check to fail histogram creation +if save_hist_vars() failed to add histogram to hist_vars list. But the +commit failed to set ret to failed return code before jumping to +unregister histogram, fix it. + +Link: https://lore.kernel.org/linux-trace-kernel/20230714203341.51396-1-mkhalfella@purestorage.com + +Cc: stable@vger.kernel.org +Fixes: 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables") +Signed-off-by: Mohamed Khalfella +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace_events_hist.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/trace/trace_events_hist.c ++++ b/kernel/trace/trace_events_hist.c +@@ -5792,7 +5792,8 @@ static int event_hist_trigger_func(struc + goto out_unreg; + + if (has_hist_vars(hist_data) || hist_data->n_var_refs) { +- if (save_hist_vars(hist_data)) ++ ret = save_hist_vars(hist_data); ++ if (ret) + goto out_unreg; + } + -- 2.47.3