lkml.org 
[lkml]   [2022]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [syzbot] WARNING in dma_map_sgtable (2)
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.

\
 
 \ /
  Last update: 2022-05-31 07:46    [W:0.483 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site