Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2629698pxj; Mon, 31 May 2021 06:58:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQaViKDABcF2aahAwEBHIDZgpLNuSb7PpENYMLQ4dwVStxRPKA0JSSjzkVRBiXeWQ6a9To X-Received: by 2002:a02:ab84:: with SMTP id t4mr7976321jan.76.1622469526499; Mon, 31 May 2021 06:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469526; cv=none; d=google.com; s=arc-20160816; b=Moz5TQyl32feXXasdrkPqGXDYFCasYVR1kzIzVA3mBOFmhZ0K8d16vtfVw2myxkFp6 DyGnDEQVFXmF3p0ciZ06x1oxS7cdi7GDsxhg23olsuVT1ENnnWd9J4VwfHn26CSHk3oj KGLxhcSkeNo8sfOYieq5eduC1o8auzTJpD/9Sn+f9hZ5E5IPaHWGTBnLClRPp2d06Tfi IODqa+YQDwiboMxSfgvEY6xGl3vNXRDtAGW5DOKc07KVO1DVxbuDUM7FWONwpQRH7/uP ksYOCSA+Ptq4hTweQfOWXNy9ugUka2WHS10Eg8UBHaDIfN3B/ZcIvGcIQ5cU5mRJGkUM Om6w== 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=lmduqpDwenBRuRK4j5v26wJQFUaREv4yjiqVCS1J0x4=; b=Iz4Rlz7S+bL/r+9vnfl/gNgiQYp/aHgWcERLPLFTsWmmV7RIjEf7WPxH0M4FI7Kqha TYjFk9m15SGH8iwORYia5JCYK08sAj+CN4nkVnAvagwJJtyIP3bFm8XRdUSoj5eRez5o IDoxObbTXcM3NslNCWaGV7dl9XEly0FyIB6cerr+QJLfQg6zATDLFygMG2hVrnp8aEhM cU3zfFmVttNXZzfn2qqbyLky5HueXs77JMUs4TKGeFyw/1eBrd16u2mxKaWVSPoGRgEs TeNdxhu/Q5lE/Szj4GUQQkpzACtm6w0CH7QBAi6RyTeC8nzMSDLCqzgbJWDGqAqOlRAS 5VGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XgGX12Q+; 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 m14si13942550ili.85.2021.05.31.06.58.33; Mon, 31 May 2021 06:58:46 -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=XgGX12Q+; 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 S233176AbhEaN7d (ORCPT + 99 others); Mon, 31 May 2021 09:59:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:44428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbhEaNhv (ORCPT ); Mon, 31 May 2021 09:37:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6DF8613A9; Mon, 31 May 2021 13:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467579; bh=5HOjsppuBknF2ufQBSKGPEmlGLKYtaNf1PzQLew9t8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XgGX12Q+NoNrBAZoEsdz8whqSMsXXhenJAqlWHtXj8jOysOirWQGkr/3VcRNwbEHK hK3lM9CLJmmJqTou0pS+GO6aPUdVX0oVyWvO0uMVC7SCB8xMJw+8T1Bm0W5zsDYppI 7IxQtgANb+yGO3kLT1GA3+LkmC5DyjNPmYNjdWuU= 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.19 109/116] ipv6: record frag_max_size in atomic fragments in input path Date: Mon, 31 May 2021 15:14:45 +0200 Message-Id: <20210531130643.811745722@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@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 c6132e39ab16..60dfd0d11851 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