Skip to content

tracing: Fixes and cleanups for v6.11

Steven Rostedt lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9tracing: Have format file honor EVENT_FILE_FL_FREEDkernel/trace/trace.h kernel/trace/trace_events.c kernel/trace/trace_events_hist.c +2 more+49 -190 replies
2/9tracing: Use refcount for trace_event_file reference counterinclude/linux/trace_events.h kernel/trace/trace_events.c+5 -50 replies
3/9tracefs: Fix inode allocationfs/tracefs/inode.c+1 -10 replies
4/9eventfs: Dont return NULL in eventfs_create_dir()fs/tracefs/event_inode.c+1 -10 replies
5/9eventfs: Use SRCU for freeing eventfs_inodesfs/tracefs/event_inode.c+1 -10 replies
6/9function_graph: Fix the ret_stack used by ftrace_graph_ret_addr()kernel/trace/fgraph.c+1 -10 replies
7/9tracing: Fix overflow in get_free_elt()kernel/trace/tracing_map.c+3 -30 replies
8/9ring-buffer: Remove unused function ring_buffer_nr_pages()include/linux/ring_buffer.h kernel/trace/ring_buffer.c+0 -130 replies
9/9tracefs: Use generic inode RCU for synchronizing freeingfs/tracefs/inode.c fs/tracefs/internal.h+5 -100 replies

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by.

PatchMathias KrauseMasami Hiramatsu (Google)Dan CarpenterAjay Kaher
1/9T-b
2/9A-b
3/9
4/9R-b R-b
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [for-linus][PATCH 0/9] tracing: Fixes and cleanups for v6.11

tracing fixes for v6.11:

- Have reading of event format files test if the meta data still exists. When a event is freed, a flag (EVENT_FILE_FL_FREED) in the meta data is set to state that it is to prevent any new references to it from happening while waiting for existing references to close. When the last reference closes, the meta data is freed. But the "format" was missing a check to this flag (along with some other files) that allowed new references to happen, and a use-afte-free bug to occur.

- Have the trace event meta data use the refcount infrastructure instead of relying on its own atomic counters.

- Have tracefs inodes use alloc_inode_sb() for allocation instead of using kmem_cache_alloc() directly.

- Have eventfs_create_dir() return an ERR_PTR instead of NULL as the callers expect a real object or an ERR_PTR.

- Have release_ei() use call_srcu() and not call_rcu() as all the protection is on SRCU and not RCU.

- Fix ftrace_graph_ret_addr() to use the task passed in and not current.

- Fix overflow bug in get_free_elt() where the counter can overflow the integer and cause an infinite loop.

- Remove unused function ring_buffer_nr_pages()

- Have tracefs freeing use the inode RCU infrastructure instead of creating its own. When the kernel had randomize structure fields enabled, the rcu field of the tracefs_inode was overlapping the rcu field of the inode structure, and corrupting it. Instead, use the destroy_inode() callback to do the initial cleanup of the code, and then have free_inode() free it.

Jianhui Zhou (1):
ring-buffer: Remove unused function ring_buffer_nr_pages()

Mathias Krause (3):
tracefs: Fix inode allocation
eventfs: Don't return NULL in eventfs_create_dir()
eventfs: Use SRCU for freeing eventfs_inodes

Petr Pavlu (1):
function_graph: Fix the ret_stack used by ftrace_graph_ret_addr()

Steven Rostedt (3):
tracing: Have format file honor EVENT_FILE_FL_FREED
tracing: Use refcount for trace_event_file reference counter
tracefs: Use generic inode RCU for synchronizing freeing

Tze-nan Wu (1):
tracing: Fix overflow in get_free_elt()

----

 fs/tracefs/event_inode.c            |  4 ++--
 fs/tracefs/inode.c                  | 12 +++++------
 fs/tracefs/internal.h               |  5 +----
 include/linux/ring_buffer.h         |  1 -
 include/linux/trace_events.h        |  2 +-
 kernel/trace/fgraph.c               |  2 +-
 kernel/trace/ring_buffer.c          | 12 -----------
 kernel/trace/trace.h                | 23 +++++++++++++++++++++
 kernel/trace/trace_events.c         | 41 ++++++++++++++++++++++---------------
 kernel/trace/trace_events_hist.c    |  4 ++--
 kernel/trace/trace_events_inject.c  |  2 +-
 kernel/trace/trace_events_trigger.c |  6 +++---
 kernel/trace/tracing_map.c          |  6 +++---
 13 files changed, 66 insertions(+), 54 deletions(-)