[PATCH 18/20] ftrace: Add multiple fgraph storage selftest

2024-05-24 Thread Steven Rostedt
nk: https://lore.kernel.org/linux-trace-kernel/171509111465.162236.3795819216426570800.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) Suggested-by: Steven Rostedt (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_selftest.c | 171 +---

[PATCH 20/20] function_graph: Use bitmask to loop on fgraph entry

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Instead of looping through all the elements of fgraph_array[] to see if there's an gops attached to one and then calling its gops->func(). Create a fgraph_array_bitmask that sets bits when an index in the array is reserved (via the simple lru algorith

[PATCH 19/20] function_graph: Use for_each_set_bit() in __ftrace_return_to_handler()

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Instead of iterating through the entire fgraph_array[] and seeing if one of the bitmap bits are set to know to call the array's retfunc() function, use for_each_set_bit() on the bitmap itself. This will only iterate for the number of set bits.

[PATCH 17/20] function_graph: Add selftest for passing local variables

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Add boot up selftest that passes variables from a function entry to a function exit, and make sure that they do get passed around. Co-developed with Masami Hiramatsu: Link: https://lore.kernel.org/linux-trace-kernel/171509110271.162236.1104755149631974

[PATCH 16/20] function_graph: Implement fgraph_reserve_data() and fgraph_retrieve_data()

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Added functions that can be called by a fgraph_ops entryfunc and retfunc to store state between the entry of the function being traced to the exit of the same function. The fgraph_ops entryfunc() may call fgraph_reserve_data() to store up to 32

[PATCH 15/20] function_graph: Move graph notrace bit to shadow stack global var

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The use of the task->trace_recursion for the logic used for the function graph no-trace was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Link: https://lo

[PATCH 14/20] function_graph: Move graph depth stored data to shadow stack global var

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The use of the task->trace_recursion for the logic used for the function graph depth was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Link: https://lore.ker

[PATCH 13/20] function_graph: Move set_graph_function tests to shadow stack global var

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The use of the task->trace_recursion for the logic used for the set_graph_funnction was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Link: https://lore.ker

[PATCH 12/20] function_graph: Add "task variables" per task for fgraph_ops

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Add a "task variables" array on the tasks shadow ret_stack that is the size of longs for each possible registered fgraph_ops. That's a total of 16, taking up 8 * 16 = 128 bytes (out of a page size 4k). This will allow for fgraph_ops to

[PATCH 10/20] function_graph: Have the instances use their own ftrace_ops for filtering

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Allow for instances to have their own ftrace_ops part of the fgraph_ops that makes the funtion_graph tracer filter on the set_ftrace_filter file of the instance and not the top instance. Note that this also requires to update ftrace_graph_func() t

[PATCH 11/20] function_graph: Use a simple LRU for fgraph_array index number

2024-05-24 Thread Steven Rostedt
ace-kernel/171509103267.162236.6885097397289135378.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/fgraph.c | 71 ++- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/kernel/trace/

[PATCH 09/20] ftrace: Allow ftrace startup flags to exist without dynamic ftrace

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Some of the flags for ftrace_startup() may be exposed even when CONFIG_DYNAMIC_FTRACE is not configured in. This is fine as the difference between dynamic ftrace and static ftrace is done within the internals of ftrace itself. No need to have use

[PATCH 08/20] ftrace: Allow function_graph tracer to be enabled in instances

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Now that function graph tracing can handle more than one user, allow it to be enabled in the ftrace instances. Note, the filtering of the functions is still joined by the top level set_ftrace_filter and friends, as well as the graph and nograph

[PATCH 07/20] ftrace/function_graph: Pass fgraph_ops to function graph callbacks

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Pass the fgraph_ops structure to the function graph callbacks. This will allow callbacks to add a descriptor to a fgraph_ops private field that wil be added in the future and use it for the callbacks. This will be useful when more than one ca

[PATCH 05/20] function_graph: Handle tail calls for stack unwinding

2024-05-24 Thread Steven Rostedt
mi Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/fgraph.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index aae51f746828..8de2a2662281 100644 --- a/kernel/trace/fgraph.c +++ b/k

[PATCH 06/20] function_graph: Remove logic around ftrace_graph_entry and return

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The function pointers ftrace_graph_entry and ftrace_graph_return are no longer called via the function_graph tracer. Instead, an array structure is now used that will allow for multiple users of the function_graph infrastructure. The variables are

[PATCH 04/20] function_graph: Allow multiple users to attach to function graph

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Allow for multiple users to attach to function graph tracer at the same time. Only 16 simultaneous users can attach to the tracer. This is because there's an array that stores the pointers to the attached fgraph_ops. When a function being traced is ent

[PATCH 03/20] function_graph: Add an array structure that will allow multiple callbacks

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Add an array structure that will eventually allow the function graph tracer to have up to 16 simultaneous callbacks attached. It's an array of 16 fgraph_ops pointers, that is assigned when one is registered. On entry of a function the entry of the

[PATCH 01/20] function_graph: Convert ret_stack to a series of longs

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" In order to make it possible to have multiple callbacks registered with the function_graph tracer, the retstack needs to be converted from an array of ftrace_ret_stack structures to an array of longs. This will allow to store the list of callbacks on

[PATCH 02/20] fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by long

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Instead of using "ALIGN()", use BUILD_BUG_ON() as the structures should always be divisible by sizeof(long). Co-developed with Masami Hiramatsu: Link: https://lore.kernel.org/linux-trace-kernel/171509093949.162236.14518699447151894536.stgit@

[PATCH 00/20] function_graph: Allow multiple users for function graph tracing

2024-05-24 Thread Steven Rostedt
index number ftrace: Add multiple fgraph storage selftest Steven Rostedt (Google) (2): function_graph: Use for_each_set_bit() in __ftrace_return_to_handler() function_graph: Use bitmask to loop on fgraph entry Steven Rostedt (VMware) (15): function_graph: Convert ret_stack

[no subject]

2024-05-24 Thread Steven Rostedt

[no subject]

2024-05-24 Thread Steven Rostedt

Re: [PATCH v10 07/36] function_graph: Allow multiple users to attach to function graph

2024-05-24 Thread Steven Rostedt
On Tue, 7 May 2024 23:09:22 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -109,6 +244,21 @@ ftrace_push_return_trace(unsigned long ret, unsigned > long func, > if (!current->ret_stack) > return -EBUSY; > > + /* > + * At first, check whether the previous fgraph

Re: [PATCH v10 00/36] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-05-24 Thread Steven Rostedt
On Tue, 7 May 2024 23:08:00 +0900 "Masami Hiramatsu (Google)" wrote: > Steven Rostedt (VMware) (15): > function_graph: Convert ret_stack to a series of longs > fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by > long > fun

Re: Bug in Kernel 6.8.x, 6.9.x Causing Trace/Panic During Shutdown/Reboot

2024-05-24 Thread Steven Rostedt
On Fri, 24 May 2024 12:50:08 +0200 "Linux regression tracking (Thorsten Leemhuis)" wrote: > > - Affected Versions: Before kernel version 6.8.10, the bug caused a > > quick display of a kernel trace dump before the shutdown/reboot > > completed. Starting from version 6.8.10 and continuing into

Re: Bug in Kernel 6.8.x, 6.9.x Causing Trace/Panic During Shutdown/Reboot

2024-05-24 Thread Steven Rostedt
On Fri, 24 May 2024 12:50:08 +0200 "Linux regression tracking (Thorsten Leemhuis)" wrote: > [CCing a few people] > Thanks for the Cc. > On 24.05.24 12:31, Ilkka Naulapää wrote: > > > > I have encountered a critical bug in the Linux vanilla kernel that > > leads to a kernel panic during the

Re: [PATCH v10 03/36] x86: tracing: Add ftrace_regs definition in the header

2024-05-24 Thread Steven Rostedt
On Fri, 24 May 2024 10:37:54 +0900 Masami Hiramatsu (Google) wrote: > > > > > > #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > > > struct ftrace_regs { > > > + /* > > > + * On the x86_64, the ftrace_regs saves; > > > + * rax, rcx, rdx, rdi, rsi, r8, r9, rbp, rip and rsp. > > > + * Also

Re: [PATCH v10 03/36] x86: tracing: Add ftrace_regs definition in the header

2024-05-23 Thread Steven Rostedt
On Tue, 7 May 2024 23:08:35 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Add ftrace_regs definition for x86_64 in the ftrace header to > clarify what register will be accessible from ftrace_regs. > > Signed-off-by: Masami Hiramatsu (Google) > --- > Changes

Re: [PATCH v10 01/36] tracing: Add a comment about ftrace_regs definition

2024-05-23 Thread Steven Rostedt
On Tue, 7 May 2024 23:08:12 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > To clarify what will be expected on ftrace_regs, add a comment to the > architecture independent definition of the ftrace_regs. > > Signed-off-by: Masami Hiramatsu (Google) > Acked-by:

Re: [PATCH v2] sched/rt: Clean up usage of rt_task()

2024-05-23 Thread Steven Rostedt
ng to sched_dl class only. > */ > if (tracing_dl || (wakeup_dl && !dl_task(p)) || > - (wakeup_rt && !dl_task(p) && !rt_task(p)) || > + (wakeup_rt && !realtime_task(p)) || > (!dl_task(p) && (p->prio >= wakeup_prio || p->prio >= > current->prio))) > return; > Reviewed-by: Steven Rostedt (Google)

[PATCH v2 3/4] eventfs: Update all the eventfs_inodes from the events descriptor

2024-05-22 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The change to update the permissions of the eventfs_inode had the misconception that using the tracefs_inode would find all the eventfs_inodes that have been updated and reset them on remount. The problem with this approach is that the eventfs_inodes

[PATCH v2 4/4] tracefs: Clear EVENT_INODE flag in tracefs_drop_inode()

2024-05-22 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When the inode is being dropped from the dentry, the TRACEFS_EVENT_INODE flag needs to be cleared to prevent a remount from calling eventfs_remount() on the tracefs_inode private data. There's a race between the inode is dropped (and the dentry freed

[PATCH v2 2/4] tracefs: Update inode permissions on remount

2024-05-22 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When a remount happens, if a gid or uid is specified update the inodes to have the same gid and uid. This will allow the simplification of the permissions logic for the dynamically created files and directories. Cc: sta...@vger.kernel.org Fixes: baa

[PATCH v2 1/4] eventfs: Keep the directories from having the same inode number as files

2024-05-22 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The directories require unique inode numbers but all the eventfs files have the same inode number. Prevent the directories from having the same inode numbers as the files as that can confuse some tooling. Cc: sta...@vger.kernel.org Fixes: 834bf76add3e6

[PATCH v2 0/4] tracefs/eventfs: Fix failed second run of test_ownership

2024-05-22 Thread Steven Rostedt
It should be done in the drop_inode callback. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git eventfs/urgent Head SHA1: 41b7db11bcac4638fa489c58d35e7d2146b665ab Steven Rostedt (Google) (4): eventfs: Keep the directories from having the same inode number as files

Re: [PATCH] tracefs: Remove unneeded buggy tracefs iput callback

2024-05-22 Thread Steven Rostedt
On Wed, 22 May 2024 12:45:04 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The iput callback was added because the remount could call into the > eventfs code and touch the ei->entry_attrs array, which could have been > freed when an eve

[PATCH] tracefs: Remove unneeded buggy tracefs iput callback

2024-05-22 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The iput callback was added because the remount could call into the eventfs code and touch the ei->entry_attrs array, which could have been freed when an eventfs directory is freed (via a synthetic event). But the entry_attrs was freed incorrectly a

Re: [PATCH] tools/latency-collector: fix -Wformat-security compile warns

2024-05-21 Thread Steven Rostedt
On Tue, 21 May 2024 09:11:08 -0600 Shuah Khan wrote: > Any thoughts on this patch? Sorry, this one fell through the cracks. Daniel Bristot has been maintaining his tools and I thought this was one of his changes. I'll take a look at it. -- Steve

Re: UBSAN: shift-out-of-bounds in validate_sb_layout

2024-05-20 Thread Steven Rostedt
On Mon, 20 May 2024 15:02:26 +0800 "Ubisectech Sirius" wrote: > Hello. > We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. > Recently, our team has discovered a issue in Linux kernel 6.7. Attached to > the email were a PoC file of the issue. > > Stack dump: > UBSAN:

Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-05-20 Thread Steven Rostedt
On Fri, 17 May 2024 15:40:08 +0200 Petr Pavlu wrote: > The reader code in rb_get_reader_page() swaps a new reader page into the > ring buffer by doing cmpxchg on old->list.prev->next to point it to the > new page. Following that, if the operation is successful, > old->list.next->prev gets

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Steven Rostedt
On Fri, 17 May 2024 10:36:37 -0700 Guenter Roeck wrote: > Building csky:allmodconfig (and others) ... failed > -- > Error log: > In file included from include/trace/trace_events.h:419, > from include/trace/define_trace.h:102, > from

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Steven Rostedt
On Fri, 17 May 2024 10:08:51 +0300 Jani Nikula wrote: > On Thu, 16 May 2024, Steven Rostedt wrote: > > There's over 700 users of __assign_str() and because coccinelle does not > > handle the TRACE_EVENT() macro I ended up using the following sed script: > > > >

[PATCH] ring-buffer: Add cast to unsigned long addr passed to virt_to_page()

2024-05-14 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The sub-buffer pages are held in an unsigned long array, and when it is passed to virt_to_page() a cast is needed. Link: https://lore.kernel.org/all/20240515124808.06279...@canb.auug.org.au/ Fixes: 117c39200d9d ("ring-buffer: Introducing ring

Re: [PATCH v22 2/5] ring-buffer: Introducing ring-buffer mapping functions

2024-05-10 Thread Steven Rostedt
On Fri, 10 May 2024 12:03:12 +0100 Vincent Donnefort wrote: > > I'm not particularly happy about us calling vm_insert_pages with NULL > > pointers stored in pages. > > > > Should we instead do > > > > if (WARN_ON_ONCE(s >= nr_subbufs)) { > > err = -EINVAL; > > goto out; > > } > > > >

Re: [PATCH v22 2/5] ring-buffer: Introducing ring-buffer mapping functions

2024-05-07 Thread Steven Rostedt
On Tue, 30 Apr 2024 12:13:51 +0100 Vincent Donnefort wrote: > +#ifdef CONFIG_MMU > +static int __rb_map_vma(struct ring_buffer_per_cpu *cpu_buffer, > + struct vm_area_struct *vma) > +{ > + unsigned long nr_subbufs, nr_pages, vma_pages, pgoff = vma->vm_pgoff; > +

Re: [PATCH net-next v9] net/ipv4: add tracepoint for icmp_send

2024-05-07 Thread Steven Rostedt
by: xu xin > Reviewed-by: Yunkai Zhang > Cc: Yang Yang > Cc: Liu Chun > Cc: Xuexin Jiang > --- From just a tracing point of view: Reviewed-by: Steven Rostedt (Google) -- Steve

Re: [PATCH v8 13/17] x86/ftrace: enable dynamic ftrace without CONFIG_MODULES

2024-05-06 Thread Steven Rostedt
| 10 -- > 2 files changed, 1 insertion(+), 10 deletions(-) Reviewed-by: Steven Rostedt (Google) -- Steve

Re: [PATCH v8 06/17] mm: introduce execmem_alloc() and execmem_free()

2024-05-06 Thread Steven Rostedt
Trampolines can only be created if modules are supported */ > diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c Acked-by: Steven Rostedt (Google) -- Steve

Re: ftrace_direct_func_count ?

2024-05-06 Thread Steven Rostedt
On Sat, 4 May 2024 13:35:26 + "Dr. David Alan Gilbert" wrote: > Hi, > I've just posted a patch 'ftrace: Remove unused list 'ftrace_direct_funcs'' > that clears out some old code, but while at it I noticed the global > 'ftrace_direct_func_count'. > > As far as I can tell, it's never

Re: [PATCH resend ftrace] Asynchronous grace period for register_ftrace_direct()

2024-05-02 Thread Steven Rostedt
On Thu, 2 May 2024 16:13:59 -0700 "Paul E. McKenney" wrote: > Very good, and thank you! > > I will drop it from RCU as soon as it shows up in either -next or in > mainline. Sounds good. I'm currently working on updates to get into -rc7 and plan to add my next work on top of that (I know, I

Re: [PATCH v2 1/2] tracing/user_events: Fix non-spaced field matching

2024-05-02 Thread Steven Rostedt
On Thu, 2 May 2024 15:58:53 -0700 Beau Belgrave wrote: > It's not an issue on the matching/logic. However, you do get an extra > byte alloc (which doesn't bother me in this edge case). Figured as much, but since there was no mention of it, I decided to bring it up. I'll take this as-is then.

Re: [PATCH resend ftrace] Asynchronous grace period for register_ftrace_direct()

2024-05-02 Thread Steven Rostedt
> > Thank you, > > > > > [1] > > > https://lore.kernel.org/all/cover.1710877680.git@cloudflare.com/ > > > > > > Reported-by: Jakub Kicinski > > > Reported-by: Alexei Starovoitov > > > Reported-by: Chris Mason > > >

Re: [PATCH v2 1/2] tracing/user_events: Fix non-spaced field matching

2024-05-02 Thread Steven Rostedt
On Tue, 23 Apr 2024 16:23:37 + Beau Belgrave wrote: > When the ABI was updated to prevent same name w/different args, it > missed an important corner case when fields don't end with a space. > Typically, space is used for fields to help separate them, like > "u8 field1; u8 field2". If no

Re: [PATCH v3] ftrace: Fix possible use-after-free issue in ftrace_location()

2024-05-02 Thread Steven Rostedt
On Wed, 17 Apr 2024 11:28:30 +0800 Zheng Yejian wrote: > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index da1710499698..e05d3e3dc06a 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -1581,7 +1581,7 @@ static struct dyn_ftrace *lookup_rec(unsigned long >

[PATCH v3 6/6] eventfs: Have "events" directory get permissions from its parent

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The events directory gets its permissions from the root inode. But this can cause an inconsistency if the instances directory changes its permissions, as the permissions of the created directories under it should inherit the permissions of the instances

[PATCH v3 5/6] eventfs: Do not treat events directory different than other directories

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Treat the events directory the same as other directories when it comes to permissions. The events directory was considered different because it's dentry is persistent, whereas the other directory dentries are created when accessed. But the way tracefs no

[PATCH v3 2/6] tracefs: Reset permissions on remount if permissions are options

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" There's an inconsistency with the way permissions are handled in tracefs. Because the permissions are generated when accessed, they default to the root inode's permission if they were never set by the user. If the user sets the permissions, then a f

[PATCH v3 4/6] eventfs: Do not differentiate the toplevel events directory

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The toplevel events directory is really no different than the events directory of instances. Having the two be different caused inconsistencies and made it harder to fix the permissions bugs. Make all events directories act the same. Cc: sta...@vger.

[PATCH v3 1/6] eventfs: Free all of the eventfs_inode after RCU

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The freeing of eventfs_inode via a kfree_rcu() callback. But the content of the eventfs_inode was being freed after the last kref. This is dangerous, as changes are being made that can access the content of an eventfs_inode from an RCU loop. Instea

[PATCH v3 3/6] tracefs: Still use mount point as default permissions for instances

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" If the instances directory's permissions were never change, then have it and its children use the mount point permissions as the default. Currently, the permissions of instance directories are determined by the instance directory's permissi

[PATCH v3 0/6] tracefs/eventfs: Fix inconsistent permissions

2024-05-02 Thread Steven Rostedt
that the iteration of the list only needs to be protected by rcu_read_lock(). Steven Rostedt (Google) (6): eventfs: Free all of the eventfs_inode after RCU tracefs: Reset permissions on remount if permissions are options tracefs: Still use mount point as default permissions for instances

Re: [PATCH v2 1/5] tracefs: Reset permissions on remount if permissions are options

2024-05-02 Thread Steven Rostedt
On Thu, 02 May 2024 11:15:48 -0400 Steven Rostedt wrote: > +/* > + * On a remount of tracefs, if UID or GID options are set, then > + * the mount point inode permissions should be used. > + * Reset the saved permission flags appropriately. > + */ > +void eventfs_remount(struct

[PATCH v2 5/5] eventfs: Have "events" directory get permissions from its parent

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The events directory gets its permissions from the root inode. But this can cause an inconsistency if the instances directory changes its permissions, as the permissions of the created directories under it should inherit the permissions of the instances

[PATCH v2 4/5] eventfs: Do not treat events directory different than other directories

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Treat the events directory the same as other directories when it comes to permissions. The events directory was considered different because it's dentry is persistent, whereas the other directory dentries are created when accessed. But the way tracefs no

[PATCH v2 0/5] tracefs/eventfs: Fix inconsistent permissions

2024-05-02 Thread Steven Rostedt
the node from the link list, and free the node via call_rcu() so that the iteration of the list only needs to be protected by rcu_read_lock(). Steven Rostedt (Google) (5): tracefs: Reset permissions on remount if permissions are options tracefs: Still use mount point as default

[PATCH v2 2/5] tracefs: Still use mount point as default permissions for instances

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" If the instances directory's permissions were never change, then have it and its children use the mount point permissions as the default. Currently, the permissions of instance directories are determined by the instance directory's permissi

[PATCH v2 3/5] eventfs: Do not differentiate the toplevel events directory

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The toplevel events directory is really no different than the events directory of instances. Having the two be different caused inconsistencies and made it harder to fix the permissions bugs. Make all events directories act the same. Cc: sta...@vger.

[PATCH v2 1/5] tracefs: Reset permissions on remount if permissions are options

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" There's an inconsistency with the way permissions are handled in tracefs. Because the permissions are generated when accessed, they default to the root inode's permission if they were never set by the user. If the user sets the permissions, then a f

Re: [PATCH] tracing: Fix uaf issue in tracing_open_file_tr

2024-05-02 Thread Steven Rostedt
On Thu, 2 May 2024 06:49:18 + Tze-nan Wu (吳澤南) wrote: > Good news, this patch works, the test has passed, no more Kasan report > in my environment. Great to hear! > > my environment: > arm64 + kasan + swtag based kasan + kernel-6.6.18 > > Really appreciate, and learn a lot from the

Re: [PATCH v22 2/5] ring-buffer: Introducing ring-buffer mapping functions

2024-05-02 Thread Steven Rostedt
On Thu, 2 May 2024 14:38:32 +0100 Vincent Donnefort wrote: > > > + while (s < nr_subbufs && p < nr_pages) { > > > + struct page *page = virt_to_page(cpu_buffer->subbuf_ids[s]); > > > + int off = 0; > > > + > > > + for (; off < (1 << (subbuf_order)); off++, page++) { > > >

Re: [PATCH] eventfs/tracing: Add callback for release of an eventfs_inode

2024-05-02 Thread Steven Rostedt
On Wed, 1 May 2024 23:56:26 +0900 Masami Hiramatsu (Google) wrote: > Looks good to me. > > Reviewed-by: Masami Hiramatsu (Google) Thanks Masami, Although Tze-nan pointed out a issue with this patch. I just published v2, can you review that one too? Thanks, -- Steve

[PATCH v2] eventfs/tracing: Add callback for release of an eventfs_inode

2024-05-02 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Synthetic events create and destroy tracefs files when they are created and removed. The tracing subsystem has its own file descriptor representing the state of the events attached to the tracefs files. There's a race between the eventfs files and

Re: [PATCH] tracing: Fix uaf issue in tracing_open_file_tr

2024-05-01 Thread Steven Rostedt
On Thu, 2 May 2024 03:10:24 + Tze-nan Wu (吳澤南) wrote: > > > Sorry for my late reply, I'm testing the patch on my machine now. > Test will be done in four hours. > > There's something I'm worrying about in the patch, > what I'm worrying about is commented in the code below. > >

[PATCH 5/5] eventfs: Have "events" directory get permissions from its parent

2024-05-01 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The events directory gets its permissions from the root inode. But this can cause an inconsistency if the instances directory changes its permissions, as the permissions of the created directories under it should inherit the permissions of the instances

[PATCH 4/5] eventfs: Do not treat events directory different than other directories

2024-05-01 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Treat the events directory the same as other directories when it comes to permissions. The events directory was considered different because it's dentry is persistent, whereas the other directory dentries are created when accessed. But the way tracefs no

[PATCH 3/5] eventfs: Do not differentiate the toplevel events directory

2024-05-01 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The toplevel events directory is really no different than the events directory of instances. Having the two be different caused inconsistencies and made it harder to fix the permissions bugs. Make all events directories act the same. Cc: sta...@vger.

[PATCH 2/5] tracefs: Still use mount point as default permissions for instances

2024-05-01 Thread Steven Rostedt
From: "Steven Rostedt (Google)" If the instances directory's permissions were never change, then have it and its children use the mount point permissions as the default. Currently, the permissions of instance directories are determined by the instance directory's permissi

[PATCH 0/5] tracefs/eventfs: Fix inconsistent permissions

2024-05-01 Thread Steven Rostedt
. Steven Rostedt (Google) (5): tracefs: Reset permissions on remount if permissions are options tracefs: Still use mount point as default permissions for instances eventfs: Do not differentiate the toplevel events directory eventfs: Do not treat events directory different than

[PATCH 1/5] tracefs: Reset permissions on remount if permissions are options

2024-05-01 Thread Steven Rostedt
From: "Steven Rostedt (Google)" There's an inconsistency with the way permissions are handled in tracefs. Because the permissions are generated when accessed, they default to the root inode's permission if they were never set by the user. If the user sets the permissions, then a f

[PATCH] eventfs/tracing: Add callback for release of an eventfs_inode

2024-04-30 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Synthetic events create and destroy tracefs files when they are created and removed. The tracing subsystem has its own file descriptor representing the state of the events attached to the tracefs files. There's a race between the eventfs files and

Re: [PATCH] tracing: Fix uaf issue in tracing_open_file_tr

2024-04-29 Thread Steven Rostedt
On Sun, 28 Apr 2024 20:28:37 -0400 Steven Rostedt wrote: > > Looking for any suggestion or solution, appreciate. > > Yeah, I do not think eventfs should be involved in this. It needs to be > protected at a higher level (in the synthetic/dynamic event code). > > I'm

Re: [PATCH] tracing: Fix uaf issue in tracing_open_file_tr

2024-04-28 Thread Steven Rostedt
On Fri, 26 Apr 2024 15:34:08 +0800 Tze-nan wu wrote: > "tracing_event_file" is at the risk of use-after-free due to the race of > two functions "tracing_open_file_tr" and "synth_event_release". > Specifically, it could be freed by synth_event_release before > tracing_open_file_tr has the

Re: [PATCH v9 00/36] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-04-28 Thread Steven Rostedt
On Thu, 25 Apr 2024 13:31:53 -0700 Andrii Nakryiko wrote: I'm just coming back from Japan (work and then a vacation), and catching up on my email during the 6 hour layover in Detroit. > Hey Masami, > > I can't really review most of that code as I'm completely unfamiliar > with all those inner

Re: [PATCH v20 2/5] ring-buffer: Introducing ring-buffer mapping functions

2024-04-28 Thread Steven Rostedt
On Tue, 23 Apr 2024 12:04:15 -0400 "Liam R. Howlett" wrote: > > Nit: For all labels, please add a space before them. Otherwise, diffs will > > show "unlock" as the function and not "ring_buffer_map", making it harder > > to find where the change is. > > > > Isn't the inclusion of a space

Re: [PATCH] ftrace: Replace ftrace_disabled variable with ftrace_is_dead function

2024-04-27 Thread Steven Rostedt
On Sat, 20 Apr 2024 11:50:29 +0800 "Bang Li" wrote: > Thank you for your explanation, let me understand this. How about > replacing ftrace_disabled with unlike(ftrace_disabled)? Why? They are slow paths. No need to optimize them. -- Steve

Re: [PATCH v9 07/36] function_graph: Allow multiple users to attach to function graph

2024-04-19 Thread Steven Rostedt
On Mon, 15 Apr 2024 21:50:20 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -27,23 +28,157 @@ > > #define FGRAPH_RET_SIZE sizeof(struct ftrace_ret_stack) > #define FGRAPH_RET_INDEX DIV_ROUND_UP(FGRAPH_RET_SIZE, sizeof(long)) > + > +/* > + * On entry to a function (via function_graph_enter()),

Re: [PATCH net-next v6 0/7] Implement reset reason mechanism to detect

2024-04-19 Thread Steven Rostedt
On Fri, 19 Apr 2024 16:00:20 +0800 Jason Xing wrote: > If other experts see this thread, please help me. I would appreciate > it. I have strong interests and feel strong responsibility to > implement something like this patch series. It can be very useful!! I'm not a networking expert, but as

Re: [PATCH] ftrace: Replace ftrace_disabled variable with ftrace_is_dead function

2024-04-19 Thread Steven Rostedt
On Fri, 19 Apr 2024 22:38:44 +0800 "Bang Li" wrote: > Use the existing function ftrace_is_dead to replace the variable to make > the code clearer. > > Signed-off-by: Bang Li > --- > kernel/trace/ftrace.c | 46 +-- > 1 file changed, 23 insertions(+), 23

Re: [PATCH v9 00/36] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-04-19 Thread Steven Rostedt
d new flag to skip timestamp recording. > > > > Overview > > > > This series does major 2 changes, enable multiple function-graphs on > > the ftrace (e.g. allow function-graph on sub instances) and rewrite the > > fprobe on this function-graph. > >

Re: [PATCH v20 2/5] ring-buffer: Introducing ring-buffer mapping functions

2024-04-18 Thread Steven Rostedt
On Thu, 18 Apr 2024 09:55:55 +0300 Mike Rapoport wrote: Hi Mike, Thanks for doing this review! > > +/** > > + * struct trace_buffer_meta - Ring-buffer Meta-page description > > + * @meta_page_size:Size of this meta-page. > > + * @meta_struct_len: Size of this structure. > > + *

Re: [PATCH for-next v2] tracing/kprobes: Add symbol counting check when module loads

2024-04-15 Thread Steven Rostedt
On Mon, 15 Apr 2024 18:40:23 +0900 "Masami Hiramatsu (Google)" wrote: > Check the number of probe target symbols in the target module when > the module is loaded. If the probe is not on the unique name symbols > in the module, it will be rejected at that point. > > Note that the symbol which

[PATCH] ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value

2024-04-15 Thread Steven Rostedt
() to convert it to its value: (((REC->path_dir) == 1) ? "->" : "<-") So that user space tools, such as perf and trace-cmd, can parse it correctly. Reported-by: Luca Ceresoli Fixes: 6e588a0d839b5 ("ASoC: dapm: Consolidate path trace events") Signed-off-by:

Re: TP_printk() bug with %c, and more?

2024-04-15 Thread Steven Rostedt
On Tue, 16 Apr 2024 04:08:46 +0200 Luca Ceresoli wrote: > Thanks for the insight. I'm definitely trying to fix this based on your > hint as soon as I get my hand on a board. I have a patch I forgot to send out. Let me do that now. -- Steve

Re: TP_printk() bug with %c, and more?

2024-04-15 Thread Steven Rostedt
On Mon, 18 Mar 2024 16:43:07 +0100 Luca Ceresoli wrote: > However the arrows are still reversed. This requires a kernel change. The problem is that the print fmt has: print fmt: "%c%s %s %s %s %s", (int) REC->path_node && (int) REC->path_connect ? '*' : ' ', __get_str(wname),

Re: [RFC PATCH 0/4] perf: Correlating user process data to samples

2024-04-13 Thread Steven Rostedt
On Sat, 13 Apr 2024 12:53:38 +0200 Peter Zijlstra wrote: > On Fri, Apr 12, 2024 at 09:37:24AM -0700, Beau Belgrave wrote: > > > > Anyway, since we typically run stuff from NMI context, accessing user > > > data is 'interesting'. As such I would really like to make this work > > > depend on the

Re: [PATCH v2] tracing: Add sched_prepare_exec tracepoint

2024-04-11 Thread Steven Rostedt
On Thu, 11 Apr 2024 08:15:05 -0700 Kees Cook wrote: > This looks good to me. If tracing wants to take it: > > Acked-by: Kees Cook > > If not, I can take it in my tree if I get a tracing Ack. :) You can take it. Acked-by: Steven Rostedt (Google) -- Steve

[PATCH v2 11/11] tracing: Update function tracing output for previous boot buffer

2024-04-10 Thread Steven Rostedt
From: "Steven Rostedt (Google)" For a persistent ring buffer that is saved across boots, if function tracing was performed in the previous boot, it only saves the address of the functions and uses "%pS" to print their names. But the current boot, those functions may be in

[PATCH v2 10/11] tracing: Handle old buffer mappings for event strings and functions

2024-04-10 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Use the saved text_delta and data_delta of a persistent memory mapped ring buffer that was saved from a previous boot, and use the delta in the trace event print output so that strings and functions show up normally. That is, for an event like tra

[PATCH v2 09/11] tracing/ring-buffer: Add last_boot_info file to boot instance

2024-04-10 Thread Steven Rostedt
From: "Steven Rostedt (Google)" If an instance is mapped to memory on boot up, create a new file called "last_boot_info" that will hold information that can be used to properly parse the raw data in the ring buffer. It will export the delta of the addresses for tex

  1   2   3   4   5   6   7   8   9   10   >