Beau Belgrave 2fc3d0ac09 tracing/user_events: Allow events to persist for perfmon_capable users
[ Upstream commit 5dbd04eddb2c0841d1b3930e0a9944a2343c9cac ]

There are several scenarios that have come up where having a user_event
persist even if the process that registered it exits. The main one is
having a daemon create events on bootup that shouldn't get deleted if
the daemon has to exit or reload. Another is within OpenTelemetry
exporters, they wish to potentially check if a user_event exists on the
system to determine if exporting the data out should occur. The
user_event in this case must exist even in the absence of the owning
process running (such as the above daemon case).

Expose the previously internal flag USER_EVENT_REG_PERSIST to user
processes. Upon register or delete of events with this flag, ensure the
user is perfmon_capable to prevent random user processes with access to
tracefs from creating events that persist after exit.

Link: https://lkml.kernel.org/r/20230912180704.1284-2-beaub@linux.microsoft.com

Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Stable-dep-of: bd125a084091 ("tracing/user_events: Fix non-spaced field matching")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:12:11 +02:00
..
2023-05-14 16:05:28 +01:00
2023-05-30 15:20:08 +01:00
2022-08-11 10:31:19 -07:00
2024-06-12 11:11:38 +02:00
2022-06-07 10:20:42 -07:00
2023-08-21 14:54:48 +02:00
2023-04-22 14:41:30 -07:00
2023-01-20 09:33:22 +00:00
2023-03-06 15:49:07 -06:00
2022-04-04 08:55:23 +02:00
2023-03-16 21:20:32 -07:00
2022-08-10 13:49:50 +01:00
2023-10-24 12:02:02 +02:00
2022-07-17 07:52:46 -07:00
2022-09-20 09:13:38 +02:00
2023-01-04 14:59:25 +01:00
2023-03-23 17:25:46 +01:00
2023-06-09 16:25:16 -07:00
2023-08-14 18:48:02 +02:00
2023-04-27 19:15:11 -06:00
2023-07-28 09:33:12 -07:00
2022-09-07 16:46:03 +02:00
2024-04-27 17:11:36 +02:00
2022-08-03 16:29:08 -07:00
2023-08-04 16:20:39 +02:00
2022-11-17 11:04:23 -08:00
2022-09-27 17:29:09 -07:00
2023-06-05 09:36:35 +02:00
2023-03-23 17:25:46 +01:00
2023-06-09 16:13:01 +01:00
2023-08-30 20:41:37 -07:00
2022-12-05 10:30:47 +01:00