Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp625080img; Thu, 28 Feb 2019 05:22:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IaX4geaXzOXhTb6VFbp0//NWQAwShMgkHth32syab6zoqz2MZ0gHzUnHFZeNlT9Ap4jc3T8 X-Received: by 2002:a63:8942:: with SMTP id v63mr8205159pgd.406.1551360129567; Thu, 28 Feb 2019 05:22:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551360129; cv=none; d=google.com; s=arc-20160816; b=0uuSUMmQhm4Jc0jG/icRg7gyAcSDEC+mHs6Ql5G29w594SrX/Tu3MglA5VGAEmAKMG RiRnP1A3nAyiEM846e2d42fHix3Upc0X1Ccbe7NGBWA6BZJbIE66OA7IteuekSAEyZrS CKYj1UcnOegTxTnj0rMaMw8inDxWDuBXB2FqwjcDvBz4byLmGEON9jgRocxlkFEwMerZ ps1xDr+BgCwKSVSEw8mtWHBB8gBG+/rqUAdR7z/faUykCt9QNTyBGYMsUPcFiNlKuqNu RizB+o51bKDRGa075SIUVcjkzABaoZ50ch0gTg1xnXSCIZEcfL2eWNxf4urHePUXxmNw oQ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MF/lJfkqZaIUrwmBUZ9wS1h4svFl+gII1taJ51cx8QY=; b=Ux9cCikXUNPgCD9TAYD5elgxVC3PEFQRbsxNMeIJjy0gyursl4Vj6TPyGihHsaiuF0 E4F5U3WsIKD4ypC/3zo7OqCnQ0VfRtAjceh5wEh3snECJsOV7aYsq/ex1dciys2pS/xl VaxCBYh9vF5FzQH1d0m9AieRIS/HXD7spvG7q/ZTYvDxzCRsYgRquY73tE54MOXJnlp3 GseWlmXf1pi+DcIgePo8ZN7BaVRagiZZoZPkulZ1Lp7lc7HPDmrCT/nyKe0KxsGPgzGg 9LD14a+rY7tmIsNHWxfgogbQvaE9nPiuLv5JkwGEy45jiWlk41Qa1nbLRW7DU9XI15Cq db4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si13214399pgr.112.2019.02.28.05.21.54; Thu, 28 Feb 2019 05:22:09 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732611AbfB1Lnt (ORCPT + 99 others); Thu, 28 Feb 2019 06:43:49 -0500 Received: from smtp03.citrix.com ([162.221.156.55]:21287 "EHLO SMTP03.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731013AbfB1Lns (ORCPT ); Thu, 28 Feb 2019 06:43:48 -0500 X-IronPort-AV: E=Sophos;i="5.58,423,1544486400"; d="scan'208";a="79311923" Subject: Re: [PATCH] xen-netback: fix occasional leak of grant ref mappings under memory pressure To: Paul Durrant , Wei Liu CC: "xen-devel@lists.xenproject.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" References: <1551319382-32595-1-git-send-email-igor.druzhinin@citrix.com> <8424fba34a1f43908a6dae3a9308863b@AMSPEX02CL02.citrite.net> <20190228110136.somjads2f5ivqhju@zion.uk.xensource.com> From: Igor Druzhinin Message-ID: <447cd231-3ea4-e56d-29b0-6528804c9e9a@citrix.com> Date: Thu, 28 Feb 2019 11:43:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/02/2019 11:21, Paul Durrant wrote: >>> @@ -1153,6 +1152,10 @@ static int xenvif_tx_submit(struct xenvif_queue *queue) >>> kfree_skb(skb); >>> continue; >>> } >>> + >>> + /* Copied all the bits from the frag list. */ >>> + skb_frag_list_init(skb); >>> + kfree(nskb); >> >> I think you want kfree_skb here? > > No. nskb is the frag list... it is unlinked from skb by the call to skb_frag_list_init() and then it can be freed on its own. The skb is what we need to retain, because that now contains all the data. > Are you saying previous code in xenvif_handle_frag_list() incorrectly called kfree_skb()? Igor