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:   Sat, 28 Apr 2018 13:41:18 -0700
From:   Matthew Wilcox <willy@...radead.org>
To:     Julia Lawall <julia.lawall@...6.fr>
Cc:     "Luis R. Rodriguez" <mcgrof@...nel.org>,
        Christoph Hellwig <hch@...radead.org>,
        Dan Carpenter <dan.carpenter@...cle.com>, linux-mm@...ck.org,
        mhocko@...nel.org, cl@...ux.com, Jan Kara <jack@...e.cz>,
        matthew@....cx, x86@...nel.org, luto@...capital.net,
        martin.petersen@...cle.com, jthumshirn@...e.de, broonie@...nel.org,
        Juergen Gross <jgross@...e.com>, linux-spi@...r.kernel.org,
        Joerg Roedel <joro@...tes.org>, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        "lsf-pc@...ts.linux-foundation.org" 
        <lsf-pc@...ts.linux-foundation.org>
Subject: Re: [LSF/MM TOPIC NOTES] x86 ZONE_DMA love

On Sat, Apr 28, 2018 at 09:46:52PM +0200, Julia Lawall wrote:
> FWIW, here is my semantic patch and the output - it reports on things that
> appear to be too small and things that it doesn't know about.
> 
> What are the relevant pci wrappers?  I didn't find them.

Basically all of the functions in include/linux/pci-dma-compat.h

> too small: drivers/gpu/drm/i915/i915_drv.c:1138: 30
> too small: drivers/net/wireless/broadcom/b43/dma.c:1068: 30
> unknown: sound/pci/ctxfi/cthw20k2.c:2033: DMA_BIT_MASK(dma_bits)
> unknown: sound/pci/ctxfi/cthw20k2.c:2034: DMA_BIT_MASK(dma_bits)

This one's good:

        const unsigned int dma_bits = BITS_PER_LONG;

> unknown: drivers/scsi/megaraid/megaraid_sas_base.c:6036: consistent_mask

and this one:
        consistent_mask = (instance->adapter_type == VENTURA_SERIES) ?
                                DMA_BIT_MASK(64) : DMA_BIT_MASK(32);

> unknown: drivers/net/wireless/ath/wil6210/txrx.c:200: DMA_BIT_MASK(wil->dma_addr_size)

        if (wil->dma_addr_size > 32)
                dma_set_mask_and_coherent(dev,
                                          DMA_BIT_MASK(wil->dma_addr_size));

> unknown: drivers/net/ethernet/netronome/nfp/nfp_main.c:452: DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS)

drivers/net/ethernet/netronome/nfp/nfp_net.h:#define NFP_NET_MAX_DMA_BITS       40

> unknown: drivers/gpu/host1x/dev.c:199: host->info->dma_mask

Looks safe ...

drivers/gpu/host1x/bus.c:       device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask;
drivers/gpu/host1x/bus.c:       device->dev.dma_mask = &device->dev.coherent_dma_mask;
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(32),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(32),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(34),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(34),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(34),
drivers/gpu/host1x/dev.c:       dma_set_mask_and_coherent(host->dev, host->info->dma_mask);
drivers/gpu/host1x/dev.h:       u64 dma_mask; /* mask of addressable memory */

... but that reminds us that maybe some drivers aren't using dma_set_mask()
but rather touching dma_mask directly.

... 57 more to look at ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ