Re: `nd' parameter may be null for security_inode_permission()

From: Tony Jones (tonyj@private)
Date: Thu Oct 27 2005 - 10:19:12 PDT


On Thu, Oct 27, 2005 at 03:08:20PM +0800, Globe Trekker wrote:

> I tried to get `dentry' from `inode' but found it almost impossible

Indeed :-)

> I tried to figure out the situations in which the `nd' 
> parameter for security_inode_permission() hook is NULL but found it too 
> hard to accomplish.

Seths suggestion works (also, you can search for similar inside of cscope).

To confirm scenarios you find above, you can always add something (in your 
hook) like:

if (!nd)
	dump_stack();

Obviously, only for testing and assuming you don't have any frequent paths
through your code where this is true.

Last I looked, xattrs and files being accessed from nfsd were two significant
cases. 

Tony



This archive was generated by hypermail 2.1.3 : Thu Oct 27 2005 - 10:24:34 PDT