Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2715405pxj; Mon, 31 May 2021 08:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlBilRivZD7qqEZNafVAmDDJC19PGnS45hsHdggcFakCkm1VJvOHj2pdzgF0wmrXeRK8uN X-Received: by 2002:a05:6402:40d0:: with SMTP id z16mr26795110edb.104.1622476653388; Mon, 31 May 2021 08:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622476653; cv=none; d=google.com; s=arc-20160816; b=Qh5bFCJX6RQjl+Ix3KIf3ZiP2sejX5BZh0d9Il77gHbQW+LNgD/Zfgr9n8ER69jlpG msAMAhvnV4t77BkRc7CKXS75cvRj+cS5U9dVokZWXv2N5p4HlL3wG+ausRGWcUw8xa/n Hg0EeIhNlkhvVgDZTD9vCISVcvo7geDhZgvDJCjA8H9pzhipkPXfcpUCguD9hzKmV/c2 Bj1W+kiOfmLQ8Nx/xqNP2tS/C5Vn1UfuqjdZ7p6SwgdQ317haDlaXynYERjdaeCwlk7z sVrURzm6tQpfeg3ArbYU8Hv5UQ+vEh0eRfUmqnDpkSvbDN6flGTo5ngijogu/SD3Rh5F MPaw== 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=7jxoAn0CvayaVQTUnTHUk/Q3vru+1DpTmr0oOTLkSTM=; b=edTtgTOAud+ZH0pahxfrZRJtiVzwzvjqJJUsMC4sVBzkgkrTqt2cagbJJEfTcf7kWQ tWsjhZSKcy72me0Oel1dAGqpx24vkaHMGDZt7Zw5cZNEbWGshPw7jkzzGibH3WZahNYj iSKdXDpAqXEuMCJXgdCBo6UGU4dxbdFFOprAFHbDCn7D1Up1wkbLU7DX1Rbr1JcdhOWL luVten+hiqZKeTXPLxmgaJaYlaLKsKu3fOjpGmFtd2Ji4lQP9hmgXCgHgW5ZHJRwojje /GOkGFgORzvH9D5NhhP5jkpkCTy9U1+4FuTmU3hmvchgR9h1lISArRIzSUkt/imcLs0X r3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Pp/G6PFY"; 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 v13si12652110edt.90.2021.05.31.08.57.11; Mon, 31 May 2021 08:57:33 -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="Pp/G6PFY"; 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 S231903AbhEaPzf (ORCPT + 99 others); Mon, 31 May 2021 11:55:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234094AbhEaOaG (ORCPT ); Mon, 31 May 2021 10:30:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB4E361C2A; Mon, 31 May 2021 13:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468925; bh=jUSSOftiFGWwySWvoECQjy5aAWLT7qMSEDz43KYH+Eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pp/G6PFY0xnakQ/N6jiu2ov+K2Gzx2I6CVXE4xTpaCSMKrkh0/T37tSEXL2lInxwZ tAH72XaTIuxyYzpUvYPmffWQD9zDwcJXJH35b85PkUaWCQH2dwuLphA0KjKlf9XUiw uO2q9qXbUS0+/oRcdF+OTrD7CKPrYwnGrG0AW5Q4= 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 5.4 164/177] ipv6: record frag_max_size in atomic fragments in input path Date: Mon, 31 May 2021 15:15:21 +0200 Message-Id: <20210531130653.593442531@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 c8cf1bbad74a..45ee1971d998 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -344,7 +344,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, @@ -352,6 +352,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