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: <0cecfda4-e2c3-9282-12b1-fbe300708c72@arm.com>
Date:   Mon, 21 Jan 2019 15:53:25 +0000
From:   Robin Murphy <robin.murphy@....com>
To:     Rob Herring <robh+dt@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Mike Rapoport <rppt@...ux.ibm.com>
Cc:     Marc Gonzalez <marc.w.gonzalez@...e.fr>,
        Frank Rowand <frowand.list@...il.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Arnd Bergmann <arnd@...db.de>,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Oscar Salvador <osalvador@...e.de>,
        Wei Yang <richard.weiyang@...il.com>,
        Michal Hocko <mhocko@...e.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Sri Krishna chowdary <schowdary@...dia.com>,
        Qian Cai <cai@....pw>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: kmemleak panic

On 21/01/2019 15:42, Rob Herring wrote:
> +Mike Rapoport
> 
> On Mon, Jan 21, 2019 at 8:37 AM Catalin Marinas <catalin.marinas@....com> wrote:
>>
>> On Mon, Jan 21, 2019 at 07:35:11AM -0600, Rob Herring wrote:
>>> On Mon, Jan 21, 2019 at 6:19 AM Robin Murphy <robin.murphy@....com> wrote:
>>>>
>>>> On 21/01/2019 11:57, Marc Gonzalez wrote:
>>>> [...]
>>>>> # echo dump=0xffffffc021e00000 > /sys/kernel/debug/kmemleak
>>>>> kmemleak: Object 0xffffffc021e00000 (size 2097152):
>>>>> kmemleak:   comm "swapper/0", pid 0, jiffies 4294892296
>>>>> kmemleak:   min_count = 0
>>>>> kmemleak:   count = 0
>>>>> kmemleak:   flags = 0x1
>>>>> kmemleak:   checksum = 0
>>>>> kmemleak:   backtrace:
>>>>>        kmemleak_alloc_phys+0x48/0x60
>>>>>        memblock_alloc_range_nid+0x8c/0xa4
>>>>>        memblock_alloc_base_nid+0x4c/0x60
>>>>>        __memblock_alloc_base+0x3c/0x4c
>>>>>        early_init_dt_alloc_reserved_memory_arch+0x54/0xa4
>>>>>        fdt_init_reserved_mem+0x308/0x3ec
>>>>>        early_init_fdt_scan_reserved_mem+0x88/0xb0
>>>>>        arm64_memblock_init+0x1dc/0x254
>>>>>        setup_arch+0x1c8/0x4ec
>>>>>        start_kernel+0x84/0x44c
>>>>>        0xffffffffffffffff
>>>>
>>>> OK, so via the __va(phys) call in kmemleak_alloc_phys(), you end up with
>>>> the linear map address of a no-map reservation, which unsurprisingly
>>>> turns out not to be mapped. Is there a way to tell kmemleak that it
>>>> can't scan within a particular object?
>>>
>>> There was this patch posted[1]. I never got a reply, so it hasn't been applied.
>>>
>>> https://patchwork.ozlabs.org/patch/995367/
>>
>> Thanks Rob, I wasn't aware of this patch (or I just missed it at the
>> time).
>>
>> I wonder whether kmemleak should simply remove ranges passed to
>> memblock_remove(), or at least mark them as no-scan.
> 
> Seems reasonable to me, but of course that impacts a lot of other
> cases. Maybe Mike R has some thoughts?

In particular, might that risk crippling kmemleak on EFI arm64 EFI, 
where we memblock_remove() the entire physical address space (but then 
rebuild the memblock list from scratch)?

FWIW, from the reserved-memory angle I think that patch looks reasonable 
as-is (modulo perhaps a kmemleak_no_scan_phys() wrapper for API 
symmetry). MEMBLOCK_NOMAP is already a massive pain in the bum and I'd 
really rather not introduce any more usage of it if at all possible.

Robin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ