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: <CACRpkdYBwi9biXA7efSLonQM36RALeUqj3p+Rv0EFEfVDC=N5w@mail.gmail.com>
Date:   Mon, 18 Jul 2022 14:53:15 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     linux-arm-kernel@...ts.infradead.org,
        Russell King <linux@...linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Grygorii Strashko <grygorii.strashko@...com>,
        open list <linux-kernel@...r.kernel.org>, ssantosh@...nel.org,
        ardb@...nel.org, geert+renesas@...der.be
Subject: Re: [PATCH v3] ARM: Fix MAX_DMA_ADDRESS overflow

On Thu, Jul 14, 2022 at 1:28 AM Florian Fainelli <f.fainelli@...il.com> wrote:
> On 7/6/22 13:33, Florian Fainelli wrote:
> > Commit 26f09e9b3a06 ("mm/memblock: add memblock memory allocation apis")
> > added a check to determine whether arm_dma_zone_size is exceeding the
> > amount of kernel virtual address space available between the upper 4GB
> > virtual address limit and PAGE_OFFSET in order to provide a suitable
> > definition of MAX_DMA_ADDRESS that should fit within the 32-bit virtual
> > address space. The quantity used for comparison was off by a missing
> > trailing 0, leading to MAX_DMA_ADDRESS to be overflowing a 32-bit
> > quantity.
> >
> > This was caught thanks to CONFIG_DEBUG_VIRTUAL on the bcm2711 platform
> > where we define a dma_zone_size of 1GB and we have a PAGE_OFFSET value
> > of 0xc000_0000 (CONFIG_VMSPLIT_3G) leading to MAX_DMA_ADDRESS being
> > 0x1_0000_0000 which overflows the unsigned long type used throughout
> > __pa() and then __virt_addr_valid(). Because the virtual address passed
> > to __virt_addr_valid() would now be 0, the function would loudly warn
> > and flood the kernel log, thus making the platform unable to boot
> > properly.
> >
> > Fixes: 26f09e9b3a06 ("mm/memblock: add memblock memory allocation apis")
> > Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
>
> Shall I send this to RMK's patch system?

I think so!
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ