Linux Trace Kernel
 help / color / mirror / Atom feed
From: Steven Rostedt <steven@rostedt.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] eventfs: Use children field for rcu head and add memory barriers
Date: Fri, 7 Aug 2026 20:00:39 -0400	[thread overview]
Message-ID: <20260807200039.1bc728f3@gandalf.local.home> (raw)
In-Reply-To: <20260808071506.cacd0c21059c942a5d2d173b@kernel.org>

On Sat, 8 Aug 2026 07:15:06 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

 
> Looks good to me.
> 
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> The critical issues Sashiko mentioned will be fixed by Shuangpeng's patch[1].

No ;-) The critical issues Sashiko mentioned was from a review of that
patch which stated:

  "This isn't a bug introduced by this patch, but does this still leave
   concurrent SRCU readers vulnerable to list pointer corruption?"

Thus Shuangpeng's patch doesn't address it.

I was in the process of applying Shuangpeng's patch and I look at the
Sashiko review and wrote this patch to fix that issue too. I plan on
applying both.


> [1] https://lore.kernel.org/all/20260806022719.375354-1-shuangpeng.kernel@gmail.com/
> 
> Thank you,
> 
> > Reported-by: Sashiko <sashiko-bot@kernel.org>
> > Closes: https://sashiko.dev/#/patchset/20260806022719.375354-1-shuangpeng.kernel%40gmail.com
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> > ---
> >  fs/tracefs/event_inode.c | 24 ++++++++++++++++++++++++
> >  fs/tracefs/internal.h    |  4 ++--
> >  2 files changed, 26 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c
> > index 39c7a34531e8..677c39b0d62f 100644
> > --- a/fs/tracefs/event_inode.c
> > +++ b/fs/tracefs/event_inode.c
> > @@ -124,6 +124,16 @@ static inline void put_ei(struct eventfs_inode *ei)
> >  static inline void free_ei(struct eventfs_inode *ei)
> >  {
> >  	if (ei) {
> > +		WARN_ON_ONCE(!list_empty(&ei->children));
> > +		/*
> > +		 * The ei should have no children if it is being freed.
> > +		 * The SRCU iteration has a smp_rmb() to make sure it
> > +		 * sees a child (that may have already been freed)
> > +		 * before it reads is_free. If is_free is set, it must
> > +		 * not use the child it acquired from ei->children, as
> > +		 * the list may be used for SRCU.
> > +		 */
> > +		smp_wmb();
> >  		ei->is_freed = 1;

And Sashiko found a bug here (from reading the comments). The smp_wmb() is
supposed to be *after* the ei->is_free = 1 !!!

I'll send a v2.

-- Steve

> >  		put_ei(ei);
> >  	}

  reply	other threads:[~2026-08-08  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 21:04 [PATCH] eventfs: Use children field for rcu head and add memory barriers Steven Rostedt
2026-08-07 22:15 ` Masami Hiramatsu
2026-08-08  0:00   ` Steven Rostedt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-08 13:42 Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260807200039.1bc728f3@gandalf.local.home \
    --to=steven@rostedt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox