d_validate

Name

d_validate --  verify dentry provided from insecure source

Synopsis

int d_validate (struct dentry * dentry, struct dentry * dparent, unsigned int hash, unsigned int len);

Arguments

dentry

The dentry alleged to be valid

dparent

The parent dentry

hash

Hash of the dentry

len

Length of the name

Description

An insecure source has sent us a dentry, here we verify it. This is used by ncpfs in its readdir implementation. Zero is returned in the dentry is invalid.

NOTE

This function does _not_ dereference the pointers before we have validated them. We can test the pointer values, but we must not actually use them until we have found a valid copy of the pointer in kernel space..