Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2685286pxj; Mon, 31 May 2021 08:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwG0bnkXMQVyyI0uxtpqT+ny1CraUIEHQ8feojRIhcjg08XzxOXHM8UmwVN3UsHP1ja9ko X-Received: by 2002:a05:6602:2c83:: with SMTP id i3mr4612484iow.152.1622474001341; Mon, 31 May 2021 08:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474001; cv=none; d=google.com; s=arc-20160816; b=tpNs981f+lzPBcB11ak2NWhBRv954M2YrrkPZUjA+PG+b9i6aM8eaefueohV1TgNwh b9W2iQDsGvYZylqoJ6BaajYGpy1Gd7kcicrEyjKfJQpIx3NX/+uqoKfleFKq7A//O90m VMCkpiBprfqK/IYXN9YAQ+orV69sGV2LyKs2cwMMadTx1ONdAh/3SjWosCuFqGR8tODP JxuepqLQc1K8hVYFP68DlJ8Eahz6hX6SiV5IxEH6zv9av1SwllC/XFw5tOzozfaYpno+ r70wSX5oE/YY1KNhghbUfxTxcSZVNXBPWCzr3miTZ0BAfcENVPitC1NxvT6d+pZjgMVV 2gcw== 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=f9kGuaTEUXI2m12xfbCQj7bwPw9dtKSx59TxSIQB6wUCqriruRCeJZsGH/40nNUpVu ZuDzEc6dZetiBdeW3sbLb1hXJuKz85cxvnXuCcxs+qMmTu7z6k0urZInKqokSjBIs9yF 9i5qnCqQiLClmUh4+8zCpQCWijvE7Zgsn5qdz63xjLHRFhpQgQNyXw4LM6xJm37ZmlON 1dMpRL7gx5z4BrMwUFikcX7A0w6rT6srjAsaUHb4Xq2cwa01BznxXNcdoy0+MdwH2E4v YpAW1F6kUGnhZHgfvHoY6osO8+r/Dg3C4t+XZM5xnlr900l1k+MfopDmJHEqTc2wUI6L 8/GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S0x+eGVr; 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 f18si12419525ilr.76.2021.05.31.08.13.08; Mon, 31 May 2021 08:13:21 -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=S0x+eGVr; 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 S232837AbhEaPOA (ORCPT + 99 others); Mon, 31 May 2021 11:14:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:40254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233354AbhEaOLh (ORCPT ); Mon, 31 May 2021 10:11:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B8FC61988; Mon, 31 May 2021 13:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468479; bh=UNlO1fM6zCSxN2GOwmtuEV0qOlY3BkYmF6gkGidp3oE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S0x+eGVraK+yyrNqfIyOY2nn7sAigZCl2n7mUsOYtOake30dIOApk5hvdWYshQ7Kf khWUC7s3tC5FQXi9gUds3siiG4YdZIUdNrdf8INmpLD2A2rzfRa/yr080TVgLdi8/5 mHqtqLg0cM2dJxYcFlMeW9eQn8jpr4Or6QYOkCpQ= 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.10 234/252] ipv6: record frag_max_size in atomic fragments in input path Date: Mon, 31 May 2021 15:14:59 +0200 Message-Id: <20210531130705.953755666@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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