diff options
author | Joe Perches <joe@perches.com> | 2010-11-10 18:46:16 -0500 |
---|---|---|
committer | Tyler Hicks <tyhicks@linux.vnet.ibm.com> | 2011-01-17 14:01:23 -0500 |
commit | 888d57bbc91ebd031451d4ab1c669baee826a06c (patch) | |
tree | a446e3d6f7134a50d5118702fadba04ab5ee3c14 /fs/ecryptfs/crypto.c | |
parent | 0abe1169470571c473ee720c35fe5b3481c46c46 (diff) |
fs/ecryptfs: Add printf format/argument verification and fix fallout
Add __attribute__((format... to __ecryptfs_printk
Make formats and arguments match.
Add casts to (unsigned long long) for %llu.
Signed-off-by: Joe Perches <joe@perches.com>
[tyhicks: 80 columns cleanup and fixed typo]
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r-- | fs/ecryptfs/crypto.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index cbadc1bee6e7..57bdd7a13207 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -413,10 +413,9 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page, | |||
413 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, | 413 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, |
414 | (extent_base + extent_offset)); | 414 | (extent_base + extent_offset)); |
415 | if (rc) { | 415 | if (rc) { |
416 | ecryptfs_printk(KERN_ERR, "Error attempting to " | 416 | ecryptfs_printk(KERN_ERR, "Error attempting to derive IV for " |
417 | "derive IV for extent [0x%.16x]; " | 417 | "extent [0x%.16llx]; rc = [%d]\n", |
418 | "rc = [%d]\n", (extent_base + extent_offset), | 418 | (unsigned long long)(extent_base + extent_offset), rc); |
419 | rc); | ||
420 | goto out; | 419 | goto out; |
421 | } | 420 | } |
422 | if (unlikely(ecryptfs_verbosity > 0)) { | 421 | if (unlikely(ecryptfs_verbosity > 0)) { |
@@ -443,9 +442,9 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page, | |||
443 | } | 442 | } |
444 | rc = 0; | 443 | rc = 0; |
445 | if (unlikely(ecryptfs_verbosity > 0)) { | 444 | if (unlikely(ecryptfs_verbosity > 0)) { |
446 | ecryptfs_printk(KERN_DEBUG, "Encrypt extent [0x%.16x]; " | 445 | ecryptfs_printk(KERN_DEBUG, "Encrypt extent [0x%.16llx]; " |
447 | "rc = [%d]\n", (extent_base + extent_offset), | 446 | "rc = [%d]\n", |
448 | rc); | 447 | (unsigned long long)(extent_base + extent_offset), rc); |
449 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " | 448 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " |
450 | "encryption:\n"); | 449 | "encryption:\n"); |
451 | ecryptfs_dump_hex((char *)(page_address(enc_extent_page)), 8); | 450 | ecryptfs_dump_hex((char *)(page_address(enc_extent_page)), 8); |
@@ -540,10 +539,9 @@ static int ecryptfs_decrypt_extent(struct page *page, | |||
540 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, | 539 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, |
541 | (extent_base + extent_offset)); | 540 | (extent_base + extent_offset)); |
542 | if (rc) { | 541 | if (rc) { |
543 | ecryptfs_printk(KERN_ERR, "Error attempting to " | 542 | ecryptfs_printk(KERN_ERR, "Error attempting to derive IV for " |
544 | "derive IV for extent [0x%.16x]; " | 543 | "extent [0x%.16llx]; rc = [%d]\n", |
545 | "rc = [%d]\n", (extent_base + extent_offset), | 544 | (unsigned long long)(extent_base + extent_offset), rc); |
546 | rc); | ||
547 | goto out; | 545 | goto out; |
548 | } | 546 | } |
549 | if (unlikely(ecryptfs_verbosity > 0)) { | 547 | if (unlikely(ecryptfs_verbosity > 0)) { |
@@ -571,9 +569,9 @@ static int ecryptfs_decrypt_extent(struct page *page, | |||
571 | } | 569 | } |
572 | rc = 0; | 570 | rc = 0; |
573 | if (unlikely(ecryptfs_verbosity > 0)) { | 571 | if (unlikely(ecryptfs_verbosity > 0)) { |
574 | ecryptfs_printk(KERN_DEBUG, "Decrypt extent [0x%.16x]; " | 572 | ecryptfs_printk(KERN_DEBUG, "Decrypt extent [0x%.16llx]; " |
575 | "rc = [%d]\n", (extent_base + extent_offset), | 573 | "rc = [%d]\n", |
576 | rc); | 574 | (unsigned long long)(extent_base + extent_offset), rc); |
577 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " | 575 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " |
578 | "decryption:\n"); | 576 | "decryption:\n"); |
579 | ecryptfs_dump_hex((char *)(page_address(page) | 577 | ecryptfs_dump_hex((char *)(page_address(page) |