Re: /dev/urandom uses uninit bytes, leaks user data

From: Matt Mackall
Date: Sat Dec 15 2007 - 11:31:54 EST


On Sat, Dec 15, 2007 at 03:13:19PM +0800, Herbert Xu wrote:
> John Reiser <jreiser@xxxxxxxxxxxx> 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 <xfer_secondary_pool+206>: lea 0x3(%esi),%eax
> > 0x814068c <xfer_secondary_pool+209>: mov $0x4,%dl
> > 0x814068e <xfer_secondary_pool+211>: mov %edx,%edi
> > 0x8140690 <xfer_secondary_pool+213>: cltd
> > 0x8140691 <xfer_secondary_pool+214>: 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/