diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-17 17:16:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-17 17:16:21 -0500 |
commit | e0bcb42e602816415f6fe07313b6fc84932244b7 (patch) | |
tree | 36ece6403a56805a42332659f0762ce280bc936c /fs/ecryptfs/miscdev.c | |
parent | b6b220b0c76f0aa9cb5efb882424a7acc109d898 (diff) | |
parent | 4670269faba728683f7250319a65390946c028e3 (diff) |
Merge tag 'ecryptfs-4.15-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs
Pull eCryptfs updates from Tyler Hicks:
- miscellaneous code cleanups and refactoring
- fix a possible use after free bug when unloading the module
* tag 'ecryptfs-4.15-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
eCryptfs: constify attribute_group structures.
ecryptfs: remove unnecessary i_version bump
ecryptfs: use ARRAY_SIZE
ecryptfs: Adjust four checks for null pointers
ecryptfs: Return an error code only as a constant in ecryptfs_add_global_auth_tok()
ecryptfs: Delete 21 error messages for a failed memory allocation
eCryptfs: use after free in ecryptfs_release_messaging()
ecryptfs: remove private bin2hex implementation
ecryptfs: add missing \n to end of various error messages
Diffstat (limited to 'fs/ecryptfs/miscdev.c')
-rw-r--r-- | fs/ecryptfs/miscdev.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c index e4141f257495..f09cacaf8c80 100644 --- a/fs/ecryptfs/miscdev.c +++ b/fs/ecryptfs/miscdev.c | |||
@@ -163,12 +163,8 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, | |||
163 | struct ecryptfs_message *msg; | 163 | struct ecryptfs_message *msg; |
164 | 164 | ||
165 | msg = kmalloc((sizeof(*msg) + data_size), GFP_KERNEL); | 165 | msg = kmalloc((sizeof(*msg) + data_size), GFP_KERNEL); |
166 | if (!msg) { | 166 | if (!msg) |
167 | printk(KERN_ERR "%s: Out of memory whilst attempting " | ||
168 | "to kmalloc(%zd, GFP_KERNEL)\n", __func__, | ||
169 | (sizeof(*msg) + data_size)); | ||
170 | return -ENOMEM; | 167 | return -ENOMEM; |
171 | } | ||
172 | 168 | ||
173 | mutex_lock(&msg_ctx->mux); | 169 | mutex_lock(&msg_ctx->mux); |
174 | msg_ctx->msg = msg; | 170 | msg_ctx->msg = msg; |
@@ -383,7 +379,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf, | |||
383 | goto memdup; | 379 | goto memdup; |
384 | } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) { | 380 | } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) { |
385 | printk(KERN_WARNING "%s: Acceptable packet size range is " | 381 | printk(KERN_WARNING "%s: Acceptable packet size range is " |
386 | "[%d-%zu], but amount of data written is [%zu].", | 382 | "[%d-%zu], but amount of data written is [%zu].\n", |
387 | __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count); | 383 | __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count); |
388 | return -EINVAL; | 384 | return -EINVAL; |
389 | } | 385 | } |