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-prev] [day] [month] [year] [list]
Message-ID: <20151208171013.GA4263@redhat.com>
Date:	Tue, 8 Dec 2015 12:10:13 -0500
From:	Mike Snitzer <snitzer@...hat.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	dm-devel@...hat.com, Neil Brown <neilb@...e.com>,
	linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
	Alasdair Kergon <agk@...hat.com>,
	Sami Tolvanen <samitolvanen@...gle.com>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: dm verity: use sector_div for division

On Tue, Dec 08 2015 at 10:42am -0500,
Arnd Bergmann <arnd@...db.de> wrote:

> 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.

Thanks, I'll fold this in.

(Btw, I did review this use of do_div(): but only to answer whether there
was potential for a 64bit divide.  I concluded do_div() was fine but didn't
look to see the data type for f->rounds was actually sector_t.)
--
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