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]
Date:	Sat, 19 Dec 2009 12:44:19 -0800
From:	Scott Feldman <scofeldm@...co.com>
To:	Ben Hutchings <bhutchings@...arflare.com>
CC:	<davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: Re: [net-next PATCH 1/6] enic: Bug fix: use safe queue shutdown in
 dev->stop

On 12/19/09 7:34 AM, "Ben Hutchings" <bhutchings@...arflare.com> wrote:

> On Fri, 2009-12-18 at 18:09 -0800, Scott Feldman wrote:
>> enic: Bug fix: use safe queue shutdown in dev->stop
>> 
>> Fix dev->stop shutdown bug where driver was stopping xmit queue and then
>> disabling intrs.  Fix is to disable intrs first and then stop the xmit
>> queue, otherwise an interrupt could cause the queue to be rewoken.  Also,
>> no need to explicitly do queue servicing because queues are cleaned and
>> reset back to initial state at end of dev->stop.  Servicing queues also
>> had the side-effect of also rewakening the xmit queue, which is not what
>> we want.
> [...]
>> @@ -1409,16 +1382,18 @@ static int enic_stop(struct net_device *netdev)
>> unsigned int i;
>> int err;
>>  
>> + for (i = 0; i < enic->intr_count; i++)
>> +  vnic_intr_mask(&enic->intr[i]);
>> +
> 
> I think you need to use synchronize_irq() after this.

I think you're right.  That's what I want: all intrs masked and no IRQs
running.  I also need to add a PIO read to flush the PIO write to mask.

I want intrs shut down from here on.
 
>> del_timer_sync(&enic->notify_timer);
>>  
>> spin_lock(&enic->devcmd_lock);
>> vnic_dev_disable(enic->vdev);
>> spin_unlock(&enic->devcmd_lock);
>> napi_disable(&enic->napi);
>> - netif_stop_queue(netdev);
>> -
>> - for (i = 0; i < enic->intr_count; i++)
>> -  vnic_intr_mask(&enic->intr[i]);
>> + netif_tx_disable(netdev);
>> + msleep(10);
> 
> This sleep is suspicious.

Ya, that can go.  Netif_tx_disable grabs netif_tx_lock, so we should be
synced with xmit_hard_start.  Forgot to delete that when we had
netif_stop_queue.
 
>> + netif_carrier_off(netdev);
> [...]
> 
> And this should be unnecessary.

We don't have any way to get true link status when the interface is down, so
this forces us to always report link status down when the interface is down.

-scott

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ