aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/messaging.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-11 13:20:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-11 13:20:18 -0400
commit746919d2668037f297595da9281a22cd558f3d18 (patch)
tree427ed5f852739537e6e378a98268fdf43c05a38e /fs/ecryptfs/messaging.c
parent9db019278cad416681e27b15203d4c5e939c315b (diff)
parentcc18ec3c8f5dd735c1bff5da30fd33860c08a293 (diff)
Merge tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs
Pull eCryptfs updates from Tyler Hicks: "Code cleanups and improved buffer handling during page crypto operations: - Remove redundant code by merging some encrypt and decrypt functions - Get rid of a helper page allocation during page decryption by using in-place decryption - Better use of entire pages during page crypto operations - Several code cleanups" * tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs: Use ecryptfs_dentry_to_lower_path in a couple of places eCryptfs: Make extent and scatterlist crypt function parameters similar eCryptfs: Collapse crypt_page_offset() into crypt_extent() eCryptfs: Merge ecryptfs_encrypt_extent() and ecryptfs_decrypt_extent() eCryptfs: Combine page_offset crypto functions eCryptfs: Combine encrypt_scatterlist() and decrypt_scatterlist() eCryptfs: Decrypt pages in-place eCryptfs: Accept one offset parameter in page offset crypto functions eCryptfs: Simplify lower file offset calculation eCryptfs: Read/write entire page during page IO eCryptfs: Use entire helper page during page crypto operations eCryptfs: Cocci spatch "memdup.spatch"
Diffstat (limited to 'fs/ecryptfs/messaging.c')
-rw-r--r--fs/ecryptfs/messaging.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index 49ff8ea08f1c..e57380e5f6bd 100644
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -247,14 +247,13 @@ int ecryptfs_process_response(struct ecryptfs_daemon *daemon,
247 goto unlock; 247 goto unlock;
248 } 248 }
249 msg_size = (sizeof(*msg) + msg->data_len); 249 msg_size = (sizeof(*msg) + msg->data_len);
250 msg_ctx->msg = kmalloc(msg_size, GFP_KERNEL); 250 msg_ctx->msg = kmemdup(msg, msg_size, GFP_KERNEL);
251 if (!msg_ctx->msg) { 251 if (!msg_ctx->msg) {
252 rc = -ENOMEM; 252 rc = -ENOMEM;
253 printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of " 253 printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of "
254 "GFP_KERNEL memory\n", __func__, msg_size); 254 "GFP_KERNEL memory\n", __func__, msg_size);
255 goto unlock; 255 goto unlock;
256 } 256 }
257 memcpy(msg_ctx->msg, msg, msg_size);
258 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE; 257 msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE;
259 wake_up_process(msg_ctx->task); 258 wake_up_process(msg_ctx->task);
260 rc = 0; 259 rc = 0;