From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-fx0-f49.google.com ([209.85.161.49]) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PFnFU-0002dU-84 for linux-mtd@lists.infradead.org; Tue, 09 Nov 2010 12:24:28 +0000 Received: by fxm11 with SMTP id 11so5031029fxm.36 for ; Tue, 09 Nov 2010 04:24:26 -0800 (PST) Subject: Re: [PATCH 08/10] mtd-utils: nandwrite: prevent 32-bit overflow From: Artem Bityutskiy To: Brian Norris In-Reply-To: <1288772847-8120-8-git-send-email-computersforpeace@gmail.com> References: <1288772847-8120-1-git-send-email-computersforpeace@gmail.com> <1288772847-8120-8-git-send-email-computersforpeace@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 09 Nov 2010 14:20:56 +0200 Message-ID: <1289305256.2283.2.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: David Woodhouse , Jehan Bing , linux-mtd@lists.infradead.org, Mike Frysinger Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2010-11-03 at 01:27 -0700, Brian Norris wrote: > For large block- and page-sizes, the multiplication of ebsize_aligned > and pagelen can overflow a 32-bit integer. This overflow can be > prevented by a simple change in order of operations (i.e., do division > first). > > Since ebsize_aligned is always a multiple of mtd.min_io_size, this > produces no change in results. > > Signed-off-by: Brian Norris Brian, increasingly have less and less time for mtd, but I remember about your patches - I'll pick them as soon as I have some time. You can meanwhile address Mikes comments. -- Best Regards, Artem Bityutskiy (Артём Битюцкий)