Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760333AbXLOQbp (ORCPT ); Sat, 15 Dec 2007 11:31:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751317AbXLOQbg (ORCPT ); Sat, 15 Dec 2007 11:31:36 -0500 Received: from waste.org ([66.93.16.53]:56297 "EHLO waste.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbXLOQbf (ORCPT ); Sat, 15 Dec 2007 11:31:35 -0500 Date: Sat, 15 Dec 2007 10:30:10 -0600 From: Matt Mackall To: Herbert Xu Cc: John Reiser , akpm@linux-foundation.org, tytso@mit.edu, linux-kernel@vger.kernel.org Subject: Re: /dev/urandom uses uninit bytes, leaks user data Message-ID: <20071215163010.GS19691@waste.org> References: <47632010.6030709@BitWagon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 26 On Sat, Dec 15, 2007 at 03:13:19PM +0800, Herbert Xu wrote: > John Reiser wrote: > > > > If speed matters that much, then please recoup 33 cycles on x86 > > by using shifts instead of three divides, such as (gcc 4.1.2): > > > > add_entropy_words(r, tmp, (bytes + 3) / 4); > > > > 0x8140689 : lea 0x3(%esi),%eax > > 0x814068c : mov $0x4,%dl > > 0x814068e : mov %edx,%edi > > 0x8140690 : cltd > > 0x8140691 : idiv %edi > > There ought to be a warning about this sort of thing. Indeed. Seems it would be better to adjust the types appropriately. Anyway, this is no longer relevant to security@. -- Mathematics is the supreme nostalgia of our time. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/