Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp53348imu; Thu, 8 Nov 2018 14:39:07 -0800 (PST) X-Google-Smtp-Source: AJdET5e79wSDe3LgxYN1wGVdTV+UWvNlCurF+63t2d+YOrDozin6Y7bBVclsd7LqOWV7KU3/LeJ0 X-Received: by 2002:a17:902:d207:: with SMTP id t7-v6mr6413297ply.90.1541716747123; Thu, 08 Nov 2018 14:39:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716747; cv=none; d=google.com; s=arc-20160816; b=TS01k+d7bTFy3hlsxJG+ED3daarKoqqlXUXCP96Acnv/Ol8ifkYUu8HcOfmotik2vr 5vpcfHb7Ql61ZmbWn6Ezch3B7NdnFXRHnku+835ovvvPsdwzjb5SVoGvuz5DbzihVvET xVG2c6zyGtwysBqSiGEtpC0Mc7wEHLerHa0BG6lBsX7TRFPbYOHMJFfIHMh2cMNWop8U DF5UjVr3Usxo+5taRYucExFNY/500XhCx1/TMpKkiqmh4B+Kul8fmM/Q99uf6vi/C2yY u+vlhUtjJqphnCFo8LZyq+J2SG0NMF/BEM7NWmY3MORE4JAK9sEcNd9CgMP3Sxtp724n GKvQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8KKenRL4SqNUXoJSyt5ITeDgxDUV/ZBcy8KY0pdUu60=; b=fcJ5warFp3g8bKymRzl48dHqLJq4qf0iEvmGRDJP7qp3/Phip2gh2889jdFYXUCGSu UvNNqlYBsulcIsPuKhfVa2MMPCaO/uxJh2fo2SQvmdTW7xwjl+5tpYKEJdyWgYgTXv3c E/xTKEv+05exWk3QmvjFfTXzEQDrNkLSnhJ1Iv38rC0NHUoAtH31us5iq+Ef2T9oqr1X e3ipcPx2A/wNv8LRfWlqDtg17Y9wrp7p45N8V6B3dAn/G2VZ8hJR1I8ALIFkDAtCz01O y4J5/8XXZ74Kw/kWRoXx8RpGxlGYiDA9PETk7HtNtRsOfvOfJd7qr14dRpDmnXtaViN5 tnFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M4QoHkkI; 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 f192-v6si5909675pfc.73.2018.11.08.14.38.52; Thu, 08 Nov 2018 14:39:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=M4QoHkkI; 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 S1729751AbeKIHgI (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:53292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728541AbeKIHgH (ORCPT ); Fri, 9 Nov 2018 02:36:07 -0500 Received: from localhost (unknown [208.72.13.198]) (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 E2F0720892; Thu, 8 Nov 2018 21:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714319; bh=UeAyNQuWPi6XWzPTN+ubiJOHohLvVsLXRYI5Xf5Z8o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M4QoHkkITG7OhTn5f48xltF4cXDlt9QD1sHDEVwiISBKERQ1353HCisESOk6Pbku3 qCmIRNVGj6JDyYAvdGJNlfl6eQgkiVU9DBa3IhivoN0shqOMEtL9UN6gJX+9/fWg8m z/tKI2O1H+2ifApBYhG6TMFlE/2wLdSZjoBLCNso= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thadeu Lima de Souza Cascardo , Sabrina Dubroca , Steffen Klassert , Sasha Levin Subject: [PATCH 4.4 002/114] xfrm6: call kfree_skb when skb is toobig Date: Thu, 8 Nov 2018 13:50:17 -0800 Message-Id: <20181108215059.222969078@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 215ab0f021c9fea3c18b75e7d522400ee6a49990 ] After commit d6990976af7c5d8f55903bfb4289b6fb030bf754 ("vti6: fix PMTU caching and reporting on xmit"), some too big skbs might be potentially passed down to __xfrm6_output, causing it to fail to transmit but not free the skb, causing a leak of skb, and consequentially a leak of dst references. After running pmtu.sh, that shows as failure to unregister devices in a namespace: [ 311.397671] unregister_netdevice: waiting for veth_b to become free. Usage count = 1 The fix is to call kfree_skb in case of transmit failures. Fixes: dd767856a36e ("xfrm6: Don't call icmpv6_send on local error") Signed-off-by: Thadeu Lima de Souza Cascardo Reviewed-by: Sabrina Dubroca Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/ipv6/xfrm6_output.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 4d09ce6fa90e..64862c5084ee 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -165,9 +165,11 @@ static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb) if (toobig && xfrm6_local_dontfrag(skb)) { xfrm6_local_rxpmtu(skb, mtu); + kfree_skb(skb); return -EMSGSIZE; } else if (!skb->ignore_df && toobig && skb->sk) { xfrm_local_error(skb, mtu); + kfree_skb(skb); return -EMSGSIZE; } -- 2.17.1