Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
392a546d
Commit
392a546d
authored
Nov 03, 2013
by
Theodore Ts'o
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
random: add debugging code to detect early use of get_random_bytes()
Signed-off-by:
"Theodore Ts'o"
<
tytso@mit.edu
>
parent
644008df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
drivers/char/random.c
drivers/char/random.c
+9
-0
No files found.
drivers/char/random.c
View file @
392a546d
...
...
@@ -280,6 +280,8 @@
#define SEC_XFER_SIZE 512
#define EXTRACT_SIZE 10
#define DEBUG_RANDOM_BOOT 0
#define LONGS(x) (((x) + sizeof(unsigned long) - 1)/sizeof(unsigned long))
/*
...
...
@@ -1177,6 +1179,13 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
*/
void
get_random_bytes
(
void
*
buf
,
int
nbytes
)
{
#if DEBUG_RANDOM_BOOT > 0
if
(
unlikely
(
nonblocking_pool
.
initialized
==
0
))
printk
(
KERN_NOTICE
"random: %pF get_random_bytes called "
"with %d bits of entropy available
\n
"
,
(
void
*
)
_RET_IP_
,
nonblocking_pool
.
entropy_total
);
#endif
trace_get_random_bytes
(
nbytes
,
_RET_IP_
);
extract_entropy
(
&
nonblocking_pool
,
buf
,
nbytes
,
0
,
0
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment