Re: [PATCH] tracing: Have trace_event_file have ref counters

2023-11-01 Thread Steven Rostedt
On Wed, 1 Nov 2023 22:32:54 -0400 Steven Rostedt wrote: > > Ouch! I thought the file descriptor has been hold by the opened process. > > Well, the struct *filp is, but not the filp->private that points to the > struct trace_event_file *file. That was supposed to be "struct file *filp" -- Ste

Re: [PATCH] tracing: Have trace_event_file have ref counters

2023-11-01 Thread Steven Rostedt
On Thu, 2 Nov 2023 11:14:33 +0900 Masami Hiramatsu (Google) wrote: > > > > What happens here is that the kprobe event creates a trace_event_file > > "file" descriptor that represents the file in tracefs to the event. It > > maintains state of the event (is it enabled for the given instance?). > >

Re: [PATCH] tracing: Have trace_event_file have ref counters

2023-11-01 Thread Google
On Tue, 31 Oct 2023 12:24:53 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The following can crash the kernel: > > # cd /sys/kernel/tracing > # echo 'p:sched schedule' > kprobe_events > # exec 5>>events/kprobes/sched/enable > # > kprobe_events > # exec 5>&- > > The ab

Re: [PATCH] tracing: Have trace_event_file have ref counters

2023-10-31 Thread Beau Belgrave
On Tue, Oct 31, 2023 at 12:24:53PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The following can crash the kernel: > > # cd /sys/kernel/tracing > # echo 'p:sched schedule' > kprobe_events > # exec 5>>events/kprobes/sched/enable > # > kprobe_events > # exec 5>&- > > T

[PATCH] tracing: Have trace_event_file have ref counters

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The following can crash the kernel: # cd /sys/kernel/tracing # echo 'p:sched schedule' > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&- The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe