Skip to contentSkip to conversation

crypto: pcrypt - Fix use after free on padata_free

PATCH In review Steffen Klassert 2 participants 3 messages Nov 26, 2010

Subsystems (2)
lore
Share & tools
lore

Steffen Klassert

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 crypto/pcrypt.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
crypto/pcrypt.c +0 -1
index de30782..75586f1 100644
@@ -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);
 
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw
Quoted 7 lines · Steffen Klassert

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.

Linus has already taken this patch.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author maintainer
#2 lore raw
Quoted 11 lines · Herbert Xu
Quoted 7 lines · Steffen Klassert

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.

Linus has already taken this patch.

Ok, I applied it on top of crypto-2.6. So I did not notice that it is already in Linus tree.

Steffen