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]
Date:   Tue, 1 Oct 2019 10:54:30 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Navid Emamdoost <navid.emamdoost@...il.com>
Cc:     leon@...nel.org, emamd001@....edu, smccaman@....edu, kjlu@....edu,
        Potnuri Bharat Teja <bharat@...lsio.com>,
        Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] RDMA: release allocated skb

On Mon, Sep 23, 2019 at 10:52:59AM -0500, Navid Emamdoost wrote:
> In create_cq, the allocated skb buffer needs to be released on error
> path.
> Moved the kfree_skb(skb) under err4 label.

This didn't move anything
 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
>  drivers/infiniband/hw/cxgb4/cq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
> index b1bb61c65f4f..1886c1af10bc 100644
> +++ b/drivers/infiniband/hw/cxgb4/cq.c
> @@ -173,6 +173,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
>  err4:
>  	dma_free_coherent(&rdev->lldi.pdev->dev, cq->memsize, cq->queue,
>  			  dma_unmap_addr(cq, mapping));
> +	kfree_skb(skb);
>  err3:
>  	kfree(cq->sw_queue);
>  err2:

This looks wrong to me:

int c4iw_ofld_send(struct c4iw_rdev *rdev, struct sk_buff *skb)
{
	int	error = 0;

	if (c4iw_fatal_error(rdev)) {
		kfree_skb(skb);
		pr_err("%s - device in error state - dropping\n", __func__);
		return -EIO;
	}
	error = cxgb4_ofld_send(rdev->lldi.ports[0], skb);
	if (error < 0)
		kfree_skb(skb);
	return error < 0 ? error : 0;
}

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ