Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10625423ybl; Thu, 26 Dec 2019 22:33:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxobnOexPUy9SMfrflhgweTLgn/FN1QQxCZkqbhh08ApU9ILqSWjG3c1zpoG16Ed+r2yId+ X-Received: by 2002:a9d:6f0a:: with SMTP id n10mr56816400otq.54.1577428428435; Thu, 26 Dec 2019 22:33:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577428428; cv=none; d=google.com; s=arc-20160816; b=Y8cj5TtxovOcWJ5jtLBFwbtkRBrjzfvcpxa7l/2P4Zg2zs8kqmKFHXY6mgiFXUlnqu BWlgeKRiTdv3FiYV0Bk7ehAQzHLWJ7g9WEf/mDDAojd6WJjbiMrVcCxdTrQ3xXW/MDN1 xbxG96je9CUQf79Hfoz6DwKGqUWalekyggX7rEMg/xkIfgGnDSccinE8qC920FA8KNFA gC81PR5r1DYPHwO1RvYYOwy5qgkiZy3RgTWLbtyXZUGnomDYexazFWJlsOhA43ysPq0h u4my4Tcb4TndG8m2lbahpwBiciopEbAgx48nSP9WxnwuOx+R5+43tHS2gDM4B7EQ008a QRXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2aAZsrFg19vll1emaW6XpIeha1H0m56azXvY0CR3CNI=; b=p6x3v4zunDhbiIbaT+Zn44acdRZcn3tpmnhxd+N+5Rjxy06KuzMNyQDI4goAk2ycvR W3eMznyyqLA7f7MeY3rtnqItv8R9KpSJ5e4/LVDU9Ola+yBdgq34yXHVZuSMjChgI/Ca ScX3N+bLOzyKE3O8dd7PVi7TVnNyfHmWOF+7ZIa1seywRZVgXV5JkEbXEtPmIpBeuaPX bEBfp7M1eaTUnoM7lZbiRqz3S9Q8GD3Lj4zS0JhU8PHC7stPjni6AAQ+wYp/A6NSz7vi kw7LlQKe582/TryBbCoyTgGqkZcI+Wjrw+oZyfFTN0Tafbyeh89jGiMbr9kuG3QGjq7j hXnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QVLqmpEA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m82si15311098oig.129.2019.12.26.22.33.34; Thu, 26 Dec 2019 22:33:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QVLqmpEA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726297AbfL0Gck (ORCPT + 99 others); Fri, 27 Dec 2019 01:32:40 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44413 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfL0Gck (ORCPT ); Fri, 27 Dec 2019 01:32:40 -0500 Received: by mail-pf1-f194.google.com with SMTP id 195so13427805pfw.11; Thu, 26 Dec 2019 22:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2aAZsrFg19vll1emaW6XpIeha1H0m56azXvY0CR3CNI=; b=QVLqmpEAbgO2c42Y8tN7yjEwEflGvvFkcpiVcMD3XIqLRILUAeL2JgE94lP0d2l6Jo 8Olnde1TWqU37CNeGWvivKNnyz2cP4Hwd2dzMYqXlB6DHV56xEmF/XZO0a1Mhp591qHJ mvrM/dnOi92oltV+os0KafIuom1VBvkfu30pivZzaFTDpeM6K1nLYhUN/Sy5EVtqVfSr 7hexdgBSXUopcPY9xUp3khH7XPKs9RJTovJ/mmCKwWcE+7GwuP1GBI2yti1SkprgbHaf iU70Y1IKvUbosCXMhnpvOvCl233EWQzCNc08hlvDR/ahyEG4gHsXFb53b+45hLer3iG/ ZBZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2aAZsrFg19vll1emaW6XpIeha1H0m56azXvY0CR3CNI=; b=hbSjwunGcmTvAWLDsEIKmh6ZS3n2QxusLjnpAgdIqkyzrF76T9h5G+6OualvKkNHQN WEiQJuWOlB+qP+axYvFBAsp+MRpTiX2cg9mSMSFfSREmlpAbxfLpyijWqrrvKTdm3NMV dsXhq64TO7pjR1+tDmWXP96O9VuXrvj7o6kNbFZ0bth1j/js8Ek48clNlBFHSpjkYCwn 1xFR6zNTGAeNYdnJ3KHMnOVGmUeufDCD53Ypscvu/8ZUusg7O9hlbg/oGw9L0h+XlxLz /fFnO/4pzWCKsgP6mX3j5L7xpLVkjTruER1yl/qxcQbdXCk34/RdF3U3FmR4UW5ZTBRL g57w== X-Gm-Message-State: APjAAAWcikk0r6gXeskLZCbGyEtGEDREfihVZZqbH72+BSsg5YBnTgqw 4C/HUwMvKBca5Dxm1Nim+mSGebwY X-Received: by 2002:a63:215f:: with SMTP id s31mr51237960pgm.27.1577428359435; Thu, 26 Dec 2019 22:32:39 -0800 (PST) Received: from tw-172-25-31-76.office.twttr.net ([8.25.197.24]) by smtp.gmail.com with ESMTPSA id s18sm34388938pfh.179.2019.12.26.22.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 22:32:38 -0800 (PST) From: Cong Wang To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Cong Wang , syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com, Greg Hackmann , Chenbo Feng , Sumit Semwal Subject: [PATCH] dma-buf: free dmabuf->name in dma_buf_release() Date: Thu, 26 Dec 2019 22:32:04 -0800 Message-Id: <20191227063204.5813-1-xiyou.wangcong@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Chenbo Feng Cc: Sumit Semwal Signed-off-by: Cong Wang --- 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