Bug 178651 - pcrypt module crashes after crypto algorithm is unregistered
Summary: pcrypt module crashes after crypto algorithm is unregistered
Status: NEW
Alias: None
Product: Other
Classification: Unclassified
Component: Modules (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: other_modules
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-20 13:00 UTC by Luka Logar
Modified: 2016-10-20 13:00 UTC (History)
0 users

See Also:
Kernel Version: all since 3.11
Subsystem:
Regression: No
Bisected commit-id:


Attachments
A patch for this bug... (313 bytes, application/octet-stream)
2016-10-20 13:00 UTC, Luka Logar
Details

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.

Note You need to log in before you can comment on or make changes to this bug.