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 BF3B9277C8A; Wed, 17 Sep 2025 20:46:47 +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=1758142009; cv=none; b=Bqv+dSYMpO7Wm9LIr/mVt76gHcHqaNMXQiq8KrAcAstwfl8G+8PVneheO9aywMHttoAB4niVjJIqcNb45nthpMb9QCLML8tCvUrp92uu7QufylrrjgB1zRfyUjGuuhzHKDonAOyTgXvPCRieUT1RCusf34f5bcrWtuwEMUQWHWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758142009; c=relaxed/simple; bh=uIun9QFzl3LeXOGiX/5tJwz7Yglvx13McHScv+ZZybE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rJlgIy/HtTrMg2JzuJgZt1z0PEh8EJpmPzgP3uPn7b/yMJvWYMOdkNJXqS+7NPR07iNR3xRoUOqC4o2sqCPhTujpuC+syLKpkyEQmnb+YRtCRCNjg4oGlzXsREyXI2kfYjowJjjx1l+5HrGOP3aQ3IFyQOMa5CGc5TGSzWddTbA= 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=rVD7Ywv0; 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="rVD7Ywv0" 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=+xTNLmr82yCIG6ykRBw7UqLF/vhCLhwnMm6IP4Jqnss=; b=rVD7Ywv076+SZ0KBpBwwpCL+3y 4a3VLKiCodruLJ1FR7pzgXGQPWZncQThl7GXLrgL0Zd6COgD5xwtIkU05QctyLNav8tliPCIe40fz G0tPNAhz3ZLCW+tx1hYTn4xcgJKMfAjjmYDKEjTEqCmV5f0In5BEDqWxzzZ76GSvLn+OSsbjTbB9f MSN2Im71Gq4S5/cFEflhKwDe4CZWrKbBlA2ycHdPEa6r9fI1UP59cD0j3OKvNn+MivPb1pwimaTRc 0/oH0m2Vfq4kDQkJwlT5elDFPyE59LeJEyuKWtndGzkOUbliUFWS9i7BPtMiRl1BZTsN7m4vjrPpm xCj1WQiA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1uyz37-000000089QW-2x1E; Wed, 17 Sep 2025 20:46:45 +0000 Date: Wed, 17 Sep 2025 21:46:45 +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: <20250917204645.GC39973@ZenIV> References: <20250915101510.7994-1-acsjakub@amazon.de> <20250917204200.GB39973@ZenIV> 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: <20250917204200.GB39973@ZenIV> Sender: Al Viro On Wed, Sep 17, 2025 at 09:42:00PM +0100, Al Viro wrote: > 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? PS: there is a whole lot of the logics in e.g. shrink_dcache_for_umount() that relies on nobody else messing with dentry tree by that point.