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]
Date:	Mon, 04 Nov 2013 15:29:43 -0700
From:	Jens Axboe <axboe@...nel.dk>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Andrew Morton <akpm@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: Do not call sector_div() with a 64-bit divisor

On 11/04/2013 06:00 AM, Geert Uytterhoeven wrote:
> do_div() (called by sector_div() if CONFIG_LBDAF=y) is meant for divisions
> of 64-bit number by 32-bit numbers.  Passing 64-bit divisor types caused
> issues in the past on 32-bit platforms, cfr. commit
> ea077b1b96e073eac5c3c5590529e964767fc5f7 ("m68k: Truncate base in
> do_div()").
> 
> As queue_limits.max_discard_sectors and .discard_granularity are unsigned
> int, max_discard_sectors and granularity should be unsigned int.
> As bdev_discard_alignment() returns int, alignment should be int.
> Now 2 calls to sector_div() can be replaced by 32-bit arithmetic:
>   - The 64-bit modulo operation can become a 32-bit modulo operation,
>   - The 64-bit division and multiplication can be replaced by a 32-bit
>     modulo operation and a subtraction.

Thanks Geert, applied.

-- 
Jens Axboe

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