mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-07-06 03:21:15 +00:00
22 lines
751 B
Diff
22 lines
751 B
Diff
![]() |
From abdf523d26450814fc3f5c211f3baa643c48bae3 Mon Sep 17 00:00:00 2001
|
||
|
From: Daniel Micay <danielmicay@gmail.com>
|
||
|
Date: Fri, 6 Feb 2015 11:41:57 -0500
|
||
|
Subject: [PATCH] zero sensitive information with explicit_bzero
|
||
|
|
||
|
---
|
||
|
init/security.cpp | 1 +
|
||
|
1 file changed, 1 insertion(+)
|
||
|
|
||
|
diff --git a/init/security.cpp b/init/security.cpp
|
||
|
index a3494a280bd..4b6c918ab30 100644
|
||
|
--- a/init/security.cpp
|
||
|
+++ b/init/security.cpp
|
||
|
@@ -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";
|
||
|
}
|