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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 1 Jul 2015 08:53:39 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Grant Likely <grant.likely@...aro.org>
Cc:	Geert Uytterhoeven <geert+renesas@...der.be>,
	Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
	Rob Herring <robh+dt@...nel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH/RFC 3/3] of/dynamic: Update list of aliases on aliases changes

Hi Grant,

On Tue, Jun 30, 2015 at 7:21 PM, Grant Likely <grant.likely@...aro.org> wrote:
> On Tue, 30 Jun 2015 16:51:16 +0200
> , Geert Uytterhoeven <geert+renesas@...der.be>
>  wrote:
>> Currently the list of aliases is not updated when an overlay that
>> modifies /aliases is added or removed. This breaks drivers (e.g. serial)
>> that rely on of_alias_get_id().
>>
>> Update the list of aliases when a property of the /aliases node is
>> added, removed, or updated.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

>>   - Is it safe to deallocate struct alias_prop using kfree()? It may
>>     have been allocated using early_init_dt_alloc_memory_arch() /
>>     memblock_alloc(). What's the alternative? Leaking memory?
>
> Properties are not refcounted, so yes we leak memory. The memory remains
> owned by the aliases node, but because the aliases node is never freed,
> neither are any of the properties. Solving this isn't easy because it
> would require adding refcounting *everywhere* that properties are
> accessed. I think we have to just live with it until someone clever can
> some up with a solution.

Please note that struct alias_prop is not a property, but a list_head.
Hence it's not added to the deadprops of a node, and it isn't owned by
anyone after removal from the aliases_lookup list.
I can create a new dead_aliases list for that, if that's what needed...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ