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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4jH1Z8UdA/h+WlE@lunn.ch>
Date:   Thu, 1 Dec 2022 16:27:17 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Zeng Heng <zengheng4@...wei.com>,
        Yang Yingliang <yangyingliang@...wei.com>
Cc:     f.fainelli@...il.com, pabeni@...hat.com, kuba@...nel.org,
        linux@...linux.org.uk, davem@...emloft.net, edumazet@...gle.com,
        hkallweit1@...il.com, netdev@...r.kernel.org, liwei391@...wei.com
Subject: Re: [PATCH] net: mdio: fix unbalanced fwnode reference count in
 mdio_device_release()

On Thu, Dec 01, 2022 at 05:22:02PM +0800, Zeng Heng wrote:
> There is warning report about of_node refcount leak
> while probing mdio device:
> 
> OF: ERROR: memory leak, expected refcount 1 instead of 2,
> of_node_get()/of_node_put() unbalanced - destroy cset entry:
> attach overlay node /spi/soc@...dio@...700c0/ethernet@4
> 
> In of_mdiobus_register_device(), we increase fwnode refcount
> by fwnode_handle_get() before associating the of_node with
> mdio device, but it has never been decreased after that.
> Since that, in mdio_device_release(), it needs to call
> fwnode_handle_put() in addition instead of calling kfree()
> directly.
> 
> After above, just calling mdio_device_free() in the error handle
> path of of_mdiobus_register_device() is enough to keep the
> refcount balanced.

How does this interact with:

https://lore.kernel.org/netdev/20221201033838.1938765-1-yangyingliang@huawei.com/T/

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ