Commit e2b34835 authored by Steffen Klassert's avatar Steffen Klassert Committed by Linus Torvalds

crypto: pcrypt - Fix use after free on padata_free

kobject_put is called from padata_free for the padata kobject.
The kobject's release function frees the padata instance,
so don't call kobject_put for the padata kobject from pcrypt.
Reported-and-tested-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bd760e1e
...@@ -504,7 +504,6 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt, ...@@ -504,7 +504,6 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
static void pcrypt_fini_padata(struct padata_pcrypt *pcrypt) static void pcrypt_fini_padata(struct padata_pcrypt *pcrypt)
{ {
kobject_put(&pcrypt->pinst->kobj);
free_cpumask_var(pcrypt->cb_cpumask->mask); free_cpumask_var(pcrypt->cb_cpumask->mask);
kfree(pcrypt->cb_cpumask); kfree(pcrypt->cb_cpumask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment