Repository navigation
Commit ca467fa
Damian Rickard
Wipe memory reliably in Memory::Zero
Memory::Zero() used a plain memset(), which the compiler is free to remove
as a dead store when the buffer is not read afterwards. It backs
BufferPtr::Erase() and BufferPtr::Zero(), which are used to clear key
material and other secrets, so an elided memset can leave secrets in memory.
Use burn() instead, the same volatile-write wipe already used by
Buffer::Erase(). Memory::Zero is not called on the bulk encryption/I/O path,
so this has no throughput impact.1 parent d773ce9 commit ca467fa
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
0 commit comments