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]
Date:   Tue, 26 Jun 2018 15:20:12 +0800
From:   Alex Williamson <alex.williamson@...hat.com>
To:     Gerd Hoffmann <kraxel@...hat.com>
Cc:     airlied@...ux.ie, dri-devel@...ts.freedesktop.org,
        linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
        christian.koenig@....com, daniel.vetter@...ll.ch,
        Kirti Wankhede <kwankhede@...dia.com>,
        kvm@...r.kernel.org (open list:VFIO MEDIATED DEVICE DRIVERS)
Subject: Re: [PATCH 2/2] sample/mdev/mbochs: add mbochs_kunmap_dmabuf

On Mon, 25 Jun 2018 08:44:52 +0200
Gerd Hoffmann <kraxel@...hat.com> wrote:

> There is no default implementation for dma_buf_ops->unmap.
> So add a function unmapping the page, otherwise we'll leak them.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
> ---
>  samples/vfio-mdev/mbochs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
> index aa25cda21d..85ac603769 100644
> --- a/samples/vfio-mdev/mbochs.c
> +++ b/samples/vfio-mdev/mbochs.c
> @@ -811,11 +811,18 @@ static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num)
>  	return kmap(page);
>  }
>  
> +static void mbochs_kunmap_dmabuf(struct dma_buf *buf, unsigned long page_num,
> +				 void *vaddr)
> +{
> +	kunmap(vaddr);
> +}
> +
>  static struct dma_buf_ops mbochs_dmabuf_ops = {
>  	.map_dma_buf	  = mbochs_map_dmabuf,
>  	.unmap_dma_buf	  = mbochs_unmap_dmabuf,
>  	.release	  = mbochs_release_dmabuf,
>  	.map		  = mbochs_kmap_dmabuf,
> +	.unmap		  = mbochs_kunmap_dmabuf,
>  	.mmap		  = mbochs_mmap_dmabuf,
>  };
>  

Is this a fix for v4.18?  AFAICT, the kmap_atomic removal is only in
next, not yet upstream and hopefully includes this sample driver before
hitting mainline.  Should we therefore have a v4.18-rc based patch for
this to include before v4.18 to resolve this?  Thanks,

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ