Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6140226ybv; Tue, 18 Feb 2020 10:41:53 -0800 (PST) X-Google-Smtp-Source: APXvYqyHiA3rczmnwXR9b8h4saCbeB/Q14wiMcq28CduKKcAwjkzeMdANMXIz+hnY6nL3KdwISF9 X-Received: by 2002:a05:6808:5d0:: with SMTP id d16mr2145344oij.45.1582051313623; Tue, 18 Feb 2020 10:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582051313; cv=none; d=google.com; s=arc-20160816; b=k+mTSnYBNnxzlvlGtX49eBs0B5jFOwXCd5RbT7urHdgv5v/AjUbrT1fsn3GFjeW2qD aExXwSxDxy+7BkEMTV6BucsapisG4Z7a97z9+M4U+4J7nm9H+DKOvySqmLQ5tEMAHZk/ YUD8v7rHvK9kl5g38mEMQswp1kb3lhLg3tio0jtbz6l6oattp4lo++M8RX0gb+9OJYZN JBGjpPCEL/0qcJ5rdDaaEG/SRU8QTNBjBTyByQjfq8HKrjN84oRSSrzUCYkTmPfcSo7K LvzJyZ5buntKK3+eva0NIYtJWtcOKoANJSjNShmgNZpI4gycXd2QBA/uE8A187c8r8yw mPLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+8trNULk0p7YTqlS76VkwaHxCoBJjgc3YSZwDVrMPcc=; b=yDlLYIumS78udlQ+5ZMwf6yzfpsdrfFVOWj1hvjzmEVABtGEstUPlMvS1pxVNInSOj 6qcqxJriZR17ndqbq2PdZf8giDOm2pg7blHGxM8jtF0zdxTjohs7a+PdDd/PExMUBebr WDo4+H12UuAQ14bBB923cgVUAGFWAFMQc+4BVW/eB95+4VI0WjmRJC30YQQv+n/RYLBB im1qOzaQP1iZUEvrh4qxIHSea0Q0oA0Vxe/FL05zQ0tQ17bifSCso4ScceHrM2FlHTo1 RzecTwP4NzCsmIpy3CcVtv6DMFuVtGDk7JbN5uLSdOSqrN2YhHaUV0t0bSvBzKT2d+Rj /sOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h6M6HrVl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si7577133oip.248.2020.02.18.10.41.41; Tue, 18 Feb 2020 10:41:53 -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=@google.com header.s=20161025 header.b=h6M6HrVl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbgBRSl3 (ORCPT + 99 others); Tue, 18 Feb 2020 13:41:29 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:43475 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbgBRSl2 (ORCPT ); Tue, 18 Feb 2020 13:41:28 -0500 Received: by mail-qt1-f193.google.com with SMTP id d18so15261993qtj.10 for ; Tue, 18 Feb 2020 10:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+8trNULk0p7YTqlS76VkwaHxCoBJjgc3YSZwDVrMPcc=; b=h6M6HrVl/s5ivPkO5Z1ae1j41oRDK/YZ/CMQeyTHeCm70Xf8uzH3NUd2U1TEIBQctu zaEPJnigmUn3fvfj0Sa0Vtkti5inbKWVcYrGvzz2Z9j3tAywKdkucVFFz9PkvyoLP6wY /5mIIY9IuOmrH7z2JMau9X++QuLwtDTXvMskap9MpzjyVWX//o0rQmGkyGijHqEUft0+ AU7HWAlmw783ySPgijXZvqNYfdh2o/ASnQ85K/RkvHNBsduuWv8f5kxmfZKVXm30kVa7 V0121A5vUilpN8Q72rXVxAfFiad3uPlDcFp8JTCASh2TMuKUxiBf1gGHBdEe1Hb0xtjP zpcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+8trNULk0p7YTqlS76VkwaHxCoBJjgc3YSZwDVrMPcc=; b=gr5wWMrrlKZiw4eIQzfSGIR2vm/ekKAOAjrRfebiGh6ObSZnbdjTkAXirA3dhtvs7q QQLMAE5ir0GaBWEcvx4XJQ4o+b0dbkLH3Y17aIzD8Enpi7J8Rcw2k4JPdXwZ3YQ1edz6 jcmRlVpeDgkxPhF3HlpmUUr9eMqf3u/N+4C6I2SxtP/NKiuL3eFvoJ5hBwfHNRNfvb9h d8j0NDQ85m+CwKUgk+BqWdPux78iU2K2Cxtli2OXpUgiBo9hpOehmchll14rFc+G4CO8 8HQkhwvLDyc+2aXqpNFhoqBrjloYxAKZ4jS9zi+bBw7FN0wy9mrMtye5KYpvziirDJl9 brZw== X-Gm-Message-State: APjAAAVI/TyKNsrLBYoJT/HWiK5CDvMs/Pjy8ROIevHTgJFioEehamkd l+pKtUia2of1VLRxolowAUWoRPT9Zskbmwl5c10aJA== X-Received: by 2002:ac8:2ffa:: with SMTP id m55mr18764287qta.189.1582051287712; Tue, 18 Feb 2020 10:41:27 -0800 (PST) MIME-Version: 1.0 References: <20191227063204.5813-1-xiyou.wangcong@gmail.com> In-Reply-To: <20191227063204.5813-1-xiyou.wangcong@gmail.com> From: Chenbo Feng Date: Tue, 18 Feb 2020 10:41:16 -0800 Message-ID: Subject: Re: [PATCH] dma-buf: free dmabuf->name in dma_buf_release() To: Cong Wang Cc: DRI mailing list , LKML , linux-media@vger.kernel.org, syzbot+b2098bc44728a4efb3e9@syzkaller.appspotmail.com, Greg Hackmann , Sumit Semwal Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Chenbo Feng On Thu, Dec 26, 2019 at 10:32 PM Cong Wang wrote: > > 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 >