diff options
author | Eric Biggers <ebiggers@google.com> | 2017-12-20 14:28:25 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-10 09:27:09 +0100 |
commit | 3ad85176e78d6671ede52eed588c3588d087b587 (patch) | |
tree | 9d4e2e4a1cd76722c720edcf38d9b6056f9198cd /crypto/shash.c | |
parent | 869994e0bd2911ed07169e11362c479e4c98fd78 (diff) |
crypto: pcrypt - fix freeing pcrypt instances
commit d76c68109f37cb85b243a1cf0f40313afd2bae68 upstream.
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: 0496f56065e0 ("crypto: pcrypt - Add support for new AEAD interface")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/shash.c')
0 files changed, 0 insertions, 0 deletions