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: <CAOVJa8HUx-8Ok8yMm91UmXpo39KAipt6C1BsfOL1c0Q_kqs1Vg@mail.gmail.com>
Date:   Tue, 5 Mar 2019 11:36:01 +0800
From:   pierre kuo <vichy.kuo@...il.com>
To:     Rob Herring <robh+dt@...nel.org>
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        Frank Rowand <frowand.list@...il.com>,
        devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] of: reserved_mem: fix reserve memory leak

> You should Cc the author(s) of this code. I've added Marek.
Thanks ^^
The cc lists I got were from get_maintainer.pl, no matter running with
of_reserved_mem.c or patch file.

(with file)
$ perl scripts/get_maintainer.pl --separator ,   --norolestats
drivers/of/of_reserved_mem.c
Rob Herring <robh+dt@...nel.org>,Frank Rowand
<frowand.list@...il.com>,devicetree@...r.kernel.org,linux-kernel@...r.kernel.org

(with patch)
$ perl scripts/get_maintainer.pl --separator , --norolestats
0001-of-reserved_mem-fix-reserve-memory-leak.patch
Rob Herring <robh+dt@...nel.org>,Frank Rowand
<frowand.list@...il.com>,devicetree@...r.kernel.org,linux-kernel@...r.kernel.org

> > The __reserved_mem_init_node will call region specific reserved memory
> > init codes, but once all compatibled init codes failed, the memory region
> > will left in memory.reserved and cause leakage.
> >
> > Take cma reserve memory DTS for example, if user declare 1MB size,
> > which is not align to (PAGE_SIZE << max(MAX_ORDER - 1,
> > pageblock_order)), rmem_cma_setup will return -EINVAL.
> > Meanwhile, rmem_dma_setup will also return -EINVAL since "reusable"
> > property is not set. If finally there is no reserved memory init pick up
> > this memory, kernel will left the 1MB leak in memory.reserved.
> >
> > This patch will remove this kind of memory from memory.reserved, only
> > when __reserved_mem_init_node return neither 0 nor -ENOENT.
>
> I'm not sure that un-reserving memory on error is the correct
> behavior. It may be fine for something like CMA, but if it is some
> shared memory used by another processor in the system not reserving it
> would probably never be correct.

In this patch, we un-reserving memory ONLY if explicit compatible matching fail.
That mean driver found something wrong while matching and let OS know.
(But reserved-memory without compatible property will not be affected.)

So per ur explaination, there would be cases that driver reported
matching memory fail,
but the memory is still needed by another processor?

Appreciate ur kind help,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ