Commit df261c52 authored by Michael Halcrow's avatar Michael Halcrow Committed by Linus Torvalds

eCryptfs: Replace %Z with %z

%Z is a gcc-ism. Using %z instead.
Signed-off-by: default avatarMichael 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 87c94c4d
...@@ -1679,7 +1679,7 @@ ecryptfs_encrypt_filename(struct ecryptfs_filename *filename, ...@@ -1679,7 +1679,7 @@ ecryptfs_encrypt_filename(struct ecryptfs_filename *filename,
kmalloc(filename->encrypted_filename_size, GFP_KERNEL); kmalloc(filename->encrypted_filename_size, GFP_KERNEL);
if (!filename->encrypted_filename) { if (!filename->encrypted_filename) {
printk(KERN_ERR "%s: Out of memory whilst attempting " printk(KERN_ERR "%s: Out of memory whilst attempting "
"to kmalloc [%Zd] bytes\n", __func__, "to kmalloc [%zd] bytes\n", __func__,
filename->encrypted_filename_size); filename->encrypted_filename_size);
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
...@@ -1752,7 +1752,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm, ...@@ -1752,7 +1752,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
*key_tfm = NULL; *key_tfm = NULL;
if (*key_size > ECRYPTFS_MAX_KEY_BYTES) { if (*key_size > ECRYPTFS_MAX_KEY_BYTES) {
rc = -EINVAL; rc = -EINVAL;
printk(KERN_ERR "Requested key size is [%Zd] bytes; maximum " printk(KERN_ERR "Requested key size is [%zd] bytes; maximum "
"allowable is [%d]\n", *key_size, ECRYPTFS_MAX_KEY_BYTES); "allowable is [%d]\n", *key_size, ECRYPTFS_MAX_KEY_BYTES);
goto out; goto out;
} }
...@@ -1777,7 +1777,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm, ...@@ -1777,7 +1777,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
get_random_bytes(dummy_key, *key_size); get_random_bytes(dummy_key, *key_size);
rc = crypto_blkcipher_setkey(*key_tfm, dummy_key, *key_size); rc = crypto_blkcipher_setkey(*key_tfm, dummy_key, *key_size);
if (rc) { if (rc) {
printk(KERN_ERR "Error attempting to set key of size [%Zd] for " printk(KERN_ERR "Error attempting to set key of size [%zd] for "
"cipher [%s]; rc = [%d]\n", *key_size, cipher_name, rc); "cipher [%s]; rc = [%d]\n", *key_size, cipher_name, rc);
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
...@@ -2221,7 +2221,7 @@ int ecryptfs_decode_and_decrypt_filename(char **plaintext_name, ...@@ -2221,7 +2221,7 @@ int ecryptfs_decode_and_decrypt_filename(char **plaintext_name,
decoded_name = kmalloc(decoded_name_size, GFP_KERNEL); decoded_name = kmalloc(decoded_name_size, GFP_KERNEL);
if (!decoded_name) { if (!decoded_name) {
printk(KERN_ERR "%s: Out of memory whilst attempting " printk(KERN_ERR "%s: Out of memory whilst attempting "
"to kmalloc [%Zd] bytes\n", __func__, "to kmalloc [%zd] bytes\n", __func__,
decoded_name_size); decoded_name_size);
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
......
...@@ -358,7 +358,7 @@ parse_tag_67_packet(struct ecryptfs_key_record *key_rec, ...@@ -358,7 +358,7 @@ parse_tag_67_packet(struct ecryptfs_key_record *key_rec,
/* verify that everything through the encrypted FEK size is present */ /* verify that everything through the encrypted FEK size is present */
if (message_len < 4) { if (message_len < 4) {
rc = -EIO; rc = -EIO;
printk(KERN_ERR "%s: message_len is [%Zd]; minimum acceptable " printk(KERN_ERR "%s: message_len is [%zd]; minimum acceptable "
"message length is [%d]\n", __func__, message_len, 4); "message length is [%d]\n", __func__, message_len, 4);
goto out; goto out;
} }
...@@ -385,13 +385,13 @@ parse_tag_67_packet(struct ecryptfs_key_record *key_rec, ...@@ -385,13 +385,13 @@ parse_tag_67_packet(struct ecryptfs_key_record *key_rec,
i += data_len; i += data_len;
if (message_len < (i + key_rec->enc_key_size)) { if (message_len < (i + key_rec->enc_key_size)) {
rc = -EIO; rc = -EIO;
printk(KERN_ERR "%s: message_len [%Zd]; max len is [%Zd]\n", printk(KERN_ERR "%s: message_len [%zd]; max len is [%zd]\n",
__func__, message_len, (i + key_rec->enc_key_size)); __func__, message_len, (i + key_rec->enc_key_size));
goto out; goto out;
} }
if (key_rec->enc_key_size > ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES) { if (key_rec->enc_key_size > ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES) {
rc = -EIO; rc = -EIO;
printk(KERN_ERR "%s: Encrypted key_size [%Zd] larger than " printk(KERN_ERR "%s: Encrypted key_size [%zd] larger than "
"the maximum key size [%d]\n", __func__, "the maximum key size [%d]\n", __func__,
key_rec->enc_key_size, key_rec->enc_key_size,
ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES); ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES);
...@@ -511,7 +511,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes, ...@@ -511,7 +511,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
s = kmalloc(sizeof(*s), GFP_KERNEL); s = kmalloc(sizeof(*s), GFP_KERNEL);
if (!s) { if (!s) {
printk(KERN_ERR "%s: Out of memory whilst trying to kmalloc " printk(KERN_ERR "%s: Out of memory whilst trying to kmalloc "
"[%d] bytes of kernel memory\n", __func__, sizeof(*s)); "[%zd] bytes of kernel memory\n", __func__, sizeof(*s));
goto out; goto out;
} }
s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP; s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
...@@ -566,7 +566,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes, ...@@ -566,7 +566,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
GFP_KERNEL); GFP_KERNEL);
if (!s->block_aligned_filename) { if (!s->block_aligned_filename) {
printk(KERN_ERR "%s: Out of kernel memory whilst attempting to " printk(KERN_ERR "%s: Out of kernel memory whilst attempting to "
"kzalloc [%Zd] bytes\n", __func__, "kzalloc [%zd] bytes\n", __func__,
s->block_aligned_filename_size); s->block_aligned_filename_size);
rc = -ENOMEM; rc = -ENOMEM;
goto out_unlock; goto out_unlock;
...@@ -721,7 +721,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes, ...@@ -721,7 +721,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
printk(KERN_ERR "%s: Error setting key for crypto context; " printk(KERN_ERR "%s: Error setting key for crypto context; "
"rc = [%d]. s->auth_tok->token.password.session_key_" "rc = [%d]. s->auth_tok->token.password.session_key_"
"encryption_key = [0x%p]; mount_crypt_stat->" "encryption_key = [0x%p]; mount_crypt_stat->"
"global_default_fn_cipher_key_bytes = [%Zd]\n", __func__, "global_default_fn_cipher_key_bytes = [%zd]\n", __func__,
rc, rc,
s->auth_tok->token.password.session_key_encryption_key, s->auth_tok->token.password.session_key_encryption_key,
mount_crypt_stat->global_default_fn_cipher_key_bytes); mount_crypt_stat->global_default_fn_cipher_key_bytes);
...@@ -792,7 +792,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size, ...@@ -792,7 +792,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
} }
s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP; s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
if (max_packet_size < (1 + 1 + ECRYPTFS_SIG_SIZE + 1 + 1)) { if (max_packet_size < (1 + 1 + ECRYPTFS_SIG_SIZE + 1 + 1)) {
printk(KERN_WARNING "%s: max_packet_size is [%Zd]; it must be " printk(KERN_WARNING "%s: max_packet_size is [%zd]; it must be "
"at least [%d]\n", __func__, max_packet_size, "at least [%d]\n", __func__, max_packet_size,
(1 + 1 + ECRYPTFS_SIG_SIZE + 1 + 1)); (1 + 1 + ECRYPTFS_SIG_SIZE + 1 + 1));
rc = -EINVAL; rc = -EINVAL;
...@@ -909,7 +909,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size, ...@@ -909,7 +909,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
printk(KERN_ERR "%s: Error setting key for crypto context; " printk(KERN_ERR "%s: Error setting key for crypto context; "
"rc = [%d]. s->auth_tok->token.password.session_key_" "rc = [%d]. s->auth_tok->token.password.session_key_"
"encryption_key = [0x%p]; mount_crypt_stat->" "encryption_key = [0x%p]; mount_crypt_stat->"
"global_default_fn_cipher_key_bytes = [%Zd]\n", __func__, "global_default_fn_cipher_key_bytes = [%zd]\n", __func__,
rc, rc,
s->auth_tok->token.password.session_key_encryption_key, s->auth_tok->token.password.session_key_encryption_key,
mount_crypt_stat->global_default_fn_cipher_key_bytes); mount_crypt_stat->global_default_fn_cipher_key_bytes);
...@@ -936,7 +936,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size, ...@@ -936,7 +936,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
s->i++; s->i++;
(*filename_size) = (s->block_aligned_filename_size - s->i); (*filename_size) = (s->block_aligned_filename_size - s->i);
if (!((*filename_size) > 0 && (*filename_size < PATH_MAX))) { if (!((*filename_size) > 0 && (*filename_size < PATH_MAX))) {
printk(KERN_WARNING "%s: Filename size is [%Zd], which is " printk(KERN_WARNING "%s: Filename size is [%zd], which is "
"invalid\n", __func__, (*filename_size)); "invalid\n", __func__, (*filename_size));
rc = -EINVAL; rc = -EINVAL;
goto out_free_unlock; goto out_free_unlock;
......
...@@ -193,7 +193,7 @@ ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, uid_t euid, ...@@ -193,7 +193,7 @@ ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, uid_t euid,
(*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL); (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL);
if (!(*daemon)) { if (!(*daemon)) {
rc = -ENOMEM; rc = -ENOMEM;
printk(KERN_ERR "%s: Failed to allocate [%Zd] bytes of " printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of "
"GFP_KERNEL memory\n", __func__, sizeof(**daemon)); "GFP_KERNEL memory\n", __func__, sizeof(**daemon));
goto out; goto out;
} }
...@@ -435,7 +435,7 @@ int ecryptfs_process_response(struct ecryptfs_message *msg, uid_t euid, ...@@ -435,7 +435,7 @@ int ecryptfs_process_response(struct ecryptfs_message *msg, uid_t euid,
msg_ctx->msg = kmalloc(msg_size, GFP_KERNEL); msg_ctx->msg = kmalloc(msg_size, GFP_KERNEL);
if (!msg_ctx->msg) { if (!msg_ctx->msg) {
rc = -ENOMEM; rc = -ENOMEM;
printk(KERN_ERR "%s: Failed to allocate [%Zd] bytes of " printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of "
"GFP_KERNEL memory\n", __func__, msg_size); "GFP_KERNEL memory\n", __func__, msg_size);
goto unlock; goto unlock;
} }
......
...@@ -199,7 +199,7 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, ...@@ -199,7 +199,7 @@ int ecryptfs_send_miscdev(char *data, size_t data_size,
if (!msg_ctx->msg) { if (!msg_ctx->msg) {
rc = -ENOMEM; rc = -ENOMEM;
printk(KERN_ERR "%s: Out of memory whilst attempting " printk(KERN_ERR "%s: Out of memory whilst attempting "
"to kmalloc(%Zd, GFP_KERNEL)\n", __func__, "to kmalloc(%zd, GFP_KERNEL)\n", __func__,
(sizeof(*msg_ctx->msg) + data_size)); (sizeof(*msg_ctx->msg) + data_size));
goto out_unlock; goto out_unlock;
} }
...@@ -322,7 +322,7 @@ check_list: ...@@ -322,7 +322,7 @@ check_list:
if (count < total_length) { if (count < total_length) {
rc = 0; rc = 0;
printk(KERN_WARNING "%s: Only given user buffer of " printk(KERN_WARNING "%s: Only given user buffer of "
"size [%Zd], but we need [%Zd] to read the " "size [%zd], but we need [%zd] to read the "
"pending message\n", __func__, count, total_length); "pending message\n", __func__, count, total_length);
goto out_unlock_msg_ctx; goto out_unlock_msg_ctx;
} }
...@@ -376,7 +376,7 @@ static int ecryptfs_miscdev_response(char *data, size_t data_size, ...@@ -376,7 +376,7 @@ static int ecryptfs_miscdev_response(char *data, size_t data_size,
if ((sizeof(*msg) + msg->data_len) != data_size) { if ((sizeof(*msg) + msg->data_len) != data_size) {
printk(KERN_WARNING "%s: (sizeof(*msg) + msg->data_len) = " printk(KERN_WARNING "%s: (sizeof(*msg) + msg->data_len) = "
"[%Zd]; data_size = [%Zd]. Invalid packet.\n", __func__, "[%zd]; data_size = [%zd]. Invalid packet.\n", __func__,
(sizeof(*msg) + msg->data_len), data_size); (sizeof(*msg) + msg->data_len), data_size);
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
...@@ -421,7 +421,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf, ...@@ -421,7 +421,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
data = kmalloc(count, GFP_KERNEL); data = kmalloc(count, GFP_KERNEL);
if (!data) { if (!data) {
printk(KERN_ERR "%s: Out of memory whilst attempting to " printk(KERN_ERR "%s: Out of memory whilst attempting to "
"kmalloc([%Zd], GFP_KERNEL)\n", __func__, count); "kmalloc([%zd], GFP_KERNEL)\n", __func__, count);
goto out; goto out;
} }
rc = copy_from_user(data, buf, count); rc = copy_from_user(data, buf, count);
...@@ -436,8 +436,8 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf, ...@@ -436,8 +436,8 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
case ECRYPTFS_MSG_RESPONSE: case ECRYPTFS_MSG_RESPONSE:
if (count < (1 + 4 + 1 + sizeof(struct ecryptfs_message))) { if (count < (1 + 4 + 1 + sizeof(struct ecryptfs_message))) {
printk(KERN_WARNING "%s: Minimum acceptable packet " printk(KERN_WARNING "%s: Minimum acceptable packet "
"size is [%Zd], but amount of data written is " "size is [%zd], but amount of data written is "
"only [%Zd]. Discarding response packet.\n", "only [%zd]. Discarding response packet.\n",
__func__, __func__,
(1 + 4 + 1 + sizeof(struct ecryptfs_message)), (1 + 4 + 1 + sizeof(struct ecryptfs_message)),
count); count);
...@@ -455,9 +455,9 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf, ...@@ -455,9 +455,9 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
} }
i += packet_size_length; i += packet_size_length;
if ((1 + 4 + packet_size_length + packet_size) != count) { if ((1 + 4 + packet_size_length + packet_size) != count) {
printk(KERN_WARNING "%s: (1 + packet_size_length([%Zd])" printk(KERN_WARNING "%s: (1 + packet_size_length([%zd])"
" + packet_size([%Zd]))([%Zd]) != " " + packet_size([%zd]))([%zd]) != "
"count([%Zd]). Invalid packet format.\n", "count([%zd]). Invalid packet format.\n",
__func__, packet_size_length, packet_size, __func__, packet_size_length, packet_size,
(1 + packet_size_length + packet_size), count); (1 + packet_size_length + packet_size), count);
goto out_free; goto out_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment