Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2481435imd; Fri, 2 Nov 2018 12:09:33 -0700 (PDT) X-Google-Smtp-Source: AJdET5cyEbFb+NHOA58tjgrbtEq+ECS6VhDG9kcY3qUXscE5NPZKnRlP+CgBr3c2W2hBOrcKcaYP X-Received: by 2002:a17:902:2924:: with SMTP id g33-v6mr13003688plb.76.1541185773316; Fri, 02 Nov 2018 12:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541185773; cv=none; d=google.com; s=arc-20160816; b=Bz46vwWzs/9O015NhJK+DVTYe1lpeHykfqxEJQtCS0yX0QIcl2r9r7AeZx7eRnc5L9 9Zn1/Slu5QW2377GIeW6arObnjnGQVsZzbVaZAwKFjh0Au62wQbcozCsP3FRD3Dkbopm +e6+b8FN9qpMOvQty55nVnqL/SJERxeE4x06GkeGadEQtj4Z+HaZtY3QKzGEZ/KP2dlh GdpvzTzIlz1M9S5w2R+F+TizEV+w1QyQuUsmKQY/NvYkbH91xrg/BhD7eDzlaDrwMzKH dt8JilBdlZKJJqb3Ek6C3v+Ut9gjgeZVM+YqYnVcdGfJTjRzTCxo/cV/h28Oy+PLjLqd udUg== 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=n3yFk2J3fVzngkkWnQSmg+1hWqZZ7H3rnvXA0dj4dVQ=; b=XN1cuyYrSfcGEs2KCYRMU9dsliM/J1dvieztyPqLADYciAtXxShizIpQOnybqViAHY 0VjY566N/xSCZs8FPUnM3iR3OeN6cQV4IYQZlq1xhgh/BHx27hU/Khh+t9S2+ziHcPdl bl7jM2JdWjOHOaotmU9H4GqPOUmYx8Ph+C5Q9ICXYL3Lc/WG061yODoYSukGk23HccYR q9cnILT0DjAngssd1rh6FdyNuZFRmto3l+NHExLvvOZIsmk4D5YMRkK0uT/nQNFp9Fpk U0iGlBU5IFB3mtLpZlJq+P9KwoOGbAIXcS4kxms1XCR4WSSIHXG84TJi9dezIXsq6za8 jPNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WQab4DPZ; 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 x2-v6si34275328plo.259.2018.11.02.12.09.18; Fri, 02 Nov 2018 12:09:33 -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=WQab4DPZ; 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 S1729021AbeKCDrQ (ORCPT + 99 others); Fri, 2 Nov 2018 23:47:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:41212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728545AbeKCDrO (ORCPT ); Fri, 2 Nov 2018 23:47:14 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 762032082E; Fri, 2 Nov 2018 18:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183943; bh=udaYxjfwaR/xRc6Faq+xls7M26bDL1X3OBSCNcPdEnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WQab4DPZyLYAJYvsABXbF7zWL7RbYIwj84zGRaAGX+T1QWmSibq9xghKxDwZ2mf13 ewxNj4bS/GDKdMkPmmb9bcSYYVfCMWgbn0bI7oHKr8C58+AoMDh4fejVqysIpvLLaN 7AqjbyB2ScM0GumgyXNn1zevsRaP6BKplfDBiedA= 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.18 002/150] xfrm6: call kfree_skb when skb is toobig Date: Fri, 2 Nov 2018 19:32:44 +0100 Message-Id: <20181102182902.472465401@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.18-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 5959ce9620eb..6a74080005cf 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -170,9 +170,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