Bug 178651

Summary: pcrypt module crashes after crypto algorithm is unregistered
Product: Other Reporter: Luka Logar (luka.logar)
Component: ModulesAssignee: other_modules
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: all since 3.11 Subsystem:
Regression: No Bisected commit-id:
Attachments: A patch for this bug...

Description Luka Logar 2016-10-20 13:00:35 UTC
Created attachment 242071 [details]
A patch for this bug...

When using crconf utility do add/delete parallelized crypto algorithms to the crypto subsystem I have observed random crashes after deleting them with "crconf del..."

Analyzing the code I've found the following:

When instantiating a parallelized crypto algorithm - in function pcrypt_create_aead() - a struct aead_instance is kzalloc()-ed. However later,
when/if the crypto algorithm is deregistered, the pcrypt_free() function is called with a struct crypto_instance as parameter. As crypto_instance is kfree()-ed, this sooner or later causes a kernel crash.

The attached patch fixes this bug.