[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230920182035.2f2dde44@gandalf.local.home>
Date: Wed, 20 Sep 2023 18:20:35 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
Mark Rutland <mark.rutland@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ajay Kaher <akaher@...are.com>, chinglinyu@...gle.com,
lkp@...el.com, namit@...are.com, oe-lkp@...ts.linux.dev,
amakhalov@...are.com, er.ajay.kaher@...il.com,
srivatsa@...il.mit.edu, tkundu@...are.com, vsirnapalli@...are.com
Subject: Re: [PATCH 1/2 v3] eventfs: Remove eventfs_file and just use
eventfs_inode
On Tue, 19 Sep 2023 21:18:04 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> Hmm, actually looking at this, it's worse than what you stated. This is
> called when a directory is closed. So if you had:
>
> open(dir);
>
> // look at all the content of this dir to create dentries
>
> // another task creates a new entry and looks at it too.
>
> close(dir);
>
> Now we iterate over all the dentries of the dir and dput it.
>
> I think this will cause the ref counts to get out of sync. I'll have to try
> to create this scenario and see what happens.
And yes it does break :-p
Even without this patch it breaks. That is, this bug exists currently upstream.
I run the attached file (requires libtracefs)
and then run:
# cd /sys/kernel/tracing
# echo 99999999 > buffer_size_kb&
Wait a bit.
This will cause the ref counts to go negative.
Then do a: trace-cmd reset
Which will remove the kprobes created by the attached program, and will
crash the kernel :-p
I have an idea on how to fix it. Let my try it out.
-- Steve
View attachment "test_eventfs_dir.c" of type "text/x-c++src" (2049 bytes)
Powered by blists - more mailing lists