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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 08 Dec 2015 16:42:12 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com
Cc:	Alasdair Kergon <agk@...hat.com>, linux-raid@...r.kernel.org,
	Neil Brown <neilb@...e.com>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Sami Tolvanen <samitolvanen@...gle.com>
Subject: [PATCH] dm verity: use sector_div for division

The dm verity sec implementation uses do_div for dividing a sector_t,
which is slower than necessary when sector_t is a 32-bit type, and
we now get a warning for this case:

include/asm-generic/div64.h:224:22: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]
drivers/md/dm-verity-fec.c:725:6: note: in expansion of macro 'do_div'
  if (do_div(f->rounds, f->rsn))

This changes the code to use sector_div instead, which does the
right thing and avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/md/dm-verity-fec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I believe we had a fix for this in the series that introduced the optimized
do_div, but the file got moved around and the fix got lost.

diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c
index e722ce57520f..1bddaca37e98 100644
--- a/drivers/md/dm-verity-fec.c
+++ b/drivers/md/dm-verity-fec.c
@@ -722,7 +722,7 @@ int verity_fec_ctr(struct dm_verity *v)
 	}
 
 	f->rounds = f->blocks;
-	if (do_div(f->rounds, f->rsn))
+	if (sector_div(f->rounds, f->rsn))
 		f->rounds++;
 
 	/*
-- 
2.1.0.rc2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ