]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: pcrypt - Fix user-after-free on module unload
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 19 Nov 2019 09:41:31 +0000 (17:41 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 22 May 2020 20:19:14 +0000 (21:19 +0100)
commit587aa653021a37163da8f954df8bcd5dcd2f5c79
treeb042e607548c1a057a55fdfe081df772022e6e52
parenta0fc373c3514e8e1e3be6548a12bbee469a48198
crypto: pcrypt - Fix user-after-free on module unload

commit 07bfd9bdf568a38d9440c607b72342036011f727 upstream.

On module unload of pcrypt we must unregister the crypto algorithms
first and then tear down the padata structure.  As otherwise the
crypto algorithms are still alive and can be used while the padata
structure is being freed.

Fixes: 5068c7a883d1 ("crypto: pcrypt - Add pcrypt crypto...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
crypto/pcrypt.c