提交 52176603 编写于 作者: D Dan Carpenter 提交者: James Morris

KEYS: Use memzero_explicit() for secret data

I don't think GCC has figured out how to optimize the memset() away, but
they might eventually so let's future proof this code a bit.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Acked-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: NJames Morris <james.l.morris@oracle.com>
上级 57cb17e7
...@@ -985,7 +985,7 @@ static void encrypted_destroy(struct key *key) ...@@ -985,7 +985,7 @@ static void encrypted_destroy(struct key *key)
if (!epayload) if (!epayload)
return; return;
memset(epayload->decrypted_data, 0, epayload->decrypted_datalen); memzero_explicit(epayload->decrypted_data, epayload->decrypted_datalen);
kfree(key->payload.data[0]); kfree(key->payload.data[0]);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册