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: <20200826140922.0f1fb9fd@kicinski-fedora-PC1C0HJN>
Date:   Wed, 26 Aug 2020 14:09:22 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Shannon Nelson <snelson@...sando.io>
Cc:     netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net-next 09/12] ionic: change mtu without full queue
 rebuild

On Wed, 26 Aug 2020 09:42:11 -0700 Shannon Nelson wrote:
> +	mutex_lock(&lif->queue_lock);
> +	netif_device_detach(lif->netdev);
> +	ionic_stop_queues(lif);
> +	ionic_txrx_deinit(lif);
>  
> +	err = ionic_txrx_init(lif);
> +	if (err)
> +		goto err_out;
> +
> +	/* don't start the queues until we have link */
> +	if (netif_carrier_ok(netdev)) {
> +		err = ionic_start_queues(lif);
> +		if (err)
> +			goto err_out;
> +	}
> +
> +err_out:
> +	netif_device_attach(lif->netdev);
> +	mutex_unlock(&lif->queue_lock);

Looks a little racy, since the link state is changed before queue_lock
is taken:

                if (!netif_carrier_ok(netdev)) { u32 link_speed; 
                        ionic_port_identify(lif->ionic);                        
                        link_speed = le32_to_cpu(lif->info->status.link_speed); 
                        netdev_info(netdev, "Link up - %d Gbps\n",              
                                    link_speed / 1000);                         
                        netif_carrier_on(netdev);                               
                }                                                               
                                                                                
                if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) \
{                                                                               
                        mutex_lock(&lif->queue_lock);                           
                        ionic_start_queues(lif);                                
                        mutex_unlock(&lif->queue_lock);                         
                }    

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ