The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to stable@vger.kernel.org.
Possible dependencies:
2cc6a528882d ("tracing/hist: Fix wrong return value in parse_action_params()") d0cd871ba0d6 ("tracing: Have histogram code pass around trace_array for error handling") d566c5e9d1ba ("tracing: Use tracing error_log with hist triggers") a1a05bb40e22 ("tracing: Save the last hist command's associated event name") e91eefd731d9 ("tracing: Add alternative synthetic event trace action syntax") dff81f559285 ("tracing: Add hist trigger onchange() handler") a3785b7eca8f ("tracing: Add hist trigger snapshot() action") 466f4528fbc6 ("tracing: Generalize hist trigger onmax and save action") c3e49506a0f4 ("tracing: Split up onmatch action data") 5032b3818913 ("tracing: Make hist trigger Documentation better reflect actions/handlers") 7d18a10c3167 ("tracing: Refactor hist trigger action code") 036876fa5620 ("tracing: Have the historgram use the result of str_has_prefix() for len of prefix") 754481e6954c ("tracing: Use str_has_prefix() helper for histogram code") 05ddb25cb314 ("tracing: Add hist trigger comments for variable-related fields") de40f033d4e8 ("tracing: Remove open-coding of hist trigger var_ref management") 2f31ed9308cc ("tracing: Change strlen to sizeof for hist trigger static strings") 6801f0d5ca00 ("tracing: Remove unnecessary hist trigger struct field") 0e2b81f7b52a ("tracing: Remove unneeded synth_event_mutex") 7bbab38d07f3 ("tracing: Use dyn_event framework for synthetic events") faacb361f271 ("tracing: Simplify creation and deletion of synthetic events")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2cc6a528882d0e0ccbc1bca5f95b8c963cedac54 Mon Sep 17 00:00:00 2001 From: Zheng Yejian zhengyejian1@huawei.com Date: Wed, 7 Dec 2022 11:46:35 +0800 Subject: [PATCH] tracing/hist: Fix wrong return value in parse_action_params()
When number of synth fields is more than SYNTH_FIELDS_MAX, parse_action_params() should return -EINVAL.
Link: https://lore.kernel.org/linux-trace-kernel/20221207034635.2253990-1-zhengyej...
Cc: mhiramat@kernel.org Cc: zanussi@kernel.org Cc: stable@vger.kernel.org Fixes: c282a386a397 ("tracing: Add 'onmatch' hist trigger action support") Signed-off-by: Zheng Yejian zhengyejian1@huawei.com Signed-off-by: Steven Rostedt (Google) rostedt@goodmis.org
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index a0cd118af527..b4ad86c22b43 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -3609,6 +3609,7 @@ static int parse_action_params(struct trace_array *tr, char *params, while (params) { if (data->n_params >= SYNTH_FIELDS_MAX) { hist_err(tr, HIST_ERR_TOO_MANY_PARAMS, 0); + ret = -EINVAL; goto out; }
linux-stable-mirror@lists.linaro.org