[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110609102038.GE11773@htj.dyndns.org>
Date: Thu, 9 Jun 2011 12:20:38 +0200
From: Tejun Heo <tj@...nel.org>
To: Maxin B John <maxin.john@...il.com>
Cc: eike-kernel@...tec.de, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
dima@...roid.com, willy@...ux.intel.com, segooon@...il.com,
jkosina@...e.cz, tglx@...utronix.de
Subject: Re: [PATCH] mm: dmapool: fix possible use after free in
dmam_pool_destroy()
Hello,
On Thu, Jun 02, 2011 at 05:22:42PM +0300, Maxin B John wrote:
> > The pool itself is not used there, only the address where the pool
> > has been.This will only lead to any trouble if something else is allocated to
> > the same place and inserted into the devres list of the same device between
> > the dma_pool_destroy() and devres_destroy().
Which can't happen. devres release is bound to device driver model
and a device can't be re-attached before release is complete.
ie. those operations are serialized, so the failure mode is only
theoretical.
> Thank you very much for explaining it in detail.
>
> > But I agree that this is bad style. But if you are going to change
> > this please also have a look at devm_iounmap() in lib/devres.c. Maybe also the
> > devm_*irq* functions need the same changes.
>
> As per your suggestion, I have made similar modifications for lib/devres.c and
> kernel/irq/devres.c
>
> CCed the maintainers of the respective files.
>
> Signed-off-by: Maxin B. John <maxin.john@...il.com>
But it shouldn't hurt and if it helps memleak.
Acked-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists