All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>, Jakub Acs <acsjakub@amazon.de>,
	linux-unionfs@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] ovl: check before dereferencing s_root field
Date: Wed, 17 Sep 2025 21:42:00 +0100	[thread overview]
Message-ID: <20250917204200.GB39973@ZenIV> (raw)
In-Reply-To: <CAOQ4uxgSQPQ6Vx4MLECPPxn35m8--1iL7_rUFEobBuROfEzq_A@mail.gmail.com>

On Wed, Sep 17, 2025 at 01:07:45PM +0200, Amir Goldstein wrote:

> diff --git a/fs/dcache.c b/fs/dcache.c
> index 60046ae23d514..8c9d0d6bb0045 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -1999,10 +1999,12 @@ struct dentry *d_make_root(struct inode *root_inode)
> 
>         if (root_inode) {
>                 res = d_alloc_anon(root_inode->i_sb);
> -               if (res)
> +               if (res) {
> +                       root_inode->i_opflags |= IOP_ROOT;
>                         d_instantiate(res, root_inode);

Umm...  Not a good idea - if nothing else, root may end up
being attached someplace (normal with nfs, for example).

But more fundamentally, once we are into ->kill_sb(), let alone
generic_shutdown_super(), nobody should be playing silly buggers
with the filesystem.  Sure, RCU accesses are possible, but messing
around with fhandles?  ->s_root is not the only thing that might
be no longer there.

What the fuck is fsnotify playing at?

  parent reply	other threads:[~2025-09-17 20:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 10:15 [PATCH] ovl: check before dereferencing s_root field Jakub Acs
2025-09-15 13:01 ` Amir Goldstein
2025-09-15 14:07   ` Jan Kara
2025-09-15 15:29     ` Amir Goldstein
2025-09-16 11:30       ` Jan Kara
2025-09-16 13:29         ` Amir Goldstein
2025-09-17  9:25           ` Jan Kara
2025-09-17 11:07             ` Amir Goldstein
2025-09-17 11:36               ` Jakub Acs
2025-09-17 14:42               ` Jan Kara
2025-09-17 17:51                 ` Amir Goldstein
2025-10-01 10:14                   ` Jakub Acs
2025-09-17 20:42               ` Al Viro [this message]
2025-09-17 20:46                 ` Al Viro
2025-09-18  9:59                 ` Jan Kara

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=20250917204200.GB39973@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=acsjakub@amazon.de \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=stable@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.