summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-06-30 10:21:17 +1000
committerPauli <pauli@openssl.org>2021-07-01 13:18:58 +1000
commit514b76917c36836ae4243392e71785f01d8233c9 (patch)
tree175e56d3d4a2742f5a72e8ae92a2fc917c68b5c3 /engines
parentd720e60357c0a477ff547edac539d15b0a9e320e (diff)
downloadopenssl-new-514b76917c36836ae4243392e71785f01d8233c9.tar.gz
afalg: add some memory initialisation calls to pacify memory sanitisation.
The engine is modifying memory without the sanitiser realising. By pre- initialising this memory, the sanitiser now thinks that read accesses are okay. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/15952)
Diffstat (limited to 'engines')
-rw-r--r--engines/e_afalg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/e_afalg.c b/engines/e_afalg.c
index f36665acf6..d8d3ef610c 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -324,6 +324,15 @@ static int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
}
if (eval > 0) {
+#ifdef OSSL_SANITIZE_MEMORY
+ /*
+ * In a memory sanitiser build, the changes to memory made by the
+ * system call aren't reliably detected. By initialising the
+ * memory here, the sanitiser is told that they are okay.
+ */
+ memset(events, 0, sizeof(events));
+#endif
+
/* Get results of AIO read */
r = io_getevents(aio->aio_ctx, 1, MAX_INFLIGHTS,
events, &timeout);