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:   Fri, 25 Oct 2019 11:02:36 +0200
From:   Stanislaw Gruszka <sgruszka@...hat.com>
To:     Lorenzo Bianconi <lorenzo@...nel.org>
Cc:     kvalo@...eaurora.org, linux-wireless@...r.kernel.org, nbd@....name,
        lorenzo.bianconi@...hat.com, oleksandr@...alenko.name,
        netdev@...r.kernel.org
Subject: Re: [PATCH wireless-drivers 2/2] mt76: dma: fix buffer unmap with
 non-linear skbs

On Thu, Oct 24, 2019 at 11:01:48AM +0200, Lorenzo Bianconi wrote:
> > On Thu, Oct 24, 2019 at 12:23:16AM +0200, Lorenzo Bianconi wrote:
> > > mt76 dma layer is supposed to unmap skb data buffers while keep txwi
> > > mapped on hw dma ring. At the moment mt76 wrongly unmap txwi or does
> > > not unmap data fragments in even positions for non-linear skbs. This
> > > issue may result in hw hangs with A-MSDU if the system relies on IOMMU
> > > or SWIOTLB. Fix this behaviour properly unmapping data fragments on
> > > non-linear skbs.
> > 
> > If we have to keep txwi mapped, before unmap fragments, when then
> > txwi is unmaped ?
> 
> txwi are mapped when they are crated in mt76_alloc_txwi(). Whenever we need to
> modify them we sync the DMA in mt76_dma_tx_queue_skb(). txwi are unmapped in
> mt76_tx_free() at driver unload.

So not only txwi is wrongly unmapped on runtime, but we can call
dma_sync_single_for_cpu/device() after dma_unmap_single().
That serious bug, good you spotted it and fixed!

Stanislaw

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ