Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp58905ybn; Thu, 3 Oct 2019 01:21:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYeCvYaHZcQG9Lp3BPJy/YYNepivA6Pkf/V7Oy/07m1dx8NuH0vNQb5fQgYB0gMtyPMtdO X-Received: by 2002:a05:6402:17eb:: with SMTP id t11mr7927147edy.97.1570090912274; Thu, 03 Oct 2019 01:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570090912; cv=none; d=google.com; s=arc-20160816; b=bAk8qvP2l2JNmEYTeTc/R3gK5QMXa1PMStT87zXWGss+0zZORwkN1QRGPaPmrhCz8Z 6pf6ri6nfeG6EQn9gHj0IQrVktZ7A8w1DjZaYTR6/WdxpqUOLB+Ko1CPaAA2elAQPpAx gOD1wJTBI14B7tOrLJayAfxGuE6R87fPUNy5liq5fg3rAcPq2i5c5Ajf9XqEmjjYAh06 HZ3d3irwDi4AyWATYCag5l6QdegLpTT99c9WEgi1j7h1GmkPRCoglK9GgtdFRrusBlpi kEY8jpQdxtZ9g3JEZ6sgmklVYFnr1UaXO7LFEovous5IXZbkpbmCAaHbYf6TL5X6T70k esWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SO9RyZFuX/9fjdFEsOj3uKVWRfV/WVjoWyK+Xiy6Dd0=; b=hirWJW46YEVV3ep5F081OW+Ffc/+pLLB3COLCoVj9XaypcqzhFe7inXD8+3R9OBwNV UgYgsznQnO5pDl8aA3HDwXhsn9FDj7e5+R0ZscnD+wL2fC+LFIknIVmaJGvG5941olUj SIEb01cYLYDtSRmbLYNAKyFUMDZlmYB28Gbcr7t3GlJQekQNmLD3QAhR0Dt79XAT//h3 GL6wjr3jhhcX6RcufaOmYPLpmGsZs74xHSAi3F3qSCMIDRSw2l4LRltHEXHQxEmhvDJV NyzkuVgArTwQFv+E8deALZxDeePzl/vR+mKsLiFZ/82xDcExQNEk/XbroQmvN67f537Q rv2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SsYTOmWD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q46si1040488eda.44.2019.10.03.01.21.25; Thu, 03 Oct 2019 01:21:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SsYTOmWD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727832AbfJCIUw (ORCPT + 99 others); Thu, 3 Oct 2019 04:20:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:58472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727095AbfJCIUv (ORCPT ); Thu, 3 Oct 2019 04:20:51 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91F5420815; Thu, 3 Oct 2019 08:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570090851; bh=zma8b4WVQpeJfiL2fy1SEiHV9CPEtfvm4I+YEdFQC8E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SsYTOmWDqV9ID1YtFhdNTo4rKkAHUlaSIYfzrJVjAX3mkR2RUeJLqk1fheLLP+tfm LYQo2WAiz4OMYMR7aRvcDsPfOXbGuqrY1820xVzMbaIYNQ32Rjk/MyhfRI+VAze2z6 +fFsYyDXKyGnxi2yz41CRQYeG0MDkXKE0RaMtgrM= Date: Thu, 3 Oct 2019 11:20:48 +0300 From: Leon Romanovsky To: Navid Emamdoost Cc: Jason Gunthorpe , Navid Emamdoost , Stephen McCamant , Kangjie Lu , Potnuri Bharat Teja , Doug Ledford , linux-rdma@vger.kernel.org, LKML Subject: Re: [PATCH v2] RDMA: release allocated skb Message-ID: <20191003082048.GK5855@unreal> References: <20190923050823.GL14368@unreal> <20190923155300.20407-1-navid.emamdoost@gmail.com> <20191001135430.GA27086@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 04:35:06PM -0500, Navid Emamdoost wrote: > Hi Jason, > > Thanks for the feedback. Yes, you are right if the skb release is > moved under err4 label it will cause a double free as > c4iw_ref_send_wait will release skb in case of error. > So, in order to avoid leaking skb in case of c4iw_bar2_addrs failure, > the kfree(skb) could be placed under the error check like the way > patch v1 did. Do you see any mistake in version 1? > https://lore.kernel.org/patchwork/patch/1128510/ No, it is not enough. c4iw_ref_send_wait() -> c4iw_wait_for_reply() -> return wr_waitp->ret; <--- can be -EIO Thanks