From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E635B34BA47; Wed, 17 Sep 2025 20:42:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758141724; cv=none; b=nM0OcTMaEhYKwT2y1PHHq9I7zteg3KRLZ8zIrJs7jSRBvJxab05gUGC35CQXiLxWCDS5m3PfU5WWR9AEmZdtPWKrfeQWkwZz+mHfKn/RRV7SmOoPq/J7xMHHeOmzBTeAurwdms1cSDG0V5KoZnE92tsV3Jc8I2j78F6W5pEbh0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758141724; c=relaxed/simple; bh=GkCmDPW/1syrsYw1G+YvayDwOfOwzuCS/5C5ZTGXcbI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DDWGR9Pr+G9Xn5BsuUGv2RuKJlkBf8xnuveUYJnZnKRz/+INDxpRmJUWOQgyO1HXMpaQauarnnTvDAW4jCDAABNFirizmUuZhIp9J/76ohx/8etj/MIAMnjkHiuvcqVPv2rYJdPNdUaMGPpY5VT41uC357sRvkYygml91n/j8SA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=NNss7U4D; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="NNss7U4D" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rNKB4VtExzuPbc4Hd37NwogNpAaP97VYa9OnljT/b9E=; b=NNss7U4DEBakFnvQygITpcjDWe 12Ciy5WVlrHsRsn5cI32Mba/U4Z9Rbntizwj0kkYXgGSWcLQo6+zchYqjpsrAzdczp09xuT7oolf5 gzkhmdrW/Yr2LXKjEQtC+uQ+PtHtZtfk7RDX22uyyNpyYLAodm2UZiC92b2GJ9STuuZ9D7z+dlpnz umGb7+gGwvjPzi92nuT08LPP/oL+1m1/PoUwoWcq6mhCtWh11QcB+i9H6YnIED7zLvkIpmkI1RFwG dkzqPG7hRkICMHY57abE/CYGb7BfvsN7WRXgoQ4CjgRRd8OicK9TQtwfz0uXZ7nSGZcc77IUGIjjD ifEixOGg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1uyyyW-000000084Iv-1L50; Wed, 17 Sep 2025 20:42:00 +0000 Date: Wed, 17 Sep 2025 21:42:00 +0100 From: Al Viro To: Amir Goldstein Cc: Jan Kara , Jakub Acs , linux-unionfs@vger.kernel.org, Miklos Szeredi , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Christian Brauner , linux-fsdevel Subject: Re: [PATCH] ovl: check before dereferencing s_root field Message-ID: <20250917204200.GB39973@ZenIV> References: <20250915101510.7994-1-acsjakub@amazon.de> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro 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?