Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2641473pxj; Mon, 31 May 2021 07:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7rG7A05TdWPscI2RRn96gOVCoNm2AGQy7hvYmP5wC9OlXu9X18g+h7f5lVUlt9XJpBTzO X-Received: by 2002:a05:6e02:ea6:: with SMTP id u6mr5928514ilj.92.1622470342137; Mon, 31 May 2021 07:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622470342; cv=none; d=google.com; s=arc-20160816; b=QnjV2p0lRQSctvfah0GK6MiUi/d8va6vbP9KT7DKMMV4RMPJS5qZ+rFeGrTOAx8ocw EUc0UzV2D8H2QC2MpWN8GNGffcAEXzWoNwz/W5NIcFs93PJzqs0z4dHJmuxAKVxqaD8T ISw+xEoa1QFNM3fSoCQXu9TfmN1rJNSb0raUAyOjkcUhd2k0OmHCsZ6GoCtJyn9b2tCX 2XYwnziwwbqS2mBHjMhcIh4rZCykxDvissm/N5xYw3rESUWPh5GekdEQWTJIZd9QIjwA NfK55LfBY6aeR8PiAMEsm6cw0yDUQl/tkns4RzVxoMVlTLgfCynjTR6WmYeOEozkYCHN LGjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D2pmYjVPo3Zams58jgxvJLEHha4dFjdkzhbCuoEWFdI=; b=PfeuANMNFBPUbfBlI/KNrG/oOgl+dNEysmswXgSsf7Arc7GSivus7ttddnkqyuE0p9 pH16ae/srL4uTs21oGpsNIumvbjXiwoYcGmyO91vKc2v8JpY32XUhptvFsepxrRvQJBv dN+/FzKX95Id0jSuTXFpH9fFL5fBp5qXAKD/1PpioeKUOdva1atZYMQIHUtsBtr7Bj+H YW565+zAZMCyDCh6MW+VikpzbAnyPbpz7brbH14nJVTeSlKUyGmg2NfzGGj4gSQbwlg1 jH5htKH6UG5Sg0GydFDcteu5kQary9Zlw1CpYyPFSeG7a2fTBMcs2dVozRwdIrx/myhL t2+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LvAca1ui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h10si16430595ili.90.2021.05.31.07.12.06; Mon, 31 May 2021 07:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LvAca1ui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233156AbhEaOLf (ORCPT + 99 others); Mon, 31 May 2021 10:11:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:49452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231580AbhEaNo6 (ORCPT ); Mon, 31 May 2021 09:44:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E90066141C; Mon, 31 May 2021 13:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467771; bh=chRS472GWhhR5JQis0YvThFSqaRbPhgR2khsjQae0nI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LvAca1uiB9lzMnP0Inotcmlt1EDphV9TcY5YZY72FtrO1AmBWqgMWPbkm7r8jYxnY PJFkHKachhUZNAHvDZ5K9971uxWRivXhX9h+vXJANvpIHMSjYaGUzSI1QRYc0MkRoX BYzGSwumc+CYOAjiQTcgt+blVjZh/Sbz0Rh5PmN4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Francesco Ruggeri , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 73/79] ipv6: record frag_max_size in atomic fragments in input path Date: Mon, 31 May 2021 15:14:58 +0200 Message-Id: <20210531130638.331799659@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130636.002722319@linuxfoundation.org> References: <20210531130636.002722319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Francesco Ruggeri [ Upstream commit e29f011e8fc04b2cdc742a2b9bbfa1b62518381a ] Commit dbd1759e6a9c ("ipv6: on reassembly, record frag_max_size") filled the frag_max_size field in IP6CB in the input path. The field should also be filled in case of atomic fragments. Fixes: dbd1759e6a9c ('ipv6: on reassembly, record frag_max_size') Signed-off-by: Francesco Ruggeri Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/reassembly.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 6dea6e92e686..b2f7a335a12b 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -347,7 +347,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) hdr = ipv6_hdr(skb); fhdr = (struct frag_hdr *)skb_transport_header(skb); - if (!(fhdr->frag_off & htons(0xFFF9))) { + if (!(fhdr->frag_off & htons(IP6_OFFSET | IP6_MF))) { /* It is not a fragmented frame */ skb->transport_header += sizeof(struct frag_hdr); __IP6_INC_STATS(net, @@ -355,6 +355,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb) IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); IP6CB(skb)->flags |= IP6SKB_FRAGMENTED; + IP6CB(skb)->frag_max_size = ntohs(hdr->payload_len) + + sizeof(struct ipv6hdr); return 1; } -- 2.30.2