From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9B8D46B7 for ; Mon, 16 Jan 2023 16:30:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F450C433D2; Mon, 16 Jan 2023 16:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673886626; bh=khwLxqm+Kxa1SBkFXlJ9cpGwtYfUF+y7ZxmyUZkTn9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gHzYRQYhOaYpqV7qbY3ZsIH9SApPGjDuNkxJGRrKb6WRAxAPFk+K9YyMWA3cZ8ZkS MTltPX48wIHhWn6CWiWlrAcU//WOh4j5corCaHryV5nlcVqur4upudXK8BfAIBqfLL 1hHpH9PHQLPG8pK+YGpR0H1tPveajYt5G2Dcer60= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, mhiramat@kernel.org, zanussi@kernel.org, Zheng Yejian , "Steven Rostedt (Google)" Subject: [PATCH 5.4 501/658] tracing/hist: Fix wrong return value in parse_action_params() Date: Mon, 16 Jan 2023 16:49:49 +0100 Message-Id: <20230116154932.428535319@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154909.645460653@linuxfoundation.org> References: <20230116154909.645460653@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Zheng Yejian commit 2cc6a528882d0e0ccbc1bca5f95b8c963cedac54 upstream. 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-zhengyejian1@huawei.com Cc: Cc: Cc: stable@vger.kernel.org Fixes: c282a386a397 ("tracing: Add 'onmatch' hist trigger action support") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events_hist.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -4016,6 +4016,7 @@ static int parse_action_params(struct tr while (params) { if (data->n_params >= SYNTH_FIELDS_MAX) { hist_err(tr, HIST_ERR_TOO_MANY_PARAMS, 0); + ret = -EINVAL; goto out; }