OSDN Git Service

eCryptfs: fix permission denied with ecryptfs_xattr mount option when create readonly...
authorRobbie Ko <robbieko@synology.com>
Tue, 21 Aug 2018 08:17:40 +0000 (16:17 +0800)
committerTyler Hicks <tyhicks@canonical.com>
Sat, 16 Feb 2019 23:18:57 +0000 (23:18 +0000)
commitd43388dea04b18f516bd7c837d9222fe7309b12d
tree49ecee9a2b01849ef2cd7d8bb340a6311969f54a
parent4b47a8b51e7bc0bcd1fa8e546a6333a04ab760d8
eCryptfs: fix permission denied with ecryptfs_xattr mount option when create readonly file

When the ecryptfs_xattr mount option is turned on, the ecryptfs
metadata will be written to xattr via vfs_setxattr, which will
check the WRITE permissions.

However, this will cause denial of permission when creating a
file withoug write permission.

So fix this by calling __vfs_setxattr directly to skip permission
check.

Signed-off-by: Robbie Ko <robbieko@synology.com>
[tyhicks: Copy up lower inode attributes when successful]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
fs/ecryptfs/crypto.c