lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 26 Nov 2014 15:51:09 -0800
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	Ted Tso <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org
Subject: [PATCH] ext4: fix sparse warnings with new shash api usage

Use __le32, not u32 so that sparse is happy.

Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
---
 fs/ext4/ext4.h       |    6 +++---
 include/linux/jbd2.h |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 93e0efe..da83f20 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1784,15 +1784,15 @@ static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
 		struct shash_desc shash;
 		char ctx[4];
 	} desc;
-	u32 out_crc;
+	__le32 out_crc;
 	int err;
 
 	BUG_ON(crypto_shash_descsize(sbi->s_chksum_driver)!=sizeof(desc.ctx));
 
 	desc.shash.tfm = sbi->s_chksum_driver;
 	desc.shash.flags = 0;
-	crc = cpu_to_le32(crc);
-	crypto_shash_setkey(desc.shash.tfm, (u8 *)&crc, sizeof(crc));
+	out_crc = cpu_to_le32(crc);
+	crypto_shash_setkey(desc.shash.tfm, (u8 *)&out_crc, sizeof(out_crc));
 	crypto_shash_init(&desc.shash);
 
 	err = crypto_shash_update(&desc.shash, address, length);
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 8ce1196..ae365ca 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1374,7 +1374,7 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc,
 		struct shash_desc shash;
 		char ctx[JBD_MAX_CHECKSUM_SIZE];
 	} desc;
-	u32 out_crc;
+	__le32 out_crc;
 	int err;
 
 	BUG_ON(crypto_shash_descsize(journal->j_chksum_driver) >
@@ -1382,8 +1382,8 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc,
 
 	desc.shash.tfm = journal->j_chksum_driver;
 	desc.shash.flags = 0;
-	crc = cpu_to_le32(crc);
-	crypto_shash_setkey(desc.shash.tfm, (u8 *)&crc, sizeof(crc));
+	out_crc = cpu_to_le32(crc);
+	crypto_shash_setkey(desc.shash.tfm, (u8 *)&out_crc, sizeof(out_crc));
 	crypto_shash_init(&desc.shash);
 
 	err = crypto_shash_update(&desc.shash, address, length);
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ