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: <62131c40-e69b-0664-2b2a-177a031a6f1f@gmail.com>
Date:   Thu, 19 Dec 2019 10:40:39 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     David Miller <davem@...emloft.net>
Cc:     thomas.lendacky@....com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: amd: xgbe: fix possible sleep-in-atomic-context bugs
 in xgbe_powerdown()



On 2019/12/19 5:26, David Miller wrote:
> From: Jia-Ju Bai <baijiaju1990@...il.com>
> Date: Wed, 18 Dec 2019 22:01:02 +0800
>
>> @@ -1257,17 +1257,18 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
>>   	netif_tx_stop_all_queues(netdev);
>>   
>>   	xgbe_stop_timers(pdata);
>> -	flush_workqueue(pdata->dev_workqueue);
>>   
>>   	hw_if->powerdown_tx(pdata);
>>   	hw_if->powerdown_rx(pdata);
>>   
>> -	xgbe_napi_disable(pdata, 0);
>> -
>>   	pdata->power_down = 1;
>>   
>>   	spin_unlock_irqrestore(&pdata->lock, flags);
>>   
>> +	flush_workqueue(pdata->dev_workqueue);
>> +
>> +	xgbe_napi_disable(pdata, 0);
>> +
> Nope, this doesn't work at all.
>
> You can't leave NAPI enabled, and thus packet processing, after the TX
> and RX units of the chip have been powered down.

Looking at the code, only xgbe_powerup() and xgbe_powerdown() use the 
spinlock "pdata->lock".
How about change the spinlock to a mutex?


Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ