From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] vfs: check value of varaiable 'nd' before using its member Date: Wed, 4 Jul 2012 19:30:13 +0100 Message-ID: <20120704183013.GI22927@ZenIV.linux.org.uk> References: <1341394364-32289-1-git-send-email-robin.k.dong@gmail.com> <1341394749.2739.2.camel@menhir> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Robin Dong , linux-fsdevel@vger.kernel.org, Robin Dong To: Steven Whitehouse Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:35914 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755110Ab2GDSaR (ORCPT ); Wed, 4 Jul 2012 14:30:17 -0400 Content-Disposition: inline In-Reply-To: <1341394749.2739.2.camel@menhir> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jul 04, 2012 at 10:39:09AM +0100, Steven Whitehouse wrote: > Hi, > > On Wed, 2012-07-04 at 17:32 +0800, Robin Dong wrote: > > From: Robin Dong > > > > When we using lookup_one_len() to search pathname component, it will call __lookup_hash() > > with variable 'nd' as NULL : > > > > --> __lookup_hash ( nd = NULL ) > > --> lookup_dcache > > --> d_invalidate > > --> proc_sys_revalidate > > > > the proc_sys_revalidate will use 'nd->flags' before check whether its value is NULL. > > This will cause kernel panic. > > > > Therefore, we should adding check-code for filesystems which directly use nd->flags. > > > > Signed-off-by: Robin Dong > > nd will very shortly no longer be passed to revalidate... see this patch > in Al's vfs git tree: > Not to mention that anyone who tries to export procfs over nfs deserves Bad Things(tm) happening to them.... IOW, what the hell is your code trying to do?