mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-crypto@vger.kernel.org
Subject: Re: Linux 2.6.37-rc1 (pcrypt fault)
Date: Wed, 10 Nov 2010 12:21:43 +0100	[thread overview]
Message-ID: <20101110112143.GB1868@secunet.com> (raw)
In-Reply-To: <20101103141519.0a6f5906.randy.dunlap@oracle.com>

On Wed, Nov 03, 2010 at 02:15:19PM -0700, Randy Dunlap wrote:
> 
> modprobe pcrypt; rmmod pcrypt ==>
> 
> 
> [   76.081639] calling  pcrypt_init+0x0/0x107 [pcrypt] @ 3016
> Nov  3 13:02:15 control kernel: [   76.089883] initcall pcrypt_init+0x0/0x107 [pcrypt] returned 0 after 2476 usecs
> [   76.081639] calling  pcrypt_i
> 
> 
> [   79.940445] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC

Looks like a use after free of the padata instance.
Does the patch below fix it?

Thanks for reporting,

Steffen


Subject: [PATCH] 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.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.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


  reply	other threads:[~2010-11-10 11:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 12:07 Linux 2.6.37-rc1 Linus Torvalds
2010-11-01 15:37 ` Thomas Gleixner
2010-11-01 15:47   ` Nick Bowler
2010-11-01 15:52     ` Ryusuke Konishi
2010-11-01 16:07       ` Linus Torvalds
2010-11-02 18:51 ` Linux 2.6.37-rc1 (acpi_video) Randy Dunlap
2010-11-03 21:08 ` Linux 2.6.37-rc1 (cciss: remove_proc_entry warning) Randy Dunlap
2010-11-03 21:15 ` Linux 2.6.37-rc1 (pcrypt fault) Randy Dunlap
2010-11-10 11:21   ` Steffen Klassert [this message]
2010-11-10 18:11     ` Randy Dunlap
2010-11-03 21:21 ` Linux 2.6.37-rc1 (net/sched: cls_cgroup) Randy Dunlap
2010-11-03 22:01   ` Eric Dumazet
2010-11-03 22:19     ` Li Zefan
2010-11-03 22:31       ` Li Zefan
2010-11-03 23:31     ` Herbert Xu
2010-11-04  1:46       ` Li Zefan
2010-11-04  1:56       ` David Miller
2010-11-04 15:56       ` Randy Dunlap
2010-11-03 23:16 ` Linux 2.6.37-rc1 (floppy module load: no device found) Randy Dunlap
2010-11-05 22:10   ` Linus Torvalds
2010-11-05 22:12     ` David Miller
2010-11-05 23:03     ` Randy Dunlap
2010-11-05 23:36       ` Linus Torvalds
2010-11-06  0:33         ` Randy Dunlap
2010-11-06 12:16         ` Vivek Goyal
2010-11-06 14:52           ` Linus Torvalds
2010-11-03 23:18 ` Linux 2.6.37-rc1 (libipw remove_proc_entry warning) Randy Dunlap
2010-11-05 22:24   ` Linus Torvalds
2010-11-05 23:06     ` Randy Dunlap
2010-11-05 23:38       ` Linus Torvalds
2010-11-08 21:33         ` John W. Linville
2010-11-03 23:20 ` Linux 2.6.37-rc1 (scsi_debug: list corruption) Randy Dunlap
2010-11-04  2:25   ` Xiaotian Feng
2010-11-04 16:12     ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101110112143.GB1868@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome