eCryptfs: Decrypt symlink target for stat size
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>
Mon, 22 Mar 2010 05:41:35 +0000 (00:41 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:33 +0000 (07:41 -0700)
commit0bee0a7baf562b6094b1da266c46ec0acec5d7e6
treed1e2bd363c23672c6bf9ba54fca8b2ed49e915fd
parentc1fd3a9cbe9d26e14c1fb2c820c906fdc6b068a0
eCryptfs: Decrypt symlink target for stat size

commit 3a60a1686f0d51c99bd0df8ac93050fb6dfce647 upstream.

Create a getattr handler for eCryptfs symlinks that is capable of
reading the lower target and decrypting its path.  Prior to this patch,
a stat's st_size field would represent the strlen of the encrypted path,
while readlink() would return the strlen of the decrypted path.  This
could lead to confusion in some userspace applications, since the two
values should be equal.

https://bugs.launchpad.net/bugs/524919

Reported-by: Loïc Minier <loic.minier@canonical.com>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ecryptfs/inode.c