[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220530151044.GQ2146@kadam>
Date: Mon, 30 May 2022 18:10:44 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Hillf Danton <hdanton@...a.com>
Cc: syzbot <syzbot+3ba551855046ba3b3806@...kaller.appspotmail.com>,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] WARNING in dma_map_sgtable (2)
On Mon, May 30, 2022 at 10:45:42PM +0800, Hillf Danton wrote:
> To queisce the warning, make udmabuf misc device dma capable by default.
>
> #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7e062cda7d90
>
> --- y/drivers/dma-buf/udmabuf.c
> +++ u/drivers/dma-buf/udmabuf.c
> @@ -273,6 +273,14 @@ static long udmabuf_create(struct miscde
> if (IS_ERR(buf)) {
> ret = PTR_ERR(buf);
> goto err;
> + } else {
> + struct device *dev = ubuf->device->this_device;
> +
> + if (!dev->dma_mask) {
> + ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
> + if (ret)
> + goto err;
> + }
> }
>
> flags = 0;
Unrelated to your patch. In this function do we not need to cleanup if
dma_buf_fd(buf, flags); fails?
After dma_buf_fd() then the fd is exported so we can't clean up, but it
should be okay to clean up if dma_buf_fd() fails.
regards,
dan carpenter
Powered by blists - more mailing lists