All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: pcrypt - Fix use after free on padata_free
@ 2010-11-26  7:49 Steffen Klassert
  2010-11-26  8:49 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Steffen Klassert @ 2010-11-26  7:49 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Randy Dunlap, linux-crypto

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-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 crypto/pcrypt.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index de30782..75586f1 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -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);
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: pcrypt - Fix use after free on padata_free
  2010-11-26  7:49 [PATCH] crypto: pcrypt - Fix use after free on padata_free Steffen Klassert
@ 2010-11-26  8:49 ` Herbert Xu
  2010-11-26  8:54   ` Steffen Klassert
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2010-11-26  8:49 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: Randy Dunlap, linux-crypto

On Fri, Nov 26, 2010 at 08:49:17AM +0100, Steffen Klassert wrote:
> 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-by: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> Tested-by: Randy Dunlap <randy.dunlap@oracle.com>

Linus has already taken this patch.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: pcrypt - Fix use after free on padata_free
  2010-11-26  8:49 ` Herbert Xu
@ 2010-11-26  8:54   ` Steffen Klassert
  0 siblings, 0 replies; 3+ messages in thread
From: Steffen Klassert @ 2010-11-26  8:54 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Randy Dunlap, linux-crypto

On Fri, Nov 26, 2010 at 04:49:15PM +0800, Herbert Xu wrote:
> On Fri, Nov 26, 2010 at 08:49:17AM +0100, Steffen Klassert wrote:
> > 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-by: Randy Dunlap <randy.dunlap@oracle.com>
> > Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> > Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
> 
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-26  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26  7:49 [PATCH] crypto: pcrypt - Fix use after free on padata_free Steffen Klassert
2010-11-26  8:49 ` Herbert Xu
2010-11-26  8:54   ` Steffen Klassert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.