From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8175C4363D for ; Wed, 7 Oct 2020 14:58:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C40921548 for ; Wed, 7 Oct 2020 14:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602082690; bh=ttoWUFwHVHyUm2IiHU0uJpne+0dfPqCj8x3Qb36rnYc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=pkq1EpzuCnaNuawLx3uZWZYxGq6TZFGvkWuXVcJmXG9XWTNBs+Z2AGzzWZpReYANG I2w1R9LcHx6WTecEiY9oQCwDOTPe2pOEosM/PLjly4uXi274BAvBs58RcPOWrfHRmc A79cZYoZpicAUeAT+yoZCui12H7I0vFWT9Jl5ZR4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728736AbgJGO6J (ORCPT ); Wed, 7 Oct 2020 10:58:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:46934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728637AbgJGO6J (ORCPT ); Wed, 7 Oct 2020 10:58:09 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC175208C7; Wed, 7 Oct 2020 14:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602082689; bh=ttoWUFwHVHyUm2IiHU0uJpne+0dfPqCj8x3Qb36rnYc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QxOgLwChYgs+UzRJrJd7Ghs+bT5Qz42KDavabX8yIVHn3sPLEGtM/wcz6veIfqU8e 6QhNT63LNIJ9aU5IBR3n4qB4jlDP1qhG/wb69REDYEPfazGjLjEBSWIAQPFJPNqTGp G55+HFOV+0ke/rRNyXz3Mius+dg6qMCKmoxGG05U= Date: Wed, 7 Oct 2020 07:58:07 -0700 From: Jakub Kicinski To: Hangbin Liu Cc: netdev@vger.kernel.org, "David S . Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Willem de Bruijn Subject: Re: [PATCH net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Message-ID: <20201007075807.4eb064c4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201007035502.3928521-3-liuhangbin@gmail.com> References: <20201007035502.3928521-1-liuhangbin@gmail.com> <20201007035502.3928521-3-liuhangbin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 7 Oct 2020 11:55:02 +0800 Hangbin Liu wrote: > Based on RFC 8200, Section 4.5 Fragment Header: > > - If the first fragment does not include all headers through an > Upper-Layer header, then that fragment should be discarded and > an ICMP Parameter Problem, Code 3, message should be sent to > the source of the fragment, with the Pointer field set to zero. > > As the packet may be any kind of L4 protocol, I only checked if there > has Upper-Layer header by pskb_may_pull(skb, offset + 1). > > As the 1st truncated fragment may also be ICMP message, I also add > a check in ICMP code is_ineligible() to let fragment packet with nexthdr > ICMP but no ICMP header return false. > > Signed-off-by: Hangbin Liu net/ipv6/icmp.c:159:65: warning: incorrect type in argument 4 (different base types) net/ipv6/icmp.c:159:65: expected unsigned short *fragoff net/ipv6/icmp.c:159:65: got restricted __be16 *