From: Greg KH <gregkh@linuxfoundation.org>
To: Aviraj CJ <acj@cisco.com>
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru,
yoshfuji@linux-ipv6.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, xe-linux-external@cisco.com,
Hangbin Liu <liuhangbin@gmail.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH stable v5.4 2/2] IPv6: reply ICMP error if the first fragment don't include all headers
Date: Sat, 30 Jan 2021 15:53:10 +0100 [thread overview]
Message-ID: <YBVy1kNl5joCU2Xb@kroah.com> (raw)
In-Reply-To: <20210130115452.19192-2-acj@cisco.com>
On Sat, Jan 30, 2021 at 05:24:52PM +0530, Aviraj CJ wrote:
> From: Hangbin Liu <liuhangbin@gmail.com>
>
> commit 2efdaaaf883a143061296467913c01aa1ff4b3ce upstream.
>
> 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.
>
> Checking each packet header in IPv6 fast path will have performance impact,
> so I put the checking in ipv6_frag_rcv().
>
> As the packet may be any kind of L4 protocol, I only checked some common
> protocols' header length and handle others by (offset + 1) > skb->len.
> Also use !(frag_off & htons(IP6_OFFSET)) to catch atomic fragments
> (fragmented packet with only one fragment).
>
> When send ICMP error message, if the 1st truncated fragment is ICMP message,
> icmp6_send() will break as is_ineligible() return true. So I added a check
> in is_ineligible() to let fragment packet with nexthdr ICMP but no ICMP header
> return false.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Aviraj CJ <acj@cisco.com>
> ---
> net/ipv6/icmp.c | 8 +++++++-
> net/ipv6/reassembly.c | 33 ++++++++++++++++++++++++++++++++-
> 2 files changed, 39 insertions(+), 2 deletions(-)
Both now queued up, thanks.
greg k-h
prev parent reply other threads:[~2021-01-30 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-30 11:54 [PATCH stable v5.4 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Aviraj CJ
2021-01-30 11:54 ` [PATCH stable v5.4 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Aviraj CJ
2021-01-30 14:53 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YBVy1kNl5joCU2Xb@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=acj@cisco.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=xe-linux-external@cisco.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).