From: Stephan Mueller <smueller@chronox.de>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: "Jörn Engel" <joern@logfs.org>, "H. Peter Anvin" <hpa@zytor.com>,
"Linux Kernel Developers List" <linux-kernel@vger.kernel.org>,
macro@linux-mips.org, ralf@linux-mips.org, dave.taht@gmail.com,
blogic@openwrt.org, andrewmcgr@gmail.com, geert@linux-m68k.org,
tg@mirbsd.de, sandyinchina@gmail.com
Subject: [PATCH 4/5] CPU Jitter RNG: provide status proc files
Date: Tue, 04 Feb 2014 13:41:31 +0100 [thread overview]
Message-ID: <2094293.CMEsWJt2a2@myon.chronox.de> (raw)
In-Reply-To: <2039634.jSmQAS6tdi@myon.chronox.de>
After successful initialization of the CPU Jitter RNG as part of the
Linux RNG, the two variables defining the memory size of the memory
chunk used for measuring memory access times are set. In case the Jitter
RNG does not successfully initialize, these variables are set to zero.
These two variables can be exported to user space to allow user space to
check whether the CPU Jitter RNG is operational and which memory values
are used. Note, according to tests, the size of the memory chunk has a
direct impact on the execution timing variations.
The exported variables are all read only and can be found at:
/proc/sys/kernel/random. The files are:
jent_memblocksize -- size of one memory block in bytes
jent_memblocks -- number of memory blocks used
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
drivers/char/random.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index eb4fe99..4b2267b 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1703,6 +1703,20 @@ struct ctl_table random_table[] = {
.mode = 0444,
.proc_handler = proc_do_uuid,
},
+ {
+ .procname = "jent_memblocksize",
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .proc_handler = proc_dointvec,
+ .data = &input_pool.jent_ec.memblocksize,
+ },
+ {
+ .procname = "jent_memblocks",
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .proc_handler = proc_dointvec,
+ .data = &input_pool.jent_ec.memblocks,
+ },
{ }
};
#endif /* CONFIG_SYSCTL */
--
1.8.5.3
next prev parent reply other threads:[~2014-02-04 12:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 12:36 [RFC PATCH 0/5] CPU Jitter RNG Stephan Mueller
2014-02-04 12:39 ` [PATCH 1/5] " Stephan Mueller
2014-02-04 12:40 ` [PATCH 2/5] CPU Jitter RNG: Enable compilation Stephan Mueller
2014-02-04 13:39 ` Geert Uytterhoeven
2014-02-04 16:19 ` Stephan Mueller
2014-02-04 16:39 ` Hannes Frederic Sowa
2014-02-04 16:50 ` Hannes Frederic Sowa
2014-02-04 16:53 ` Stephan Mueller
2014-02-04 17:15 ` Hannes Frederic Sowa
2014-02-04 12:40 ` [PATCH 3/5] CPU Jitter RNG: integration with /dev/random Stephan Mueller
2014-02-04 12:41 ` Stephan Mueller [this message]
2014-02-04 12:42 ` [PATCH 5/5] CPU Jitter RNG: add read/write sysctls Stephan Mueller
2014-02-04 17:08 ` [RFC PATCH 0/5] CPU Jitter RNG Theodore Ts'o
2014-02-04 19:06 ` H. Peter Anvin
2014-02-04 19:23 ` tytso
2014-02-04 19:39 ` Geert Uytterhoeven
2014-02-04 20:39 ` H. Peter Anvin
2014-02-04 21:46 ` Geert Uytterhoeven
2014-02-04 21:47 ` H. Peter Anvin
2014-02-10 21:07 ` Jörn Engel
2014-02-04 20:31 ` Stephan Mueller
2014-02-04 21:34 ` H. Peter Anvin
2014-02-04 21:43 ` Geert Uytterhoeven
2014-02-04 20:25 ` Stephan Mueller
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=2094293.CMEsWJt2a2@myon.chronox.de \
--to=smueller@chronox.de \
--cc=andrewmcgr@gmail.com \
--cc=blogic@openwrt.org \
--cc=dave.taht@gmail.com \
--cc=geert@linux-m68k.org \
--cc=hpa@zytor.com \
--cc=joern@logfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=sandyinchina@gmail.com \
--cc=tg@mirbsd.de \
--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
Powered by JetHome