]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
954c54d236bceb18798aa24c16263e10a762df73
[thirdparty/kernel/stable-queue.git] /
1 From f6d026eea390d59787a6cdc2ef5c983d02e029d0 Mon Sep 17 00:00:00 2001
2 From: sunliming <sunliming@kylinos.cn>
3 Date: Mon, 26 Jun 2023 19:13:42 +0800
4 Subject: tracing/user_events: Fix incorrect return value for writing operation when events are disabled
5
6 From: sunliming <sunliming@kylinos.cn>
7
8 commit f6d026eea390d59787a6cdc2ef5c983d02e029d0 upstream.
9
10 The writing operation return the count of writes regardless of whether events
11 are enabled or disabled. Switch it to return -EBADF to indicates that the event
12 is disabled.
13
14 Link: https://lkml.kernel.org/r/20230626111344.19136-2-sunliming@kylinos.cn
15
16 Cc: stable@vger.kernel.org
17 7f5a08c79df35 ("user_events: Add minimal support for trace_event into ftrace")
18 Acked-by: Beau Belgrave <beaub@linux.microsoft.com>
19 Signed-off-by: sunliming <sunliming@kylinos.cn>
20 Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 kernel/trace/trace_events_user.c | 3 ++-
24 1 file changed, 2 insertions(+), 1 deletion(-)
25
26 --- a/kernel/trace/trace_events_user.c
27 +++ b/kernel/trace/trace_events_user.c
28 @@ -1456,7 +1456,8 @@ static ssize_t user_events_write_core(st
29
30 if (unlikely(faulted))
31 return -EFAULT;
32 - }
33 + } else
34 + return -EBADF;
35
36 return ret;
37 }