crypto: pcrypt - Fix use after free on padata_free
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 10 Nov 2010 11:21:43 +0000 (12:21 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Nov 2010 15:58:46 +0000 (07:58 -0800)
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: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
crypto/pcrypt.c

index de3078215fe6eadd89f31bfd3a86f426a4a18015..75586f1f86e7b27632b1250b2e4572135bf03e1c 100644 (file)
@@ -504,7 +504,6 @@ err:
 
 static void pcrypt_fini_padata(struct padata_pcrypt *pcrypt)
 {
-       kobject_put(&pcrypt->pinst->kobj);
        free_cpumask_var(pcrypt->cb_cpumask->mask);
        kfree(pcrypt->cb_cpumask);