Re: [PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Tomasz Stanislawski
Hi, I think I discovered an interesting issue with dma_buf. I found out that dma_buf_fd does not increase reference count for dma_buf::file. This leads to potential kernel crash triggered by user space. Please, take a look on the scenario below: The applications spawns two thread. One of them is

Re: [PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Daniel Vetter
On Tue, May 22, 2012 at 03:47:12PM +0200, Tomasz Stanislawski wrote: Hi, I think I discovered an interesting issue with dma_buf. I found out that dma_buf_fd does not increase reference count for dma_buf::file. This leads to potential kernel crash triggered by user space. Please, take a look

Re: [PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Tomasz Stanislawski
On 05/22/2012 04:32 PM, Daniel Vetter wrote: On Tue, May 22, 2012 at 03:47:12PM +0200, Tomasz Stanislawski wrote: Hi, I think I discovered an interesting issue with dma_buf. I found out that dma_buf_fd does not increase reference count for dma_buf::file. This leads to potential kernel crash

Re: [PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Daniel Vetter
On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski t.stanisl...@samsung.com wrote: On 05/22/2012 04:32 PM, Daniel Vetter wrote: On Tue, May 22, 2012 at 03:47:12PM +0200, Tomasz Stanislawski wrote: Hi, I think I discovered an interesting issue with dma_buf. I found out that dma_buf_fd does

Re: [PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Dave Airlie
On Tue, May 22, 2012 at 4:05 PM, Daniel Vetter dan...@ffwll.ch wrote: On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski t.stanisl...@samsung.com wrote: On 05/22/2012 04:32 PM, Daniel Vetter wrote: On Tue, May 22, 2012 at 03:47:12PM +0200, Tomasz Stanislawski wrote: Hi, I think I

Re: [Linaro-mm-sig] [PATCH] dma-buf: add get_dma_buf()

2012-03-18 Thread Sumit Semwal
On 16 March 2012 23:23, Dave Airlie airl...@gmail.com wrote: On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark rob.cl...@linaro.org wrote: From: Rob Clark r...@ti.com Works in a similar way to get_file(), and is needed in cases such as when the exporter needs to also keep a reference to the dmabuf

Re: [Linaro-mm-sig] [PATCH] dma-buf: add get_dma_buf()

2012-03-18 Thread Daniel Vetter
On Sun, Mar 18, 2012 at 01:12:22PM +0530, Sumit Semwal wrote: On 16 March 2012 23:23, Dave Airlie airl...@gmail.com wrote: On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark rob.cl...@linaro.org wrote: From: Rob Clark r...@ti.com Works in a similar way to get_file(), and is needed in cases such

Re: [Linaro-mm-sig] [PATCH] dma-buf: add get_dma_buf()

2012-03-18 Thread Daniel Vetter
On Sun, Mar 18, 2012 at 08:04:53PM +0100, Daniel Vetter wrote: On Sun, Mar 18, 2012 at 01:12:22PM +0530, Sumit Semwal wrote: On 16 March 2012 23:23, Dave Airlie airl...@gmail.com wrote: On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark rob.cl...@linaro.org wrote: From: Rob Clark r...@ti.com

[PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Rob Clark
From: Rob Clark r...@ti.com Works in a similar way to get_file(), and is needed in cases such as when the exporter needs to also keep a reference to the dmabuf (that is later released with a dma_buf_put()), and possibly other similar cases. Signed-off-by: Rob Clark r...@ti.com ---

Re: [Linaro-mm-sig] [PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Dave Airlie
On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark rob.cl...@linaro.org wrote: From: Rob Clark r...@ti.com Works in a similar way to get_file(), and is needed in cases such as when the exporter needs to also keep a reference to the dmabuf (that is later released with a dma_buf_put()), and possibly

[PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Rob Clark
From: Rob Clark r...@ti.com Works in a similar way to get_file(), and is needed in cases such as when the exporter needs to also keep a reference to the dmabuf (that is later released with a dma_buf_put()), and possibly other similar cases. Signed-off-by: Rob Clark r...@ti.com --- Minor update

Re: [Linaro-mm-sig] [PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Kyungmin Park
Reviewed-by: Kyungmin Park kyungmin.p...@samsung.com On 3/17/12, Rob Clark rob.cl...@linaro.org wrote: From: Rob Clark r...@ti.com Works in a similar way to get_file(), and is needed in cases such as when the exporter needs to also keep a reference to the dmabuf (that is later released with