diff options
author | Eric Biggers <ebiggers@google.com> | 2017-12-20 14:28:25 -0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-12-22 19:02:47 +1100 |
commit | 668802507e1796b14c57704545799b8fe6daf744 (patch) | |
tree | 63684c527600e450488a12f127f4e4cae10c7d2f /crypto/asymmetric_keys/x509_public_key.c | |
parent | 43f9357cf31ea12d38255736060cf7cb2e42a260 (diff) | |
download | linux-crypto-668802507e1796b14c57704545799b8fe6daf744.tar.gz linux-crypto-668802507e1796b14c57704545799b8fe6daf744.zip |
crypto: pcrypt - fix freeing pcrypt instances
pcrypt is using the old way of freeing instances, where the ->free()
method specified in the 'struct crypto_template' is passed a pointer to
the 'struct crypto_instance'. But the crypto_instance is being
kfree()'d directly, which is incorrect because the memory was actually
allocated as an aead_instance, which contains the crypto_instance at a
nonzero offset. Thus, the wrong pointer was being kfree()'d.
Fix it by switching to the new way to free aead_instance's where the
->free() method is specified in the aead_instance itself.
Reported-by: syzbot <syzkaller@googlegroups.com>
Fixes: e37abc3dbfb5 ("crypto: pcrypt - Add support for new AEAD interface")
Cc: <stable@vger.kernel.org> # v4.2+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/asymmetric_keys/x509_public_key.c')
0 files changed, 0 insertions, 0 deletions