aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2009-01-06 17:42:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:22 -0500
commita8f12864c52f8ab8520568dc97969c1749ae60bf (patch)
tree9b65cf578ce80fb0fc139371b7dd7594ed79a6f0 /fs/ecryptfs
parentdf261c52abdef147084c76ecf14473184e907547 (diff)
eCryptfs: Fix data types (int/size_t)
Correct several format string data type specifiers. Correct filename size data types; they should be size_t rather than int when passed as parameters to some other functions (although note that the filenames will never be larger than int). Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Cc: Dustin Kirkland <dustin.kirkland@gmail.com> Cc: Eric Sandeen <sandeen@redhat.com> Cc: Tyler Hicks <tchicks@us.ibm.com> Cc: David Kleikamp <shaggy@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r--fs/ecryptfs/crypto.c4
-rw-r--r--fs/ecryptfs/file.c2
-rw-r--r--fs/ecryptfs/inode.c2
-rw-r--r--fs/ecryptfs/keystore.c24
4 files changed, 16 insertions, 16 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 490b129311eb..e935a2224982 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -2093,7 +2093,7 @@ int ecryptfs_encrypt_and_encode_filename(
2093 filename = kzalloc(sizeof(*filename), GFP_KERNEL); 2093 filename = kzalloc(sizeof(*filename), GFP_KERNEL);
2094 if (!filename) { 2094 if (!filename) {
2095 printk(KERN_ERR "%s: Out of memory whilst attempting " 2095 printk(KERN_ERR "%s: Out of memory whilst attempting "
2096 "to kzalloc [%d] bytes\n", __func__, 2096 "to kzalloc [%zd] bytes\n", __func__,
2097 sizeof(*filename)); 2097 sizeof(*filename));
2098 rc = -ENOMEM; 2098 rc = -ENOMEM;
2099 goto out; 2099 goto out;
@@ -2127,7 +2127,7 @@ int ecryptfs_encrypt_and_encode_filename(
2127 (*encoded_name) = kmalloc((*encoded_name_size) + 1, GFP_KERNEL); 2127 (*encoded_name) = kmalloc((*encoded_name_size) + 1, GFP_KERNEL);
2128 if (!(*encoded_name)) { 2128 if (!(*encoded_name)) {
2129 printk(KERN_ERR "%s: Out of memory whilst attempting " 2129 printk(KERN_ERR "%s: Out of memory whilst attempting "
2130 "to kzalloc [%d] bytes\n", __func__, 2130 "to kzalloc [%zd] bytes\n", __func__,
2131 (*encoded_name_size)); 2131 (*encoded_name_size));
2132 rc = -ENOMEM; 2132 rc = -ENOMEM;
2133 kfree(filename->encrypted_filename); 2133 kfree(filename->encrypted_filename);
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 567eb4bee1b6..9e944057001b 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -82,7 +82,7 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen,
82{ 82{
83 struct ecryptfs_getdents_callback *buf = 83 struct ecryptfs_getdents_callback *buf =
84 (struct ecryptfs_getdents_callback *)dirent; 84 (struct ecryptfs_getdents_callback *)dirent;
85 int name_size; 85 size_t name_size;
86 char *name; 86 char *name;
87 int rc; 87 int rc;
88 88
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 38309ce94d71..7168a88cdbc1 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -362,7 +362,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
362 struct nameidata *ecryptfs_nd) 362 struct nameidata *ecryptfs_nd)
363{ 363{
364 char *encrypted_and_encoded_name = NULL; 364 char *encrypted_and_encoded_name = NULL;
365 int encrypted_and_encoded_name_size; 365 size_t encrypted_and_encoded_name_size;
366 struct ecryptfs_crypt_stat *crypt_stat = NULL; 366 struct ecryptfs_crypt_stat *crypt_stat = NULL;
367 struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL; 367 struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL;
368 struct ecryptfs_inode_info *inode_info; 368 struct ecryptfs_inode_info *inode_info;
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index e6a96e8f5e67..c90ca5dfc506 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -556,8 +556,8 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
556 goto out_unlock; 556 goto out_unlock;
557 } 557 }
558 if (s->max_packet_size > (*remaining_bytes)) { 558 if (s->max_packet_size > (*remaining_bytes)) {
559 printk(KERN_WARNING "%s: Require [%d] bytes to write; only " 559 printk(KERN_WARNING "%s: Require [%zd] bytes to write; only "
560 "[%d] available\n", __func__, s->max_packet_size, 560 "[%zd] available\n", __func__, s->max_packet_size,
561 (*remaining_bytes)); 561 (*remaining_bytes));
562 rc = -EINVAL; 562 rc = -EINVAL;
563 goto out_unlock; 563 goto out_unlock;
@@ -594,7 +594,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
594 mount_crypt_stat->global_default_fn_cipher_key_bytes); 594 mount_crypt_stat->global_default_fn_cipher_key_bytes);
595 if (s->cipher_code == 0) { 595 if (s->cipher_code == 0) {
596 printk(KERN_WARNING "%s: Unable to generate code for " 596 printk(KERN_WARNING "%s: Unable to generate code for "
597 "cipher [%s] with key bytes [%d]\n", __func__, 597 "cipher [%s] with key bytes [%zd]\n", __func__,
598 mount_crypt_stat->global_default_fn_cipher_name, 598 mount_crypt_stat->global_default_fn_cipher_name,
599 mount_crypt_stat->global_default_fn_cipher_key_bytes); 599 mount_crypt_stat->global_default_fn_cipher_key_bytes);
600 rc = -EINVAL; 600 rc = -EINVAL;
@@ -693,7 +693,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
693 printk(KERN_ERR "%s: Internal error whilst attempting to " 693 printk(KERN_ERR "%s: Internal error whilst attempting to "
694 "convert filename memory to scatterlist; " 694 "convert filename memory to scatterlist; "
695 "expected rc = 1; got rc = [%d]. " 695 "expected rc = 1; got rc = [%d]. "
696 "block_aligned_filename_size = [%d]\n", __func__, rc, 696 "block_aligned_filename_size = [%zd]\n", __func__, rc,
697 s->block_aligned_filename_size); 697 s->block_aligned_filename_size);
698 goto out_release_free_unlock; 698 goto out_release_free_unlock;
699 } 699 }
@@ -703,7 +703,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
703 printk(KERN_ERR "%s: Internal error whilst attempting to " 703 printk(KERN_ERR "%s: Internal error whilst attempting to "
704 "convert encrypted filename memory to scatterlist; " 704 "convert encrypted filename memory to scatterlist; "
705 "expected rc = 1; got rc = [%d]. " 705 "expected rc = 1; got rc = [%d]. "
706 "block_aligned_filename_size = [%d]\n", __func__, rc, 706 "block_aligned_filename_size = [%zd]\n", __func__, rc,
707 s->block_aligned_filename_size); 707 s->block_aligned_filename_size);
708 goto out_release_free_unlock; 708 goto out_release_free_unlock;
709 } 709 }
@@ -787,7 +787,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
787 s = kmalloc(sizeof(*s), GFP_KERNEL); 787 s = kmalloc(sizeof(*s), GFP_KERNEL);
788 if (!s) { 788 if (!s) {
789 printk(KERN_ERR "%s: Out of memory whilst trying to kmalloc " 789 printk(KERN_ERR "%s: Out of memory whilst trying to kmalloc "
790 "[%d] bytes of kernel memory\n", __func__, sizeof(*s)); 790 "[%zd] bytes of kernel memory\n", __func__, sizeof(*s));
791 goto out; 791 goto out;
792 } 792 }
793 s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP; 793 s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
@@ -825,8 +825,8 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
825 - ECRYPTFS_SIG_SIZE - 1); 825 - ECRYPTFS_SIG_SIZE - 1);
826 if ((1 + s->packet_size_len + s->parsed_tag_70_packet_size) 826 if ((1 + s->packet_size_len + s->parsed_tag_70_packet_size)
827 > max_packet_size) { 827 > max_packet_size) {
828 printk(KERN_WARNING "%s: max_packet_size is [%d]; real packet " 828 printk(KERN_WARNING "%s: max_packet_size is [%zd]; real packet "
829 "size is [%d]\n", __func__, max_packet_size, 829 "size is [%zd]\n", __func__, max_packet_size,
830 (1 + s->packet_size_len + 1 830 (1 + s->packet_size_len + 1
831 + s->block_aligned_filename_size)); 831 + s->block_aligned_filename_size));
832 rc = -EINVAL; 832 rc = -EINVAL;
@@ -860,7 +860,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
860 printk(KERN_ERR "%s: Internal error whilst attempting to " 860 printk(KERN_ERR "%s: Internal error whilst attempting to "
861 "convert encrypted filename memory to scatterlist; " 861 "convert encrypted filename memory to scatterlist; "
862 "expected rc = 1; got rc = [%d]. " 862 "expected rc = 1; got rc = [%d]. "
863 "block_aligned_filename_size = [%d]\n", __func__, rc, 863 "block_aligned_filename_size = [%zd]\n", __func__, rc,
864 s->block_aligned_filename_size); 864 s->block_aligned_filename_size);
865 goto out_unlock; 865 goto out_unlock;
866 } 866 }
@@ -869,7 +869,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
869 GFP_KERNEL); 869 GFP_KERNEL);
870 if (!s->decrypted_filename) { 870 if (!s->decrypted_filename) {
871 printk(KERN_ERR "%s: Out of memory whilst attempting to " 871 printk(KERN_ERR "%s: Out of memory whilst attempting to "
872 "kmalloc [%d] bytes\n", __func__, 872 "kmalloc [%zd] bytes\n", __func__,
873 s->block_aligned_filename_size); 873 s->block_aligned_filename_size);
874 rc = -ENOMEM; 874 rc = -ENOMEM;
875 goto out_unlock; 875 goto out_unlock;
@@ -880,7 +880,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
880 printk(KERN_ERR "%s: Internal error whilst attempting to " 880 printk(KERN_ERR "%s: Internal error whilst attempting to "
881 "convert decrypted filename memory to scatterlist; " 881 "convert decrypted filename memory to scatterlist; "
882 "expected rc = 1; got rc = [%d]. " 882 "expected rc = 1; got rc = [%d]. "
883 "block_aligned_filename_size = [%d]\n", __func__, rc, 883 "block_aligned_filename_size = [%zd]\n", __func__, rc,
884 s->block_aligned_filename_size); 884 s->block_aligned_filename_size);
885 goto out_free_unlock; 885 goto out_free_unlock;
886 } 886 }
@@ -944,7 +944,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
944 (*filename) = kmalloc(((*filename_size) + 1), GFP_KERNEL); 944 (*filename) = kmalloc(((*filename_size) + 1), GFP_KERNEL);
945 if (!(*filename)) { 945 if (!(*filename)) {
946 printk(KERN_ERR "%s: Out of memory whilst attempting to " 946 printk(KERN_ERR "%s: Out of memory whilst attempting to "
947 "kmalloc [%d] bytes\n", __func__, 947 "kmalloc [%zd] bytes\n", __func__,
948 ((*filename_size) + 1)); 948 ((*filename_size) + 1));
949 rc = -ENOMEM; 949 rc = -ENOMEM;
950 goto out_free_unlock; 950 goto out_free_unlock;