Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: pcrypt - Fix user-after-free on module unload

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...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+2 -1
+2 -1
crypto/pcrypt.c
··· 362 362 363 363 static void __exit pcrypt_exit(void) 364 364 { 365 + crypto_unregister_template(&pcrypt_tmpl); 366 + 365 367 pcrypt_fini_padata(pencrypt); 366 368 pcrypt_fini_padata(pdecrypt); 367 369 368 370 kset_unregister(pcrypt_kset); 369 - crypto_unregister_template(&pcrypt_tmpl); 370 371 } 371 372 372 373 subsys_initcall(pcrypt_init);