From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 43B111A3165 for ; Fri, 3 Oct 2025 07:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759475470; cv=none; b=AzOdZ/buYYIbR9H31gGMZ/FD7PawNn2a3HE5gSarSqiYExGXFrk/W4BAmZjfP961d3jz4SvrnoiKuXNdBLgj6yskCNFlQfwpJ4tQ2e2xxXaGTM67pGYKksWDLosxO5Z6WsamdR/HdJ5M490pMS6kB+9bGNS+0kmTT6g6FQKwSZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759475470; c=relaxed/simple; bh=073F3x5FsmqCQaMrTtiAPGp6oYG4gawighobG1aFJq4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=REGuqikcj/b/E3uszlwzXGfaIoKy9p3h8XVL6O2KR7xSGMFLgEt9p1+9Ow8SqFyIjpNjUWZT7QDrzDU6Z5LCY2ukziHB45709f/Xfxn4ETXgFhijLkKIzpKsd0ASoFokS0mLwYGNIhhl/pbmUFOFSgEfoi2NP1J3RCvLHYajSKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=h6/0+5bc; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="h6/0+5bc" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=p7c51HJPQl5UA2fnUSh1f8uMVYvRbRLDr8jsZxhyO8Y=; b=h6/0+5bc1QoS6Qekd41n04Dr97 heISAqI7p4alWUrKGgXJiEz6USyW+itqmyXcNph3opYr0JhGR/ljzelPj3QbiIOEaUrvoN38veM8x VmwHTzVbl2Q4o2tEelge3fyEKSfwaMp148gvqIcKZjr+VGgnjfdVEMOLyqk3rTqC5i91F8Tqu6FIb F8ioNinQcDdumtdjGHbKrQCzSyflFbPI9wiCvBbYW2l6RN91Y0QoetXIZDJWn3dMFKghFV2wS+45/ IyStedkzNMJI2zzkBEA2hqd8p9YI0DOw6pXX538TXxY98dyhmmX8wYvM9pTKdS5la+Wyy9bwH180+ D2mms6Ow==; Received: from hch by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1v4ZwZ-0000000BnOL-1xej; Fri, 03 Oct 2025 07:11:07 +0000 Date: Fri, 3 Oct 2025 00:11:07 -0700 From: Christoph Hellwig To: Chuck Lever Cc: NeilBrown , Jeff Layton , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org, Chuck Lever Subject: Re: [PATCH v5 5/6] NFSD: Prevent a NULL pointer dereference in fh_getattr() Message-ID: References: <20250929155646.4818-1-cel@kernel.org> <20250929155646.4818-6-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@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: <20250929155646.4818-6-cel@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, Sep 29, 2025 at 11:56:45AM -0400, Chuck Lever wrote: > From: Chuck Lever > > In general, fh_getattr() can be called after the target dentry has > gone negative. For a negative dentry, d_inode(p.dentry) will return > NULL. S_ISREG() will dereference that pointer. > > Avoid this potential regression by using the d_is_reg() helper > instead. > > Suggested-by: NeilBrown > Fixes: bc70aaeba7df ("NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support") Fixed for existing bugs should usually go first and/or be split into a separate prep series. Otherwise: Reviewed-by: Christoph Hellwig