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] [day] [month] [year] [list]
Message-ID: <20200416221110.GA8899@bogus>
Date:   Thu, 16 Apr 2020 17:11:10 -0500
From:   Rob Herring <robh@...nel.org>
To:     frowand.list@...il.com
Cc:     pantelis.antoniou@...sulko.com, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Michael Ellerman <mpe@...erman.id.au>,
        "Erhard F." <erhard_f@...lbox.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Alan Tull <atull@...nel.org>
Subject: Re: [PATCH 5/5] of: unittest: kmemleak in duplicate property update

On Thu, 16 Apr 2020 16:42:50 -0500, frowand.list@...il.com wrote:
> From: Frank Rowand <frank.rowand@...y.com>
> 
> kmemleak reports several memory leaks from devicetree unittest.
> This is the fix for problem 5 of 5.
> 
> When overlay 'overlay_bad_add_dup_prop' is applied, the apply code
> properly detects that a memory leak will occur if the overlay is removed
> since the duplicate property is located in a base devicetree node and
> reports via printk():
> 
>   OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@.../motor-1/rpm_avail
>   OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@.../motor-1/rpm_avail
> 
> The overlay is removed when the apply code detects multiple changesets
> modifying the same property.  This is reported via printk():
> 
>   OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@.../motor-1/rpm_avail
> 
> As a result of this error, the overlay is removed resulting in the
> expected memory leak.
> 
> Add another device node level to the overlay so that the duplicate
> property is located in a node added by the overlay, thus no memory
> leak will occur when the overlay is removed.
> 
> Thus users of kmemleak will not have to debug this leak in the future.
> 
> Fixes: 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
> Reported-by: Erhard F. <erhard_f@...lbox.org>
> Signed-off-by: Frank Rowand <frank.rowand@...y.com>
> ---
>  .../of/unittest-data/overlay_bad_add_dup_prop.dts  | 23 ++++++++++++++++++----
>  drivers/of/unittest.c                              | 12 +++++------
>  2 files changed, 25 insertions(+), 10 deletions(-)
> 

Applied, thanks.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ