[PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Daniel Vetter
On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski 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 not increase r

[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

[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 lo

[PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Dave Airlie
On Tue, May 22, 2012 at 4:05 PM, Daniel Vetter wrote: > On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski > 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 wi

[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 e

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

2012-05-22 Thread Rob Clark
On Tue, May 22, 2012 at 9:13 AM, Dave Airlie wrote: > On Tue, May 22, 2012 at 4:05 PM, Daniel Vetter wrote: >> On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski >> wrote: >>> On 05/22/2012 04:32 PM, Daniel Vetter wrote: On Tue, May 22, 2012 at 03:47:12PM +0200, Tomasz Stanislawski wrote:

[PATCH] dma-buf: add get_dma_buf()

2012-05-22 Thread Rob Clark
On Tue, May 22, 2012 at 9:13 AM, Dave Airlie wrote: > On Tue, May 22, 2012 at 4:05 PM, Daniel Vetter wrote: >> On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski >> wrote: >>> On 05/22/2012 04:32 PM, Daniel Vetter wrote: On Tue, May 22, 2012 at 03:47:12PM +0200, Tomasz Stanislawski wrote:

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 wrote: > On Tue, May 22, 2012 at 5:00 PM, Tomasz Stanislawski > 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 wi

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 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 not increase r

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

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 lo

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 e

[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 wrote: > > > On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark > > > wrote: > > >> From: Rob Clark > > >> > > >> Works in a similar way

[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 wrote: > > On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark wrote: > >> From: Rob Clark > >> > >> Works in a similar way to get_file(), and is needed in cases such as > >> when the exporter needs to als

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

2012-03-18 Thread Sumit Semwal
On 16 March 2012 23:23, Dave Airlie wrote: > On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark wrote: >> From: Rob Clark >> >> 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

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 wrote: > > > On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark wrote: > > >> From: Rob Clark > > >> > > >> Works in a similar way to get

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 wrote: > > On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark wrote: > >> From: Rob Clark > >> > >> Works in a similar way to get_file(), and is needed in cases such as > >> when the exporter needs to als

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 wrote: > On Fri, Mar 16, 2012 at 4:04 PM, Rob Clark wrote: >> From: Rob Clark >> >> 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

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

2012-03-17 Thread Kyungmin Park
Reviewed-by: Kyungmin Park On 3/17/12, Rob Clark wrote: > From: Rob Clark > > 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

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

2012-03-16 Thread Kyungmin Park
Reviewed-by: Kyungmin Park On 3/17/12, Rob Clark wrote: > From: Rob Clark > > 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

[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 wrote: > From: Rob Clark > > 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. > > Si

[PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Rob Clark
From: Rob Clark 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 --- Minor update on original to add a mis

[PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Rob Clark
From: Rob Clark 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 --- Minor update on original to add a mis

[PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Rob Clark
From: Rob Clark 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 --- include/linux/dma-buf.h | 14 +

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 wrote: > From: Rob Clark > > 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. > > Si

[PATCH] dma-buf: add get_dma_buf()

2012-03-16 Thread Rob Clark
From: Rob Clark 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 --- include/linux/dma-buf.h | 14 +