All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	Cong Wang <xiyou.wangcong@gmail.com>,
	syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com,
	Greg Hackmann <ghackmann@google.com>,
	Chenbo Feng <fengc@google.com>,
	Sumit Semwal <sumit.semwal@linaro.org>
Subject: [PATCH] dma-buf: free dmabuf->name in dma_buf_release()
Date: Thu, 26 Dec 2019 22:32:04 -0800	[thread overview]
Message-ID: <20191227063204.5813-1-xiyou.wangcong@gmail.com> (raw)

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


WARNING: multiple messages have this Message-ID (diff)
From: Cong Wang <xiyou.wangcong@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Chenbo Feng <fengc@google.com>,
	linux-kernel@vger.kernel.org,
	Greg Hackmann <ghackmann@google.com>,
	syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com,
	Cong Wang <xiyou.wangcong@gmail.com>,
	linux-media@vger.kernel.org
Subject: [PATCH] dma-buf: free dmabuf->name in dma_buf_release()
Date: Thu, 26 Dec 2019 22:32:04 -0800	[thread overview]
Message-ID: <20191227063204.5813-1-xiyou.wangcong@gmail.com> (raw)

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-12-27  6:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27  6:32 Cong Wang [this message]
2019-12-27  6:32 ` [PATCH] dma-buf: free dmabuf->name in dma_buf_release() Cong Wang
2020-02-18 18:40 ` Chenbo Feng
2020-02-18 18:41 ` Chenbo Feng
2020-02-18 18:41   ` Chenbo Feng
2020-02-25 20:44 Cong Wang
2020-02-25 20:44 ` Cong Wang
2020-02-26  1:54 ` Andrew Morton
2020-02-26  1:54   ` Andrew Morton
2020-02-27 21:38   ` Cong Wang
2020-02-27 21:38     ` Cong Wang
2020-02-27 21:45     ` Andrew Morton
2020-02-27 21:45       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191227063204.5813-1-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fengc@google.com \
    --cc=ghackmann@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.