mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/3] random: Account for entropy loss due to overwrites
@ 2013-09-09  7:54 H. Peter Anvin
  2013-09-09  7:54 ` [PATCH v4 1/3] random: Statically compute poolbitshift, poolbytes, poolbits H. Peter Anvin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: H. Peter Anvin @ 2013-09-09  7:54 UTC (permalink / raw)
  To: Ted Ts'o
  Cc: Linus Torvalds, DJ Johnston, Linux Kernel Mailing List,
	Jiri Kosina, H. Peter Anvin, H. Peter Anvin

From: "H. Peter Anvin" <hpa@linux.intel.com>

[ Resending due to fumble-fingering vger.kernel.org. Sorry about that. ]

Version 4: my attempt at rebasing this patchset on top of 3.11, with
its changes to use cmpxchg.  I believe my adaptions are correct, but I
have not had the time to test them extensively.

When we write entropy into a non-empty pool, we currently don't
account at all for the fact that we will probabilistically overwrite
some of the entropy in that pool.  This means that unless the pool is
fully empty, we are currently *guaranteed* to overestimate the amount
of entropy in the pool!

This version of the patchset avoids manually duplicating information
by using a macro.  This removes *all* dynamic computation of derived
pool information and replaces them with static information: on just
about every architecture accessing pointer+offset is no more expensive
than just plain pointer, and this lets us get the information we
actually need from the start.

This version of the patchset adds handling of fractional bits, so that
we can continue to add a single bit of entropy without it being
rounded down to zero.  This version has 3 bits of fraction, which
means that with a 4096-bit input pool the multiply still cannot
overflow 32 bits; if we want to add the capability of crediting
fractional bits of entropy, which may be useful in itself, then we
probably need more bits of fraction and would have to use a 64-bit
multiply and shift.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-09  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-09  7:54 [PATCH v4 0/3] random: Account for entropy loss due to overwrites H. Peter Anvin
2013-09-09  7:54 ` [PATCH v4 1/3] random: Statically compute poolbitshift, poolbytes, poolbits H. Peter Anvin
2013-09-09  7:54 ` [PATCH v4 2/3] random: Allow fractional bits to be tracked H. Peter Anvin
2013-09-09  7:54 ` [PATCH v4 3/3] random: Account for entropy loss due to overwrites H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome