lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190524061936.GA2337@lst.de>
Date:   Fri, 24 May 2019 08:19:36 +0200
From:   Christoph Hellwig <hch@....de>
To:     Qian Cai <cai@....pw>
Cc:     airlied@...ux.ie, daniel@...ll.ch, thellstrom@...are.com,
        hch@....de, m.szyprowski@...sung.com, robin.murphy@....com,
        linux-graphics-maintainer@...are.com,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/vmwgfx: fix a warning due to missing dma_parms

On Thu, May 23, 2019 at 10:37:19PM -0400, Qian Cai wrote:
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index bf6c3500d363..5c567b81174f 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -747,6 +747,13 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
>  	if (unlikely(ret != 0))
>  		goto out_err0;
>  
> +	dev->dev->dma_parms =  kzalloc(sizeof(*dev->dev->dma_parms),
> +				       GFP_KERNEL);
> +	if (!dev->dev->dma_parms)
> +		goto out_err0;

What bus does this device come from?  I though vmgfx was a (virtualized)
PCI device, in which case this should be provided by the PCI core.
Or are we calling DMA mapping routines on arbitrary other struct device,
in which case that is the real bug and we should switch the PCI device
instead.

> +	dma_set_max_seg_size(dev->dev, *dev->dev->dma_mask);

That looks odd.  If you want to support an unlimited segment size
just pass UINT_MAX here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ