linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma-buf: free dmabuf->name in dma_buf_release()
@ 2020-02-25 20:44 Cong Wang
  2020-02-26  1:54 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Cong Wang @ 2020-02-25 20:44 UTC (permalink / raw)
  To: linux-media
  Cc: dri-devel, linux-kernel, linaro-mm-sig, Cong Wang,
	syzbot+b2098bc44728a4efb3e9, Chenbo Feng, Sumit Semwal,
	Andrew Morton, Linus Torvalds

dma-buff name can be set via DMA_BUF_SET_NAME ioctl, but once set
it never gets freed.

Free it in dma_buf_release().

Fixes: bb2bb9030425 ("dma-buf: add DMA_BUF_SET_NAME ioctls")
Reported-by: syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com
Acked-by: Chenbo Feng <fengc@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 drivers/dma-buf/dma-buf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index d4097856c86b..c343c7c10b4c 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -108,6 +108,7 @@ static int dma_buf_release(struct inode *inode, struct file *file)
 		dma_resv_fini(dmabuf->resv);
 
 	module_put(dmabuf->owner);
+	kfree(dmabuf->name);
 	kfree(dmabuf);
 	return 0;
 }
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] dma-buf: free dmabuf->name in dma_buf_release()
@ 2019-12-27  6:32 Cong Wang
  2020-02-18 18:41 ` Chenbo Feng
  0 siblings, 1 reply; 6+ messages in thread
From: Cong Wang @ 2019-12-27  6:32 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, linux-media, Cong Wang,
	syzbot+b2098bc44728a4efb3e9, Greg Hackmann, Chenbo Feng,
	Sumit Semwal

dma-buff name can be set via DMA_BUF_SET_NAME ioctl, but once set
it never gets freed.

Free it in dma_buf_release().

Fixes: bb2bb9030425 ("dma-buf: add DMA_BUF_SET_NAME ioctls")
Reported-by: syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com
Cc: Greg Hackmann <ghackmann@google.com>
Cc: Chenbo Feng <fengc@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 drivers/dma-buf/dma-buf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index ce41cd9b758a..2427398ff22a 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -108,6 +108,7 @@ static int dma_buf_release(struct inode *inode, struct file *file)
 		dma_resv_fini(dmabuf->resv);
 
 	module_put(dmabuf->owner);
+	kfree(dmabuf->name);
 	kfree(dmabuf);
 	return 0;
 }
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-27 21:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 20:44 [PATCH] dma-buf: free dmabuf->name in dma_buf_release() Cong Wang
2020-02-26  1:54 ` Andrew Morton
2020-02-27 21:38   ` Cong Wang
2020-02-27 21:45     ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2019-12-27  6:32 Cong Wang
2020-02-18 18:41 ` Chenbo Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).