DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: vignesh.purushotham.srinivas@ericsson.com
Cc: dev@dpdk.org, konstantin.v.ananyev@yandex.ru,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [RFC] ip_frag: support IPv6 reassembly with extensions
Date: Mon, 11 Nov 2024 12:24:40 +0100	[thread overview]
Message-ID: <14465732.5MRjnR8RnV@thomas> (raw)
In-Reply-To: <20240213195107.736fb1e4@hermes.local>

14/02/2024 04:51, Stephen Hemminger:
> On Tue, 13 Feb 2024 12:47:27 +0100
> <vignesh.purushotham.srinivas@ericsson.com> wrote:
> 
> > +/*
> > + * Function to crawl through the extension header stack.
> > + * This function breaks as soon a the fragment header is
> > + * found and returns the total length the traversed exts
> > + * and the last extension before the fragment header
> > + */
> > +static inline uint32_t
> > +ip_frag_get_last_exthdr(struct rte_ipv6_hdr *ip_hdr, uint8_t **last_ext)
> > +{
> > +	uint32_t total_len = 0;
> > +	size_t ext_len = 0;
> > +	*last_ext = (uint8_t *)(ip_hdr + 1);
> > +	int next_proto = ip_hdr->proto;
> > +
> > +	while (next_proto != IPPROTO_FRAGMENT &&
> > +		(next_proto = rte_ipv6_get_next_ext(
> > +		*last_ext, next_proto, &ext_len)) >= 0) {
> > +
> > +		total_len += ext_len;
> > +
> > +		if (next_proto == IPPROTO_FRAGMENT)
> > +			return total_len;
> > +
> > +		*last_ext += ext_len;
> > +	}
> > +
> > +	return total_len;
> > +}
> 
> Doing endless loop like this opens up DoS attacks.
> Better to use rte_next_skip_ip6_ext() or do similar limited loop.

There was no reply to this interesting comment?



  reply	other threads:[~2024-11-11 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 11:47 vignesh.purushotham.srinivas
2024-02-14  3:51 ` Stephen Hemminger
2024-11-11 11:24   ` Thomas Monjalon [this message]
2024-11-11 12:59     ` Konstantin Ananyev
2024-11-11 13:10       ` Thomas Monjalon

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=14465732.5MRjnR8RnV@thomas \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=stephen@networkplumber.org \
    --cc=vignesh.purushotham.srinivas@ericsson.com \
    /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).