Commit e9d3d179 authored by Siddh Raman Pant's avatar Siddh Raman Pant Committed by Zheng Yejian
Browse files

Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"

stable inclusion
from stable-v4.19.313
commit 34925d01baf3ee62ab21c21efd9e2c44c24c004a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HL6U
CVE: CVE-2024-26920

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=34925d01baf3ee62ab21c21efd9e2c44c24c004a



--------------------------------

This reverts commit bcf4a115a5068f3331fafb8c176c1af0da3d8b19 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:
b8cc44a4 ("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: default avatarSiddh Raman Pant <siddh.raman.pant@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes: fe730901 ("tracing/trigger: Fix to return error if failed to alloc snapshot")
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
parent 9ff44822
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment