Re: [stable] [PATCH] dmaengine: Fix broken device refcounting

From: Greg KH
Date: Wed Nov 14 2007 - 16:56:41 EST


On Wed, Nov 07, 2007 at 11:46:07AM -0700, Dan Williams wrote:
> From: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
>
> When a DMA device is unregistered, its reference count is decremented
> twice for each channel: Once dma_class_dev_release() and once in
> dma_chan_cleanup(). This may result in the DMA device driver's
> remove() function completing before all channels have been cleaned
> up, causing lots of use-after-free fun.
>
> Fix it by incrementing the device's reference count twice for each
> channel during registration.
>
> Signed-off-by: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
> [dan.j.williams@xxxxxxxxx: kill unnecessary client refcounting]
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> Signed-off-by: Shannon Nelson <shannon.nelson@xxxxxxxxx>
> Cc: stable@xxxxxxxxxx

I don't see this in Linus's tree yet, right?

When it goes in, can you resend it to the stable@xxxxxxxxxx people?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/