lkml.org 
[lkml]   [2014]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] CPU Jitter RNG: provide status proc files
Date

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



\
 
 \ /
  Last update: 2014-02-04 14:21    [W:0.145 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site