public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Hillf Danton <hdanton@sina.com>,
	syzbot <syzbot+3ba551855046ba3b3806@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in dma_map_sgtable (2)
Date: Mon, 30 May 2022 22:45:34 -0700	[thread overview]
Message-ID: <YpWrfnkipIzoWEcd@infradead.org> (raw)
In-Reply-To: <20220530151044.GQ2146@kadam>

Someohow only the reply from Dan got delivered to me, not the mail
from Hillf he is replying to, so I'm abusing that to reply to the
previous mail..

On Mon, May 30, 2022 at 06:10:44PM +0300, Dan Carpenter wrote:
> > --- 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;
> > +		}
> >  	}

This is compeltely broken.  If the underlying device is ot DMA capable and
we can't just set a random mask and still allow DMA mappings.

  reply	other threads:[~2022-05-31  5:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30 12:48 [syzbot] WARNING in dma_map_sgtable (2) syzbot
     [not found] ` <20220530144542.4382-1-hdanton@sina.com>
2022-05-30 15:03   ` syzbot
2022-05-30 15:10   ` Dan Carpenter
2022-05-31  5:45     ` Christoph Hellwig [this message]
     [not found]     ` <20220531090418.4552-1-hdanton@sina.com>
2022-06-01  7:04       ` Christoph Hellwig

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=YpWrfnkipIzoWEcd@infradead.org \
    --to=hch@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+3ba551855046ba3b3806@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox