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]
Date:   Tue, 22 Feb 2022 11:09:10 +0800
From:   Heyi Guo <guoheyi@...ux.alibaba.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Joel Stanley <joel@....id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Dylan Hung <dylan_hung@...eedtech.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [Issue report] drivers/ftgmac100: DHCP occasionally fails during
 boot up or link down/up

Thanks for your advice. Let me take a try again :)

Heyi

在 2022/2/22 上午6:09, Andrew Lunn 写道:
>> [   16.872475]  Possible unsafe locking scenario:
>> [   16.872475]
>> [   16.872478]        CPU0                    CPU1
>> [   16.872482]        ----                    ----
>> [   16.872485]   lock(&dev->lock);
>> [   16.872495]                                lock(rtnl_mutex);
>> [   16.872505] lock(&dev->lock);
> It looks like the whitespace got messed up here, and it should
> actually be:
>> [   16.872505]                                lock(&dev->lock);
>> [   16.872513]   lock(rtnl_mutex);
> So if up calls open() which first takes rtnl and then the
> phydev->lock.
>
> adjust link is called with phydev->lock already held and it then takes
> the rtnl. Deadlock.
>
> During the adjust_list callback, the phydev lock is held so the
> contents of phydev are consistent. What you could do is make a copy of
> what you need and then release phydev lock. You can then take rtnl and
> do the reset. Once the reset is finished, program MAC with the copy
> you took from phydev. Then lock phydev again, and return.
>
>      Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ