Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3511273imu; Mon, 7 Jan 2019 04:51:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN4WVx8egNP+5TCLuPwH+STO6jK6pYM2BCLhV3x8iP2NipVkYCOjtWF0AcXROeg3RAmpPzWH X-Received: by 2002:a62:7a8b:: with SMTP id v133mr64206550pfc.159.1546865492308; Mon, 07 Jan 2019 04:51:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546865492; cv=none; d=google.com; s=arc-20160816; b=xYH67zOB4j1/ceQmqsJc+Agom6IuJMdBtls3OaVj2ugCOogRuC8QD1a2hbbmS9rLrY 1oqfvp/iCtbQ9FyvuS/xAqnXeo/6RjNTuvma16tgOI++ailNWb9oUl1XZBaNWamAjixj hj5lB237SgZv7VMH07z9WlRnkZFJvDrL/cDOiVFg4rr27xmMwZA4qZPgjNonqH3HMKLl YXx2IwwR6T1ZdgYcVGOkbxFPxm2uxckpOGTwwEYJ9bZNcpmaD6yNnJF8dZTxFrmmuGz8 15NZ3FXNAe7grJkiMNpN+bBQaXX3k5VvyeBWEAT5nO/L8TfrIuMAMkI6vnr5bsH9JB0D qtGw== 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=M4qySDieVdSkoXRu7hA4txSla/JOFpYN92qd1yN7xFY=; b=yxF0EQH4LdVcL1DAWbhCuYEq4596Z8/ZWPYWuXosHnzmfPHq3p59kZujtbtUFwuE8c 9entrK8MI/zv9bEQOicTn3TsFIx/LPkYgSzKrNkImj1GEWDgDi/+6qAd6P2DwjOPFNKg wYqkmzuETSK5EFXJdWNe7RvXUfuGzscyG9tIXswdFiFMfvTZT31QoD9fdlg/WsGt4Mo2 mftwLq4HCBJ72aW2jTV9FJX/dkru773eNbP0gRiEsn0lO3DQInPVGvuQ1VmTXNm/cO+H KCxj9pe8yVnfq+8gxHmJIACVY5mqRYdlK8O0kQ/02RSst4lNMKjLe8UkpvuRtVo09JMe WwRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rBm3a3zy; 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 128si41660062pfe.4.2019.01.07.04.51.17; Mon, 07 Jan 2019 04:51:32 -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=rBm3a3zy; 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 S1729112AbfAGMsK (ORCPT + 99 others); Mon, 7 Jan 2019 07:48:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:38616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728875AbfAGMsH (ORCPT ); Mon, 7 Jan 2019 07:48:07 -0500 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 52B49206BB; Mon, 7 Jan 2019 12:48:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546865286; bh=hIGqcqvl3KqmUkYcSlqCqX8fiakG8eR57bOjyEZ9jtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rBm3a3zy8Po6eWZNqai+zFezbCsOZZ5p0xEM74/a/8Ah7p54fNf1g36jiJ3ec4POW shsyHBcPxmHMq49eq3c7LltAw4yHjDAvV8Ez1Q/XiIjCrHAZLbGEG+1qkQPiGnz3AR 3drulQV0rnQnaz9XxIMV/lWLzeKCpPx0o41bxNnI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiumei Mu , Herbert Xu , "David S. Miller" Subject: [PATCH 4.19 044/170] ipv6: frags: Fix bogus skb->sk in reassembled packets Date: Mon, 7 Jan 2019 13:31:11 +0100 Message-Id: <20190107104458.439410173@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104452.953560660@linuxfoundation.org> References: <20190107104452.953560660@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Herbert Xu [ Upstream commit d15f5ac8deea936d3adf629421a66a88b42b8a2f ] It was reported that IPsec would crash when it encounters an IPv6 reassembled packet because skb->sk is non-zero and not a valid pointer. This is because skb->sk is now a union with ip_defrag_offset. This patch fixes this by resetting skb->sk when exiting from the reassembly code. Reported-by: Xiumei Mu Fixes: 219badfaade9 ("ipv6: frags: get rid of ip6frag_skb_cb/...") Signed-off-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/reassembly.c | 1 + 1 file changed, 1 insertion(+) --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -384,6 +384,7 @@ static int ip6_frag_reasm(struct frag_qu if (skb_try_coalesce(head, fp, &headstolen, &delta)) { kfree_skb_partial(fp, headstolen); } else { + fp->sk = NULL; if (!skb_shinfo(head)->frag_list) skb_shinfo(head)->frag_list = fp; head->data_len += fp->len;