]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/user_events: Use refcount instead of atomic for ref tracking
authorBeau Belgrave <beaub@linux.microsoft.com>
Thu, 28 Jul 2022 23:33:07 +0000 (16:33 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 29 Sep 2022 14:17:36 +0000 (10:17 -0400)
commit31f7c8d1aead273a8ed11a409053b28e7d36208d
tree441439a70813cb956e32d1d4c75254bfc12bcadc
parente571f15c6860cab461eca4b70d2b29d5e94777e3
tracing/user_events: Use refcount instead of atomic for ref tracking

User processes could open up enough event references to cause rollovers.
These could cause use after free scenarios, which we do not want.
Switching to refcount APIs prevent this, but will leak memory once
saturated.

Once saturated, user processes can still use the events. This prevents
a bad user process from stopping existing telemetry from being emitted.

Link: https://lkml.kernel.org/r/20220728233309.1896-5-beaub@linux.microsoft.com
Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_user.c