Skip to content

Commit

Permalink
zero sensitive information with explicit_bzero
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Jun 1, 2020
1 parent 0961441 commit aa9cc05
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions init/security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Result<Success> MixHwrngIntoLinuxRngAction(const BuiltinArguments&) {
}

chunk_size = TEMP_FAILURE_RETRY(write(urandom_fd, buf, chunk_size));
explicit_bzero(buf, chunk_size);
if (chunk_size == -1) {
return ErrnoError() << "Failed to write to /dev/urandom";
}
Expand Down

0 comments on commit aa9cc05

Please sign in to comment.