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: <20140310.133544.1092785181480653530.davem@davemloft.net>
Date:	Mon, 10 Mar 2014 13:35:44 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	hariprasad@...lsio.com
Cc:	netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
	roland@...estorage.com, dm@...lsio.com,
	swise@...ngridcomputing.com, leedom@...lsio.com,
	santosh@...lsio.com, kumaras@...lsio.com, nirranjan@...lsio.com
Subject: Re: [PATCHv5 net-next 08/31] iw_cxgb4: release neigh entry in
 error paths

From: Hariprasad Shenai <hariprasad@...lsio.com>
Date: Mon, 10 Mar 2014 22:38:05 +0530

> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index 360807e..74a2250 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -3350,10 +3350,9 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
>  	if (!e) {
>  		pr_err("%s - failed to allocate l2t entry!\n",
>  		       __func__);
> -		goto free_dst;
> +		goto free_neigh;
>  	}
>  
> -	neigh_release(neigh);
>  	step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan;
>  	rss_qid = dev->rdev.lldi.rxq_ids[pi->port_id * step];
>  	window = (__force u16) htons((__force u16)tcph->window);
> @@ -3373,6 +3372,8 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
>  			      tcph->source, ntohl(tcph->seq), filter, window,
>  			      rss_qid, pi->port_id);
>  	cxgb4_l2t_release(e);
> +free_neigh:
> +	neigh_release(neigh);
>  free_dst:

It is so much easier to just move the existing neigh_release() call right
before the if(!e) test, that way you don't need a completely new label and
code block to fix this bug.
--
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