linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] tracing: Fix removing instances while reading/writing to their files
@ 2023-09-07  2:47 Steven Rostedt
  2023-09-07  2:47 ` [PATCH 1/6] tracefs/eventfs: Use dput to free the toplevel events directory Steven Rostedt
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Steven Rostedt @ 2023-09-07  2:47 UTC (permalink / raw)
  To: linux-kernel, linux-trace-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Zheng Yejian,
	Naresh Kamboju


It appears that the dynamic code of eventfs has caused a race window
to open up a bit more and showed that several files were not protected
by the trace array ref count. This means that a task could open one
of the files in an instance, remove the instance, and still be able to
read or write to that file. That access will then cause a "use-after-free"
bug.

Close those holes!

Also, fix a left over unused variable in the eventfs dput fix.

Steven Rostedt (Google) (6):
      tracefs/eventfs: Use dput to free the toplevel events directory
      tracing: Increase trace array ref count on enable and filter files
      tracing: Have tracing_max_latency inc the trace array ref count
      tracing: Have current_trace inc the trace array ref count
      tracing: Have option files inc the trace array ref count
      tracing: Have event inject files inc the trace array ref count

----
 fs/tracefs/event_inode.c           | 17 +++++++---
 fs/tracefs/inode.c                 |  2 +-
 fs/tracefs/internal.h              |  5 +--
 kernel/trace/trace.c               | 68 ++++++++++++++++++++++++++++++++++----
 kernel/trace/trace.h               |  2 ++
 kernel/trace/trace_events.c        |  6 ++--
 kernel/trace/trace_events_inject.c |  3 +-
 7 files changed, 85 insertions(+), 18 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-09-09  3:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07  2:47 [PATCH 0/6] tracing: Fix removing instances while reading/writing to their files Steven Rostedt
2023-09-07  2:47 ` [PATCH 1/6] tracefs/eventfs: Use dput to free the toplevel events directory Steven Rostedt
2023-09-07 17:48   ` Ajay Kaher
2023-09-07 19:39     ` Steven Rostedt
2023-09-07 21:56     ` Steven Rostedt
2023-09-08  7:45   ` Masami Hiramatsu
2023-09-09  3:09     ` Steven Rostedt
2023-09-07  2:47 ` [PATCH 2/6] tracing: Increase trace array ref count on enable and filter files Steven Rostedt
2023-09-07  2:47 ` [PATCH 3/6] tracing: Have tracing_max_latency inc the trace array ref count Steven Rostedt
2023-09-07  2:47 ` [PATCH 4/6] tracing: Have current_trace " Steven Rostedt
2023-09-07  2:47 ` [PATCH 5/6] tracing: Have option files " Steven Rostedt
2023-09-07  2:47 ` [PATCH 6/6] tracing: Have event inject " Steven Rostedt
2023-09-07 13:24 ` [PATCH 0/6] tracing: Fix removing instances while reading/writing to their files Naresh Kamboju
2023-09-07 16:11   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).