diff options
author | Andrey Markovytch <andreym@codeaurora.org> | 2015-07-30 11:45:29 +0300 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:24:11 -0700 |
commit | 36f1ad69fd10838dc90d31e692a318c4992cd48b (patch) | |
tree | dea452ec92fd4c8804a98876b32bb5df6a4e33bd /fs/ecryptfs/events.c | |
parent | aaf495b3ab5c8476bffdd2d1e4ec3157268647c1 (diff) |
eCryptfs: fixed some major bugs
1. Fixed bug which didn't allow several threads to work simultaneously
on files in eCryptfs mounted folder
2. Fixed bug where PFK close callback was invoked multiple times when
files was opened and closed multiple times. Now it is invoked just once
when files is closed for the last time
Change-Id: Iaa3ada03500e5a12752918b5d2bb4a852ddca5f0
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Diffstat (limited to 'fs/ecryptfs/events.c')
-rw-r--r-- | fs/ecryptfs/events.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ecryptfs/events.c b/fs/ecryptfs/events.c index 0e970fa70996..043ea39c4901 100644 --- a/fs/ecryptfs/events.c +++ b/fs/ecryptfs/events.c @@ -176,6 +176,7 @@ size_t ecryptfs_get_key_size(void *data) size_t ecryptfs_get_salt_size(void *data) { struct ecryptfs_crypt_stat *stat = NULL; + unsigned char final[2*ECRYPTFS_MAX_CIPHER_NAME_SIZE+1]; if (!data) { ecryptfs_printk(KERN_ERR, @@ -186,7 +187,8 @@ size_t ecryptfs_get_salt_size(void *data) stat = (struct ecryptfs_crypt_stat *)data; return ecryptfs_get_salt_size_for_cipher( ecryptfs_get_full_cipher(stat->cipher, - stat->cipher_mode)); + stat->cipher_mode, + final, sizeof(final))); } @@ -196,7 +198,7 @@ size_t ecryptfs_get_salt_size(void *data) */ const unsigned char *ecryptfs_get_cipher(void *data) { - + unsigned char final[2*ECRYPTFS_MAX_CIPHER_NAME_SIZE+1]; struct ecryptfs_crypt_stat *stat = NULL; if (!data) { @@ -205,7 +207,8 @@ const unsigned char *ecryptfs_get_cipher(void *data) return NULL; } stat = (struct ecryptfs_crypt_stat *)data; - return ecryptfs_get_full_cipher(stat->cipher, stat->cipher_mode); + return ecryptfs_get_full_cipher(stat->cipher, stat->cipher_mode, + final, sizeof(final)); } /** |