[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140626011751.GA6826@thunk.org>
Date: Wed, 25 Jun 2014 21:17:51 -0400
From: Theodore Ts'o <tytso@....edu>
To: Fabian Frederick <fabf@...net.be>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Jan Kara <jack@...e.cz>
Subject: Re: [PATCH 1/1] FS/JBD:replace count*size kmalloc by kmalloc_array
On Wed, Jun 25, 2014 at 08:49:06PM +0200, Fabian Frederick wrote:
> kmalloc_array manages count*sizeof overflow.
Except in these call sites, overflow is impossible.
kmalloc_array() is useful when count is coming from an unvalidated
source. But in this case, the count is either a fixed, hard-coded
value (256), or the size of n*count is *guaranteed* to be less than
the page size.
So this just adds some extra code which is pointless (assuming the
compiler isn't smart enough to optimize it out).
- Ted
--
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