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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200416094955.GM1163@kadam>
Date:   Thu, 16 Apr 2020 12:49:56 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Ørjan Eide <orjan.eide@....com>
Cc:     devel@...verdev.osuosl.org, nd@....com,
        Todd Kjos <tkjos@...roid.com>,
        Lecopzer Chen <lecopzer.chen@...iatek.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linaro-mm-sig@...ts.linaro.org,
        Arve Hjønnevåg <arve@...roid.com>,
        john.stultz@...aro.org, anders.pedersen@....com,
        Daniel Vetter <daniel.vetter@...ll.ch>,
        Joel Fernandes <joel@...lfernandes.org>,
        "Darren Hart (VMware)" <dvhart@...radead.org>,
        Laura Abbott <labbott@...hat.com>,
        Martijn Coenen <maco@...roid.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        Christian Brauner <christian@...uner.io>,
        linux-media@...r.kernel.org
Subject: Re: [PATCH] staging: android: ion: Skip sync if not mapped

On Tue, Apr 14, 2020 at 04:18:47PM +0200, Ørjan Eide wrote:
> @@ -238,6 +242,10 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment,
>  			      struct sg_table *table,
>  			      enum dma_data_direction direction)
>  {
> +	struct ion_dma_buf_attachment *a = attachment->priv;
> +
> +	a->mapped = false;

Possibly a stupid question but here we're not holding a lock.  Is
concurrency an issue?

> +
>  	dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction);
>  }
>  
> @@ -297,6 +305,8 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
>  
>  	mutex_lock(&buffer->lock);
>  	list_for_each_entry(a, &buffer->attachments, list) {
> +		if (!a->mapped)
> +			continue;
>  		dma_sync_sg_for_cpu(a->dev, a->table->sgl, a->table->nents,
>  				    direction);
>  	}

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ