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] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eggor0bi.fsf@rasmusvillemoes.dk>
Date:	Wed, 21 Oct 2015 12:19:13 +0200
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	James Bottomley <JBottomley@...n.com>,
	linux-kernel@...r.kernel.org,
	"K. Y. Srinivasan" <kys@...rosoft.com>
Subject: Re: [PATCH v5 2/2] lib/test-string_helpers.c: add string_get_size() tests

On Thu, Sep 17 2015, Vitaly Kuznetsov <vkuznets@...hat.com> wrote:

> +
> +static __init void test_string_get_size(void)
> +{
> +	test_string_get_size_one(16384, 512, STRING_UNITS_2, "8.00 MiB");
> +	test_string_get_size_one(8192, 4096, STRING_UNITS_10, "32.7 MB");

This is a little late, but I just noticed that string_get_size with
STRING_UNITS_10, block size >= 1024 and sufficiently large size seems to
be broken. Yes, 32.7 MB is what it produces, but is it what it should
give? 8192*4096 = 33554432, so I'd expect "33.5 MB". It does give that
when we pass size=65536 and block_size=512; a combination with the same
product.

I think the problem is that the remainder coming out of the while
(blk_size >= divisor[units]) loop is dropped on the floor in the
subsequent size > exp case - but I'm too lazy right now to figure out how
to fix it.

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