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: <b692fbf3-8aaa-feea-f3c7-ea30484bd625@intel.com>
Date:   Sun, 31 Jan 2021 12:22:25 +0200
From:   "Neftin, Sasha" <sasha.neftin@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Tony Nguyen <anthony.l.nguyen@...el.com>, davem@...emloft.net,
        Kai-Heng Feng <kai.heng.feng@...onical.com>,
        netdev@...r.kernel.org, sassmann@...hat.com,
        "Lifshits, Vitaly" <vitaly.lifshits@...el.com>,
        "Keller, Jacob E" <jacob.e.keller@...el.com>,
        "Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
        "Neftin, Sasha" <sasha.neftin@...el.com>
Subject: Re: [PATCH net 1/4] igc: Report speed and duplex as unknown when
 device is runtime suspended

On 1/30/2021 20:12, Jakub Kicinski wrote:
> On Sat, 30 Jan 2021 16:00:06 +0200 Neftin, Sasha wrote:
>> On 1/30/2021 08:22, Jakub Kicinski wrote:
>>> On Thu, 28 Jan 2021 13:38:48 -0800 Tony Nguyen wrote:
>>>> From: Kai-Heng Feng <kai.heng.feng@...onical.com>
>>>>
>>>> Similar to commit 165ae7a8feb5 ("igb: Report speed and duplex as unknown
>>>> when device is runtime suspended"), if we try to read speed and duplex
>>>> sysfs while the device is runtime suspended, igc will complain and
>>>> stops working:
>>>    
>>>> The more generic approach will be wrap get_link_ksettings() with begin()
>>>> and complete() callbacks, and calls runtime resume and runtime suspend
>>>> routine respectively. However, igc is like igb, runtime resume routine
>>>> uses rtnl_lock() which upper ethtool layer also uses.
>>>>
>>>> So to prevent a deadlock on rtnl, take a different approach, use
>>>> pm_runtime_suspended() to avoid reading register while device is runtime
>>>> suspended.
>>>
>>> Is someone working on the full fix to how PM operates?
>>>
>>> There is another rd32(IGC_STATUS) in this file which I don't think
>>> is protected either.
>>
>> What is another rd32(IGC_STATUS) you meant? in  igc_ethtool_get_regs?
> 
> Yes.
> 
>> While the device in D3 state there is no configuration space registers
>> access.
> 
> That's to say similar stack trace will be generated to the one fixed
> here, if someone runs ethtool -d, correct? I don't see anything
> checking runtime there either.
> 
yes.
This problem crosses many drivers. (not only igb, igc,...)

specific to this one (igc), can we check 'netif_running at begin of the 
_get_regs method:
if (!netif_running(netdev))
	return;
what do you think? (only OS can put device to the D3)

> To be clear I'm not asking for this to be addressed in this series.
> Rather for a strong commitment that PM handling will be restructured.
> It seems to me you should depend on refcounting / locking that the PM
> subsystem does more rather than involving rtnl_lock.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ