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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <542C50A4.30304@oracle.com>
Date:	Wed, 01 Oct 2014 15:06:12 -0400
From:	David L Stevens <david.stevens@...cle.com>
To:	Sowmini Varadhan <sowmini.varadhan@...cle.com>,
	davem@...emloft.net, raghuram.kothakota@...cle.com
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] sunvnet: vnet_start_xmit() must hold a refcnt
 on port.



On 10/01/2014 02:56 PM, Sowmini Varadhan wrote:

> -	list_for_each_entry(port, &vp->port_list, list) {
> -		if (!port->switch_port)
> -			continue;
> -		if (!port_is_up(port))
> -			continue;
> +	port = vp->switch_port;
> +	if (port != NULL && port_is_up(port)) {
> +		vnet_hold(port);
>  		return port;
>  	}
>  	return NULL;

This "vp->switch_port" addition doesn't appear to be related to the port refcnt
change, and doesn't allow for multiple switch ports.

						+-DLS


> @@ -1581,10 +1621,12 @@ static int vnet_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
>  	port->switch_port = switch_port;
>  
>  	spin_lock_irqsave(&vp->lock, flags);
> -	if (switch_port)
> +	if (switch_port) {
> +		vp->switch_port = port;
>  		list_add(&port->list, &vp->port_list);

...and here.

> -	else
> +	} else {
>  		list_add_tail(&port->list, &vp->port_list);
> +	}
>  	hlist_add_head(&port->hash, &vp->port_hash[vnet_hashfn(port->raddr)]);
>  	spin_unlock_irqrestore(&vp->lock, flags);
>  
> @@ -1631,11 +1673,14 @@ static int vnet_port_remove(struct vio_dev *vdev)
>  		 */
>  		spin_lock_irqsave(&vp->lock, flags);
>  		port->flags |= VNET_PORT_DEAD;
> +		if (port->switch_port)
> +			vp->switch_port = NULL;
>  		list_del(&port->list);
>  		hlist_del(&port->hash);

..and here.

--
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