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]
Message-ID: <20180104085205.GC3251@lst.de>
Date:   Thu, 4 Jan 2018 09:52:05 +0100
From:   Christoph Hellwig <hch@....de>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Christoph Hellwig <hch@....de>, iommu@...ts.linux-foundation.org,
        Linux MIPS Mailing List <linux-mips@...ux-mips.org>,
        linux-ia64@...r.kernel.org,
        Linux-sh list <linux-sh@...r.kernel.org>,
        sparclinux <sparclinux@...r.kernel.org>,
        Guan Xuetao <gxt@...c.pku.edu.cn>,
        Linux-Arch <linux-arch@...r.kernel.org>,
        linux-s390 <linux-s390@...r.kernel.org>,
        linux-c6x-dev@...ux-c6x.org,
        "open list:QUALCOMM HEXAGON..." <linux-hexagon@...r.kernel.org>,
        the arch/x86 maintainers <x86@...nel.org>,
        arcml <linux-snps-arc@...ts.infradead.org>,
        adi-buildroot-devel@...ts.sourceforge.net,
        linux-m68k <linux-m68k@...ts.linux-m68k.org>,
        patches@...ups.riscv.org,
        "open list:METAG ARCHITECTURE" <linux-metag@...r.kernel.org>,
        linux-arm-kernel@...ts.infradead.org,
        Michal Simek <monstr@...str.eu>,
        Parisc List <linux-parisc@...r.kernel.org>,
        Cris <linux-cris-kernel@...s.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        alpha <linux-alpha@...r.kernel.org>,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 27/67] dma-direct: add dma address sanity checks

On Fri, Dec 29, 2017 at 03:12:25PM +0100, Geert Uytterhoeven wrote:
> > +check_addr(struct device *dev, dma_addr_t dma_addr, size_t size,
> > +               const char *caller)
> > +{
> > +       if (unlikely(dev && !dma_capable(dev, dma_addr, size))) {
> > +               if (*dev->dma_mask >= DMA_BIT_MASK(32)) {
> > +                       dev_err(dev,
> > +                               "%s: overflow %llx+%zu of device mask %llx\n",
> 
> Please use "%pad" to format dma_addr_t ...
> 
> > +                               caller, (long long)dma_addr, size,
> 
> ... and use &dma_addr.
> 
> > +                               (long long)*dev->dma_mask);
> 
> This cast is not needed, as u64 is unsigned long long in kernelspace on
> all architectures.

Thanks, fixed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ