eCryptfs: ecryptfs_setattr() bugfix
commit34d85f595af946a9ab05d509160a3cb6015db42a
authorMichael Halcrow <mhalcrow@us.ibm.com>
Thu, 19 Jul 2007 08:47:54 +0000 (19 01:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Aug 2007 21:27:38 +0000 (9 14:27 -0700)
tree2ada94c416911b2fce4c411b23994630973f4f26
parentab257af4cb8140bd117c8ab44506bc657f713cb9
eCryptfs: ecryptfs_setattr() bugfix

There is another bug recently introduced into the ecryptfs_setattr()
function in 2.6.22.  eCryptfs will attempt to treat special files like
regular eCryptfs files on chmod, chown, and so forth.  This leads to a NULL
pointer dereference.  This patch validates that the file is a regular file
before proceeding with operations related to the inode's crypt_stat.

Thanks to Ryusuke Konishi for finding this bug and suggesting the fix.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ecryptfs/inode.c