crypto : asymmetric_keys : verify_pefile:zero memory content before freeing
authorLoganaden Velvindron <logan@hackers.mu>
Thu, 8 Jun 2017 13:50:04 +0000 (14:50 +0100)
committerJames Morris <james.l.morris@oracle.com>
Fri, 9 Jun 2017 03:29:50 +0000 (13:29 +1000)
Signed-off-by: Loganaden Velvindron <logan@hackers.mu>
Signed-off-by: Yasir Auleear <yasirmx@hackers.mu>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
crypto/asymmetric_keys/verify_pefile.c

index 672a94c2c3ffa3a8683dfb7f02134a27d92a641e..d178650fd524cfe8bc390c883505f4cbc31d60f2 100644 (file)
@@ -381,7 +381,7 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen,
        }
 
 error:
-       kfree(desc);
+       kzfree(desc);
 error_no_desc:
        crypto_free_shash(tfm);
        kleave(" = %d", ret);
@@ -450,6 +450,6 @@ int verify_pefile_signature(const void *pebuf, unsigned pelen,
        ret = pefile_digest_pe(pebuf, pelen, &ctx);
 
 error:
-       kfree(ctx.digest);
+       kzfree(ctx.digest);
        return ret;
 }