All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-dmapool-fix-possible-use-after-free-in-dmam_pool_destroy.patch added to -mm tree
@ 2011-06-09 22:36 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2011-06-09 22:36 UTC (permalink / raw)
  To: mm-commits; +Cc: maxin.john, eike-kernel


The patch titled
     mm/dmapool.c: fix possible use after free in dmam_pool_destroy()
has been added to the -mm tree.  Its filename is
     mm-dmapool-fix-possible-use-after-free-in-dmam_pool_destroy.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: mm/dmapool.c: fix possible use after free in dmam_pool_destroy()
From: Maxin B John <maxin.john@gmail.com>

"dma_pool_destroy(pool)" calls "kfree(pool)".  The freed pointer "pool" is
again passed as an argument to the function "devres_destroy()".  This
patch fixes the possible use after free.

It's notabug at this time, but the code is dangerous.

Signed-off-by: Maxin B. John <maxin.john@gmail.com>
Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/dmapool.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/dmapool.c~mm-dmapool-fix-possible-use-after-free-in-dmam_pool_destroy mm/dmapool.c
--- a/mm/dmapool.c~mm-dmapool-fix-possible-use-after-free-in-dmam_pool_destroy
+++ a/mm/dmapool.c
@@ -500,7 +500,7 @@ void dmam_pool_destroy(struct dma_pool *
 {
 	struct device *dev = pool->dev;
 
-	dma_pool_destroy(pool);
 	WARN_ON(devres_destroy(dev, dmam_pool_release, dmam_pool_match, pool));
+	dma_pool_destroy(pool);
 }
 EXPORT_SYMBOL(dmam_pool_destroy);
_

Patches currently in -mm which might be from maxin.john@gmail.com are

linux-next.patch
mm-dmapool-fix-possible-use-after-free-in-dmam_pool_destroy.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-09 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09 22:36 + mm-dmapool-fix-possible-use-after-free-in-dmam_pool_destroy.patch added to -mm tree akpm

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.