From: Greg Price <price@MIT.EDU>
To: "Theodore Ts'o" <tytso@MIT.EDU>
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>
Subject: random: locking vs. lockless accesses
Date: Mon, 11 Nov 2013 14:52:17 -0500 [thread overview]
Message-ID: <20131111195217.GV8043@ringworld.MIT.EDU> (raw)
Hi Ted,
After reading through the RNG code, I'm curious about one aspect and I
wonder if you can shed light on it. Since v3.6-rc1~26^2~30 ("random:
use lockless techniques in the interrupt path"), we mix bytes into the
pool without taking the lock, when inside add_interrupt_randomness().
This means we may mix concurrently with mixing from other input
sources or with hashing the pool in extract_buf(). Nevertheless we
still take the lock in those other situations.
What do you think are the consequences of accessing the pool
concurrently? If it's OK to do, should we be doing so everywhere?
By my reading, the only mutable data on a pool that we consistently
protect with the lock is ->last_data and ->last_data_init. If
everything else were accessed without the lock, the only lock-taking
that would survive is what we do in extract_entropy when fips_enabled
is true.
Thanks, cheers,
Greg
reply other threads:[~2013-11-11 19:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131111195217.GV8043@ringworld.MIT.EDU \
--to=price@mit.edu \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@MIT.EDU \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).