Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3667257ima; Mon, 4 Feb 2019 03:07:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IZTjNy/96/CLSRpW4ZUN4MGCBlnd2Qdu28V2WEYexxmpTQRTAckTDF1CitENhIYVfVJHjEA X-Received: by 2002:a63:f74f:: with SMTP id f15mr12568511pgk.190.1549278436753; Mon, 04 Feb 2019 03:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549278436; cv=none; d=google.com; s=arc-20160816; b=Hlqcpd0hloUG+Jlt3mNRWoe8aG9JpboPoqfo2GX0SY0mZN2i2ORltP3GHnPWMBCbY/ 8JfDe8wneetnosIyx/DPm4vyTAQrXohYEKqJKKNpaL+PL0u9d2zj9rbrB9uSKFJ9ghkP CW3N78cXfATWGAxGdoVMTjE4FLrjHKZ5HTeglPJoAx3cR8RBvip59zNFv0LLYt7D9AAh ECTKWc79grBRUZJWzDhb52YQSR70YXszORLTnXME5pj4uyVLWZIR84Yro+2a50BalOqj J6iWkk84VufVRnTCipJIjEwKOMqMJy60FRTIhL+I2It7MKDFT+bRcFpkhpru5My0Vw5n QJ9w== 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=cvDwzImj4DLQFooko6ukV7RmpjKo7hTIs80I0WPXR2k=; b=gcqGq0XDCqq0H9u+NeZc19ysHiQFRXoVhf72iUFGJIvyL877mXnRvz6/wcxd1g76zO n7I64pRIRLiHgaKPjkcCIOKC2rkBRawSXkv/AmdjpBYwzjX7e+9IchvrdmXW1YaBzT2n oRBKl7ygxp80LGwFoqGv1J+Ke9oiK+YuwCTv6yog4sZECLYzuQX5Y+JYW234Jm7ASORA ipAn7bshHfc7FpR9YN365+miOUmb4YHn4k87ZjxlKo9t0kSHUrZ9rFKIpg82vrddvYRG Lz9fra6m2qZQjmGh3bs82G/WwarCZqzfHC0olipfY+DZyB7K3T7d8sUCFNjs0myxLAJ6 ktMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qI6gFobH; 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 j8si3437723pgq.69.2019.02.04.03.07.00; Mon, 04 Feb 2019 03:07:16 -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=qI6gFobH; 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 S1731123AbfBDKpC (ORCPT + 99 others); Mon, 4 Feb 2019 05:45:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:42892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731108AbfBDKo5 (ORCPT ); Mon, 4 Feb 2019 05:44:57 -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 75BE02070C; Mon, 4 Feb 2019 10:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549277097; bh=BLgfl51UgVX1+uZ+thH+9JH+t65tniMvvD6ikgnrOO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qI6gFobHDHCnktR5853AFhHZ9X+fupw8BYM4h5IAEclOl08JsKrokc1pgqpHbfSay mxNzTOVMwkJm5+0TGmfSxdJPrijsCOV2AH5/4OekF6N8uAct71k26+uAjaQhDjNsrO RJPI/Eto6vecmthZ8REd2ZyJ/iJYvLBY5ILLohfQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yohei Kanemaru , "David S. Miller" Subject: [PATCH 4.14 03/46] ipv6: sr: clear IP6CB(skb) on SRH ip4ip6 encapsulation Date: Mon, 4 Feb 2019 11:36:34 +0100 Message-Id: <20190204103609.236734023@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204103608.651205056@linuxfoundation.org> References: <20190204103608.651205056@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yohei Kanemaru [ Upstream commit ef489749aae508e6f17886775c075f12ff919fb1 ] skb->cb may contain data from previous layers (in an observed case IPv4 with L3 Master Device). In the observed scenario, the data in IPCB(skb)->frags was misinterpreted as IP6CB(skb)->frag_max_size, eventually caused an unexpected IPv6 fragmentation in ip6_fragment() through ip6_finish_output(). This patch clears IP6CB(skb), which potentially contains garbage data, on the SRH ip4ip6 encapsulation. Fixes: 32d99d0b6702 ("ipv6: sr: add support for ip4ip6 encapsulation") Signed-off-by: Yohei Kanemaru Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/seg6_iptunnel.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -126,6 +126,8 @@ int seg6_do_srh_encap(struct sk_buff *sk } else { ip6_flow_hdr(hdr, 0, 0); hdr->hop_limit = ip6_dst_hoplimit(skb_dst(skb)); + + memset(IP6CB(skb), 0, sizeof(*IP6CB(skb))); } hdr->nexthdr = NEXTHDR_ROUTING;