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]
Date:   Wed, 10 Jan 2018 11:59:30 +0000
From:   Robin Murphy <robin.murphy@....com>
To:     Christoph Hellwig <hch@....de>, iommu@...ts.linux-foundation.org
Cc:     linux-mips@...ux-mips.org, linux-ia64@...r.kernel.org,
        linux-sh@...r.kernel.org, sparclinux@...r.kernel.org,
        Guan Xuetao <gxt@...c.pku.edu.cn>, linux-arch@...r.kernel.org,
        linux-s390@...r.kernel.org, linux-c6x-dev@...ux-c6x.org,
        linux-hexagon@...r.kernel.org, x86@...nel.org,
        Konrad Rzeszutek Wilk <konrad@...nok.org>,
        linux-snps-arc@...ts.infradead.org,
        linux-m68k@...ts.linux-m68k.org, patches@...ups.riscv.org,
        linux-metag@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Michal Simek <monstr@...str.eu>, linux-parisc@...r.kernel.org,
        linux-cris-kernel@...s.com, linux-kernel@...r.kernel.org,
        linux-alpha@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 20/33] dma-mapping: clear harmful GFP_* flags in common
 code

On 10/01/18 08:00, Christoph Hellwig wrote:
[...]
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 9f28b2fa329e..88bcb1a8211d 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -518,6 +518,13 @@ static inline void *dma_alloc_attrs(struct device *dev, size_t size,
>   	if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr))
>   		return cpu_addr;
>   
> +	/*
> +	 * Let the implementation decide on the zone to allocate from, and
> +	 * decide on the way of zeroing the memory given that the memory
> +	 * returned should always be zeroed.
> +	 */

Just a note that if we're all happy to enshrine the "allocations are 
always zeroed" behaviour in the API (I am too, for the record), we 
should remember to follow up once the dust settles to update the docs 
and I guess just #define dma_zalloc_coherent dma_alloc_coherent.

Robin.

> +	flag &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM | __GFP_ZERO);
> +
>   	if (!arch_dma_alloc_attrs(&dev, &flag))
>   		return NULL;
>   	if (!ops->alloc)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ