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] [day] [month] [year] [list]
Message-ID: <f7512427-6c0f-21a9-64d8-b5800c943655@arm.com>
Date:   Wed, 21 Sep 2016 11:27:41 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     Andrey Smirnov <andrew.smirnov@...il.com>,
        linux-kernel@...r.kernel.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Joerg Roedel <jroedel@...e.de>,
        Will Deacon <will.deacon@....com>,
        Zhen Lei <thunder.leizhen@...wei.com>,
        "Luis R. Rodriguez" <mcgrof@...e.com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Geliang Tang <geliangtang@....com>
Subject: Re: [PATCH] dma-mapping.h: Preserve unmap info for
 CONFIG_DMA_API_DEBUG

On 20/09/16 16:58, Andrey Smirnov wrote:
> When CONFIG_DMA_API_DEBUG is enabled we need to preserve unmapping
> address even if "unmap" is a no-op for our architecutre because we need
> debug_dma_unmap_page() to correctly cleanup all of the debug
> bookkeeping. Failing to do so results in a false positive warnings about
> previously mapped areas never being unmapped.

Makes sense, although I guess it might be even clearer to simply have
DMA_API_DEBUG select NEED_DMA_MAP_STATE. Either way, though,

Reviewed-by: Robin Murphy <robin.murphy@....com>

> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
> ---
>  include/linux/dma-mapping.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 71c1b21..41c9875 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -678,7 +678,7 @@ static inline int dma_mmap_wc(struct device *dev,
>  #define dma_mmap_writecombine dma_mmap_wc
>  #endif
>  
> -#ifdef CONFIG_NEED_DMA_MAP_STATE
> +#if defined(CONFIG_NEED_DMA_MAP_STATE) || defined(CONFIG_DMA_API_DEBUG)
>  #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
>  #define DEFINE_DMA_UNMAP_LEN(LEN_NAME)          __u32 LEN_NAME
>  #define dma_unmap_addr(PTR, ADDR_NAME)           ((PTR)->ADDR_NAME)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ