From: Stephan Mueller <smueller@chronox.de>
To: Theodore Ts'o <tytso@mit.edu>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-crypto@vger.kernel.org
Subject: Re: [RFC] /dev/random for in-kernel use
Date: Mon, 28 Apr 2014 16:39:49 +0200 [thread overview]
Message-ID: <4858823.gusYfQIdAn@myon.chronox.de> (raw)
In-Reply-To: <20140428142350.GB4534@thunk.org>
Am Montag, 28. April 2014, 10:23:50 schrieb Theodore Ts'o:
Hi Theodore,
> > I am not too convinced of RDRAND due to the lack of usable source code
> > (i.e. source code that I can build myself). But that is my personal taste
> > :-)
> The problem is the FIPS validation would presumably require obeying
> the SP-800A requirement for an approved entropy source, and while we
> can't audit RDRAND to satisfy ourselves that the US government hasn't
> introduced a back door, if the only purpose of the FIPS validation is
> so that people can sell into the US government market, presuambly the
> US government is OK with a potential NSA-introduced back door. :-)
>From a US centric view, you may be right. But there are some FIPS 140-2
aspects which are helpful in general (albeit just a minority). And for those,
auditible code is key. Not everybody is delighted to have NSA watching. :-)
>
> That being said, there is some FIPS compliance code in
> drivers/char/random.c, which was introduced while Matt Mackall was
> maintaining the driver, and it mystifies me, since I never thought
> /dev/random could be an approved FIPS compliant generator --- not that
> I care, since I'm not trying to sell into the US government market,
> but the FIPS compliance code is largely harmless, so I've never
> bothered to remove it.
Ok, let me demystify it, because I was the initial trigger of the code
changes. Albeit random.c is outside of any FIPS module, NIST requires that
even seed sources that are outside the module boundary have a so-called
"continuous selftest" as defined in FIPS specification section 4.9.2. If the
self test fails, the seed source must become unavailable.
>
> > Thanks for these suggestions. Shall I take these suggestions and turn them
> > into a full patch?
>
> Sure, go for it.
>
> > Moreover, I read that even for in-kernel users we should use the blocking
> > pool. Or shall we conceive of a third output pool, say, a kernel pool that
> > is independent of the output pools to user space? Adding such a pool more
> > or less only requires to define a new struct entropy_pool instance.
>
> I've audited most of the in-kernel users, and most of them aren't even
> using them for a session key; they're using it for something less
> critical (e.g. ASLR, stack magic, etc.). CIFS is perhaps the only
> place where it is generating a session key, and session key generation
> is just fine with the /dev/urandom pool.
>
> So making all of the in-kernel users deal with a blocking interface is
> not worth it, IMHO.
Sorry, I did not make myself clear: for the purpose of the blocking behavior,
shall we draw from blocking_pool or define a new pool used completely for this
in-kernel blocking usage? Note, if we use the blocking_pool, any non-root user
can stall the in-kernel operation indefinitely by simply reading /dev/random.
As the in-kernel use for blocking random numbers would be limited, I was
thinking about a new entropy pool that has no user space access.
I do not want to convert any existing in-kernel users of random data to use
the new entropy pool.
Ciao
Stephan
--
| Cui bono? |
prev parent reply other threads:[~2014-04-28 14:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-27 18:49 [RFC] /dev/random for in-kernel use Stephan Mueller
2014-04-28 0:19 ` Theodore Ts'o
2014-04-28 6:00 ` Stephan Mueller
2014-04-28 14:23 ` Theodore Ts'o
2014-04-28 14:38 ` Gregory Baudet
2014-04-28 14:39 ` Stephan Mueller [this message]
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=4858823.gusYfQIdAn@myon.chronox.de \
--to=smueller@chronox.de \
--cc=linux-crypto@vger.kernel.org \
--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