Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp874807ybe; Fri, 13 Sep 2019 07:38:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx02fcN5tdoljbcxOlMH7sdzqVb+0aOHKsCJPfDNcQjOia8ToJLpB33QUVRtFxueBvpgwge X-Received: by 2002:a50:d552:: with SMTP id f18mr48822718edj.36.1568385521224; Fri, 13 Sep 2019 07:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568385521; cv=none; d=google.com; s=arc-20160816; b=zH0zL9OCWQn3U+hTYBzYCiVm1QPEIpLm0n8/yLu0XnfJSHjo80sTFGA7NzTjR7P/FW ETlyZKm+Dq3F/mO+hYVFBxwsF2mhqcqnndzlYqzFeqfIGOmA/76ClRePTV8Kadq9+9PF Is7ijt4WT0xd+2+roDvhfWNJgVs09gJjfVAp6T+0H3vhS8kt++wE/R4ix3ndqbDsm13G DZnHb6VebD8f1Apy0G+LkquJ1DjBVe3UOIrTLkaa1CfPvsKiDIzz1Tuz05N+Paeu131t xQXrD6bikb2K0Tgf0zCUU9pliFTh0NC4tBDpCVbLnGx9DKpylLisUiMyU63awPu5FRXl tqSw== 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=cugnm1kRiVjhEghXqieIa4KdeJ67HTgP4zkMyBFhoro=; b=Lgt2Y5gJNGOT3z0+hyL4t2NtP3DUHmVrLasKt/1sd5Lu+qejcshMXgr3ETCiQLFeiy JOA8gqkPgfvZQ5qukxuJrCiuewKhUyJ9QDtaw+6FS6ZFDwObTa6GQXwuHRW6NdF+g1z/ Evfy/O3HURAcHq/L4DzzUc+7CPv7g6PATyWlkc1BpFLDPT15AS+RqYlLjLGMuNxcLbUi 2FsRqn7f+EfDpIqxy1IjkghgLYCFdrQPJMrW5ClzfwEXhWLxEFI9mjy1VnE390oKRNHU yrbTdYCY3zesb6BYCQw9D6FTqCaOAbZQNLL2awA7RzvW0ZKDNDA401NASvEgJJlsl5yS 03rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JyImmD+8; 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 mj22si14539836ejb.156.2019.09.13.07.38.17; Fri, 13 Sep 2019 07:38:41 -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=JyImmD+8; 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 S2388567AbfIMNJl (ORCPT + 99 others); Fri, 13 Sep 2019 09:09:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:34294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388533AbfIMNJj (ORCPT ); Fri, 13 Sep 2019 09:09:39 -0400 Received: from localhost (unknown [104.132.45.99]) (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 E75F1206A5; Fri, 13 Sep 2019 13:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380178; bh=ztAw2WI8XHTgR5UIIm3S9StiBL4Qf7ooKL7SmAatFEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JyImmD+83g/0Dpk0Jlz4l5Lox4AKnBqMDVGaNnQwhICjByvD6IDuLjDoqPuu8ExJu 9I4rzrewCwRD1HRRPX5DcOrSQLnFNb20TounpfKZtU33ZnxYWeE9l3u0rNS9pDPOiz +1dHLJbAPvOhewuuMhS0RVSC5SFxJ+Xv7bhm3Z8M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Stefan Bader , Peter Oskolkov , Florian Westphal , "David S. Miller" , Baolin Wang Subject: [PATCH 4.9 07/14] ip6: fix skb leak in ip6frag_expire_frag_queue() Date: Fri, 13 Sep 2019 14:07:00 +0100 Message-Id: <20190913130444.894079575@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130440.264749443@linuxfoundation.org> References: <20190913130440.264749443@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Eric Dumazet commit 47d3d7fdb10a21c223036b58bd70ffdc24a472c4 upstream. Since ip6frag_expire_frag_queue() now pulls the head skb from frag queue, we should no longer use skb_get(), since this leads to an skb leak. Stefan Bader initially reported a problem in 4.4.stable [1] caused by the skb_get(), so this patch should also fix this issue. 296583.091021] kernel BUG at /build/linux-6VmqmP/linux-4.4.0/net/core/skbuff.c:1207! [296583.091734] Call Trace: [296583.091749] [] __pskb_pull_tail+0x50/0x350 [296583.091764] [] _decode_session6+0x26a/0x400 [296583.091779] [] __xfrm_decode_session+0x39/0x50 [296583.091795] [] icmpv6_route_lookup+0xf0/0x1c0 [296583.091809] [] icmp6_send+0x5e1/0x940 [296583.091823] [] ? __netif_receive_skb+0x18/0x60 [296583.091838] [] ? netif_receive_skb_internal+0x32/0xa0 [296583.091858] [] ? ixgbe_clean_rx_irq+0x594/0xac0 [ixgbe] [296583.091876] [] ? nf_ct_net_exit+0x50/0x50 [nf_defrag_ipv6] [296583.091893] [] icmpv6_send+0x21/0x30 [296583.091906] [] ip6_expire_frag_queue+0xe0/0x120 [296583.091921] [] nf_ct_frag6_expire+0x1f/0x30 [nf_defrag_ipv6] [296583.091938] [] call_timer_fn+0x37/0x140 [296583.091951] [] ? nf_ct_net_exit+0x50/0x50 [nf_defrag_ipv6] [296583.091968] [] run_timer_softirq+0x234/0x330 [296583.091982] [] __do_softirq+0x109/0x2b0 Fixes: d4289fcc9b16 ("net: IP6 defrag: use rbtrees for IPv6 defrag") Signed-off-by: Eric Dumazet Reported-by: Stefan Bader Cc: Peter Oskolkov Cc: Florian Westphal Signed-off-by: David S. Miller Signed-off-by: Baolin Wang Signed-off-by: Greg Kroah-Hartman --- include/net/ipv6_frag.h | 1 - 1 file changed, 1 deletion(-) --- a/include/net/ipv6_frag.h +++ b/include/net/ipv6_frag.h @@ -94,7 +94,6 @@ ip6frag_expire_frag_queue(struct net *ne goto out; head->dev = dev; - skb_get(head); spin_unlock(&fq->q.lock); icmpv6_send(head, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0);