Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2752147pxj; Mon, 31 May 2021 09:51:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDg+O7wg4FlLqEZaqKeiftbc7Q4i3y9n919EQDNCpwmg6OL3hHDeitd3SoxZ/baejIAsEQ X-Received: by 2002:aa7:c91a:: with SMTP id b26mr26831661edt.350.1622479866483; Mon, 31 May 2021 09:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479866; cv=none; d=google.com; s=arc-20160816; b=MtWloqyRijV6nOtMFFbsEQy6Ntz/IoeQSaTsxseAbhqNqnvDMq/TPpC/cjEpwXQsYR VjehgXHjFN1pmDa8FfVyGnBhaFA2LRA7GaUy2ueLRSIQRPr+4I+KBcuzlUyEeSvL3AYB /9nPdTrQmDJYZ+tl7VdkETv+iNW7rtskibHcmBFgMTVb5/WsUyf49Mb74MpoSXEowWrX NswepF+eY/ziuqJT7LcVrMxBCmVBZ4Qy/PbkNsGsIyg1lgG+2xBD83HitYar/ToaCDp8 SMjQIwetc72RNcF5N5oMwDH5lqpM9VjbhwFR+WaK9JPX5QyvNJPnefxbyITWXtHmV2HQ C08A== 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=TgPM7Gu7Vl5SZcqaFNyAC2cToQOf44TWKDCGvWDK15o=; b=BuVTwdeeD9hQhJBV+ZiEM2Ru1U/+YRyAmeGlUs1DSHmg10n4cMFJX95QAA8Wn/esjr VHO9tDu8op44CbZwe01e66NG1HvG4nl7PjeGEutMgpc8whipvlOddvHEtjsjVNfMWXe5 7YxThBqMEHsv2/F95N3ro2V+LbXtPisqJizPvvvfdyFqA/7QCawZE6XywgHTBiTdRM6k 3nUTj1j2Ed2U3cK/U/2ZVcNB20cvIRzbqObr36V3fKv/SHI4cob6vt0jsxWJjU0IQsse PxGyad9CWhSsbWlvCM+fbf58OmkgDBNEd5GZx0a24llHtntR/kGb733tNDSyTwfoDj05 aF2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EO4hbvvp; 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 kl25si12935480ejc.370.2021.05.31.09.50.43; Mon, 31 May 2021 09:51:06 -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=EO4hbvvp; 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 S230456AbhEaQvX (ORCPT + 99 others); Mon, 31 May 2021 12:51:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:51252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234186AbhEaO5f (ORCPT ); Mon, 31 May 2021 10:57:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28F2B61CC6; Mon, 31 May 2021 14:00:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469644; bh=UNlO1fM6zCSxN2GOwmtuEV0qOlY3BkYmF6gkGidp3oE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EO4hbvvpSggBPEh9zS3iVz03BqC8E4jSYayvGZ711tdRts67Ivu5YSEluLXpogi9t tyMIHeduFtE+TggxcwTtiTF8aHcI6FIF9w8ZsZm2ze9sWMapCtC0ug2hyPlWF5MyVe EzDjswpZVe1ho5qM1N3J1Pp37Af121vqk2XUb1DQ= 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.12 275/296] ipv6: record frag_max_size in atomic fragments in input path Date: Mon, 31 May 2021 15:15:30 +0200 Message-Id: <20210531130712.981493141@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 47a0dc46cbdb..28e44782c94d 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -343,7 +343,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, @@ -351,6 +351,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