Skip to contentSkip to conversation

ipv6: exthdrs: fix three SRH issues

PATCH In review Eric Dumazet 4 participants 14 messages May 17, 2023 – May 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ipv6: exthdrs: fix three SRH issues

While looking at a related CVE, I found three problems worth fixing in ipv6_rpl_srh_rcv() and ipv6_srh_rcv().

Eric Dumazet (3):
ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()
ipv6: exthdrs: avoid potential NULL deref in ipv6_srh_rcv()
ipv6: exthdrs: avoid potential NULL deref in ipv6_rpl_srh_rcv()

 net/ipv6/exthdrs.c | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)
Signature · 1 line
2.40.1.606.ga4b1b128d6-goog
#1 lore raw

PATCH 1/3 ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

After calls to pskb_may_pull() we need to reload @hdr variable, because skb->head might have changed.

We need to move up first pskb_may_pull() call right after looped_back label.

Fixes 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
Cc Alexander Aring <[email protected]>
Cc David Lebrun <[email protected]>
---
 net/ipv6/exthdrs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
net/ipv6/exthdrs.c +5 -6
index a8d961d3a477f6516f542025dfbcfc6f47407a70..b129e982205ee43cbf74f4900c3031827d962dc2 100644
@@ -511,6 +511,10 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 	}
 
 looped_back:
+	if (!pskb_may_pull(skb, sizeof(*hdr))) {
+		kfree_skb(skb);
+		return -1;
+	}
 	hdr = (struct ipv6_rpl_sr_hdr *)skb_transport_header(skb);
 
 	if (hdr->segments_left == 0) {
@@ -544,12 +548,6 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 
 		return 1;
 	}
-
-	if (!pskb_may_pull(skb, sizeof(*hdr))) {
-		kfree_skb(skb);
-		return -1;
-	}
-
 	n = (hdr->hdrlen << 3) - hdr->pad - (16 - hdr->cmpre);
 	r = do_div(n, (16 - hdr->cmpri));
 	/* checks if calculation was without remainder and n fits into
@@ -592,6 +590,7 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 		kfree_skb(skb);
 		return -1;
 	}
+	hdr = (struct ipv6_rpl_sr_hdr *)skb_transport_header(skb);
 
 	hdr->segments_left--;
 	i = n - hdr->segments_left;
Signature · 1 line
2.40.1.606.ga4b1b128d6-goog
#2 lore raw

Re: [PATCH net 1/3] ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

Quoted 19 lines · Eric Dumazet

After calls to pskb_may_pull() we need to reload @hdr variable, because skb->head might have changed.

We need to move up first pskb_may_pull() call right after looped_back label.

Fixes 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
Cc Alexander Aring <[email protected]>
Cc David Lebrun <[email protected]>
---
 net/ipv6/exthdrs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
net/ipv6/exthdrs.c +0 -0
index a8d961d3a477f6516f542025dfbcfc6f47407a70..b129e982205ee43cbf74f4900c3031827d962dc2 100644

net/ipv6/exthdrs.c static int ipv6_rpl_srh_rcv(struct sk_buff *skb) · line 520

Quoted 10 lines
net/ipv6/exthdrs.c +4 -0
@@ -511,6 +511,10 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 	}
 
 looped_back:
+	if (!pskb_may_pull(skb, sizeof(*hdr))) {
+		kfree_skb(skb);
+		return -1;
+	}
 	hdr = (struct ipv6_rpl_sr_hdr *)skb_transport_header(skb);
 
 	if (hdr->segments_left == 0) {

Hi Eric,

Not far below this line there is a call to pskb_pull():

                if (hdr->nexthdr == NEXTHDR_IPV6) {
                        int offset = (hdr->hdrlen + 1) << 3;

                        skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb_network_header_len(skb));

                        if (!pskb_pull(skb, offset)) {
                                kfree_skb(skb);
                                return -1;
                        }
                        skb_postpull_rcsum(skb, skb_transport_header(skb),
                                           offset);

Should hdr be reloaded after the call to pskb_pull() too?

Quoted 25 lines
net/ipv6/exthdrs.c +1 -6
@@ -544,12 +548,6 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 
 		return 1;
 	}
-
-	if (!pskb_may_pull(skb, sizeof(*hdr))) {
-		kfree_skb(skb);
-		return -1;
-	}
-
 	n = (hdr->hdrlen << 3) - hdr->pad - (16 - hdr->cmpre);
 	r = do_div(n, (16 - hdr->cmpri));
 	/* checks if calculation was without remainder and n fits into
@@ -592,6 +590,7 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 		kfree_skb(skb);
 		return -1;
 	}
+	hdr = (struct ipv6_rpl_sr_hdr *)skb_transport_header(skb);
 
 	hdr->segments_left--;
 	i = n - hdr->segments_left;
Signature · 1 line
2.40.1.606.ga4b1b128d6-goog
#3 lore raw

Re: [PATCH net 1/3] ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

Quoted 49 lines · Simon Horman
Quoted 19 lines · Eric Dumazet

After calls to pskb_may_pull() we need to reload @hdr variable, because skb->head might have changed.

We need to move up first pskb_may_pull() call right after looped_back label.

Fixes 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
Cc Alexander Aring <[email protected]>
Cc David Lebrun <[email protected]>
---
 net/ipv6/exthdrs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
net/ipv6/exthdrs.c +0 -0
index a8d961d3a477f6516f542025dfbcfc6f47407a70..b129e982205ee43cbf74f4900c3031827d962dc2 100644

net/ipv6/exthdrs.c static int ipv6_rpl_srh_rcv(struct sk_buff *skb) · line 520

Quoted 10 lines
net/ipv6/exthdrs.c +4 -0
@@ -511,6 +511,10 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
      }
 
 looped_back:
+     if (!pskb_may_pull(skb, sizeof(*hdr))) {
+             kfree_skb(skb);
+             return -1;
+     }
      hdr = (struct ipv6_rpl_sr_hdr *)skb_transport_header(skb);
 
      if (hdr->segments_left == 0) {

Hi Eric,

Not far below this line there is a call to pskb_pull():

                if (hdr->nexthdr == NEXTHDR_IPV6) {
                        int offset = (hdr->hdrlen + 1) << 3;

                        skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb_network_header_len(skb));

                        if (!pskb_pull(skb, offset)) {
                                kfree_skb(skb);
                                return -1;
                        }
                        skb_postpull_rcsum(skb, skb_transport_header(skb),
                                           offset);
Quoted 1 line

Should hdr be reloaded after the call to pskb_pull() too?

I do not think so, because @hdr is not used between this pskb_pull() and the return -1:

       if (hdr->nexthdr == NEXTHDR_IPV6) {
            int offset = (hdr->hdrlen + 1) << 3;

            skb_postpull_rcsum(skb, skb_network_header(skb),
                       skb_network_header_len(skb));

            if (!pskb_pull(skb, offset)) {
                kfree_skb(skb);
                return -1;
            }
            skb_postpull_rcsum(skb, skb_transport_header(skb),
                       offset);

            skb_reset_network_header(skb);
            skb_reset_transport_header(skb);
            skb->encapsulation = 0;

            __skb_tunnel_rx(skb, skb->dev, net);

            netif_rx(skb);
            return -1;
        }
maintainer
#4 lore raw

Re: [PATCH net 1/3] ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

Quoted 35 lines · On Sun, 21 May 2023 20:22:16 +0200 Eric Dumazet wrote:
Quoted 15 lines · Simon Horman

Not far below this line there is a call to pskb_pull():

                if (hdr->nexthdr == NEXTHDR_IPV6) {
                        int offset = (hdr->hdrlen + 1) << 3;

                        skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb_network_header_len(skb));

                        if (!pskb_pull(skb, offset)) {
                                kfree_skb(skb);
                                return -1;
                        }
                        skb_postpull_rcsum(skb, skb_transport_header(skb),
                                           offset);
Quoted 1 line

Should hdr be reloaded after the call to pskb_pull() too?

I do not think so, because @hdr is not used between this pskb_pull() and the return -1:

       if (hdr->nexthdr == NEXTHDR_IPV6) {
            int offset = (hdr->hdrlen + 1) << 3;

            skb_postpull_rcsum(skb, skb_network_header(skb),
                       skb_network_header_len(skb));

            if (!pskb_pull(skb, offset)) {
                kfree_skb(skb);
                return -1;
            }
            skb_postpull_rcsum(skb, skb_transport_header(skb),
                       offset);

            skb_reset_network_header(skb);
Quoted 8 lines
            skb_reset_transport_header(skb);
            skb->encapsulation = 0;

            __skb_tunnel_rx(skb, skb->dev, net);

            netif_rx(skb);
            return -1;
        }

Hum, there's very similar code in ipv6_srh_rcv() (a different function but with a very similar name) which calls pskb_pull() and then checks if hdr->nexthdr is v4. I'm guessing that's the one Simon was referring to.

#5 lore raw

Re: [PATCH net 1/3] ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

Quoted 41 lines · Jakub Kicinski
Quoted 40 lines · On Sun, 21 May 2023 20:22:16 +0200 Eric Dumazet wrote:
Quoted 15 lines · Simon Horman

Not far below this line there is a call to pskb_pull():

                if (hdr->nexthdr == NEXTHDR_IPV6) {
                        int offset = (hdr->hdrlen + 1) << 3;

                        skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb_network_header_len(skb));

                        if (!pskb_pull(skb, offset)) {
                                kfree_skb(skb);
                                return -1;
                        }
                        skb_postpull_rcsum(skb, skb_transport_header(skb),
                                           offset);
Quoted 1 line

Should hdr be reloaded after the call to pskb_pull() too?

I do not think so, because @hdr is not used between this pskb_pull() and the return -1:

       if (hdr->nexthdr == NEXTHDR_IPV6) {
            int offset = (hdr->hdrlen + 1) << 3;

            skb_postpull_rcsum(skb, skb_network_header(skb),
                       skb_network_header_len(skb));

            if (!pskb_pull(skb, offset)) {
                kfree_skb(skb);
                return -1;
            }
            skb_postpull_rcsum(skb, skb_transport_header(skb),
                       offset);

            skb_reset_network_header(skb);
            skb_reset_transport_header(skb);
            skb->encapsulation = 0;

            __skb_tunnel_rx(skb, skb->dev, net);
Quoted 8 lines
Quoted 3 lines
            netif_rx(skb);
            return -1;
        }

Hum, there's very similar code in ipv6_srh_rcv() (a different function but with a very similar name) which calls pskb_pull() and then checks if hdr->nexthdr is v4. I'm guessing that's the one Simon was referring to.

Yes, that does seem to be the case.

#6 lore raw

Re: [PATCH net 1/3] ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

Quoted 47 lines · Simon Horman
Quoted 45 lines · Jakub Kicinski
Quoted 43 lines · On Sun, 21 May 2023 20:22:16 +0200 Eric Dumazet wrote:
Quoted 15 lines · Simon Horman

Not far below this line there is a call to pskb_pull():

                if (hdr->nexthdr == NEXTHDR_IPV6) {
                        int offset = (hdr->hdrlen + 1) << 3;

                        skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb_network_header_len(skb));

                        if (!pskb_pull(skb, offset)) {
                                kfree_skb(skb);
                                return -1;
                        }
                        skb_postpull_rcsum(skb, skb_transport_header(skb),
                                           offset);
Quoted 1 line

Should hdr be reloaded after the call to pskb_pull() too?

I do not think so, because @hdr is not used between this pskb_pull() and the return -1:

       if (hdr->nexthdr == NEXTHDR_IPV6) {
            int offset = (hdr->hdrlen + 1) << 3;

            skb_postpull_rcsum(skb, skb_network_header(skb),
                       skb_network_header_len(skb));

            if (!pskb_pull(skb, offset)) {
                kfree_skb(skb);
                return -1;
            }
            skb_postpull_rcsum(skb, skb_transport_header(skb),
                       offset);

            skb_reset_network_header(skb);
            skb_reset_transport_header(skb);
            skb->encapsulation = 0;

            __skb_tunnel_rx(skb, skb->dev, net);

            netif_rx(skb);
            return -1;
        }
Quoted 6 lines
Quoted 4 lines

Hum, there's very similar code in ipv6_srh_rcv() (a different function but with a very similar name) which calls pskb_pull() and then checks if hdr->nexthdr is v4. I'm guessing that's the one Simon was referring to.

Yes, that does seem to be the case.

I think ipv6_srh_rcv() is fine.

The "goto looped_back" does not need to reload hdr.

The only point where skb->head can change is at the pskb_expand_head() call, which is properly followed by:

hdr = (struct ipv6_sr_hdr *)skb_transport_header(skb);

I will send a V2, because this first patch in the series can also make ipv6_rpl_srh_rcv() similar.
(No need to move around the pskb_may_pull(skb, sizeof(*hdr)

#7 lore raw

Re: [PATCH net 1/3] ipv6: exthdrs: fix potential use-after-free in ipv6_rpl_srh_rcv()

Quoted 59 lines · Eric Dumazet
Quoted 47 lines · Simon Horman
Quoted 45 lines · Jakub Kicinski
Quoted 43 lines · On Sun, 21 May 2023 20:22:16 +0200 Eric Dumazet wrote:
Quoted 15 lines · Simon Horman

Not far below this line there is a call to pskb_pull():

                if (hdr->nexthdr == NEXTHDR_IPV6) {
                        int offset = (hdr->hdrlen + 1) << 3;

                        skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb_network_header_len(skb));

                        if (!pskb_pull(skb, offset)) {
                                kfree_skb(skb);
                                return -1;
                        }
                        skb_postpull_rcsum(skb, skb_transport_header(skb),
                                           offset);
Quoted 1 line

Should hdr be reloaded after the call to pskb_pull() too?

I do not think so, because @hdr is not used between this pskb_pull() and the return -1:

       if (hdr->nexthdr == NEXTHDR_IPV6) {
            int offset = (hdr->hdrlen + 1) << 3;

            skb_postpull_rcsum(skb, skb_network_header(skb),
                       skb_network_header_len(skb));

            if (!pskb_pull(skb, offset)) {
                kfree_skb(skb);
                return -1;
            }
            skb_postpull_rcsum(skb, skb_transport_header(skb),
                       offset);

            skb_reset_network_header(skb);
            skb_reset_transport_header(skb);
            skb->encapsulation = 0;

            __skb_tunnel_rx(skb, skb->dev, net);

            netif_rx(skb);
            return -1;
        }
Quoted 6 lines
Quoted 4 lines

Hum, there's very similar code in ipv6_srh_rcv() (a different function but with a very similar name) which calls pskb_pull() and then checks if hdr->nexthdr is v4. I'm guessing that's the one Simon was referring to.

Yes, that does seem to be the case.

I think ipv6_srh_rcv() is fine.

The "goto looped_back" does not need to reload hdr.

Quoted 9 lines

The only point where skb->head can change is at the pskb_expand_head() call, which is properly followed by:

hdr = (struct ipv6_sr_hdr *)skb_transport_header(skb);

I will send a V2, because this first patch in the series can also make ipv6_rpl_srh_rcv() similar.
(No need to move around the pskb_may_pull(skb, sizeof(*hdr)

Hi Eric,

Thanks for the analysis.
And sorry for the noise on this one.

#8 lore raw

PATCH 2/3 ipv6: exthdrs: avoid potential NULL deref in ipv6_srh_rcv()

In reply to Eric Dumazet

There is some chance __in6_dev_get() returns NULL, we should not crash if that happens.

ipv6_srh_rcv() caller (ipv6_rthdr_rcv()) correctly deals with a NULL idev, we can use the same idea.

Same problem was later added in ipv6_rpl_srh_rcv(), this is handled in a separate patch to ease stable backports.

Fixes 1ababeba4a21 ("ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)")
Cc David Lebrun <[email protected]>
Cc Alexander Aring <[email protected]>
---
 net/ipv6/exthdrs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
net/ipv6/exthdrs.c +3 -6
index b129e982205ee43cbf74f4900c3031827d962dc2..4f874f70b3fb1f6b372b937fcfe6ebd1a56b921d 100644
@@ -366,21 +366,18 @@ static void seg6_update_csum(struct sk_buff *skb)
 			   (__be32 *)addr);
 }
 
-static int ipv6_srh_rcv(struct sk_buff *skb)
+static int ipv6_srh_rcv(struct sk_buff *skb, struct inet6_dev *idev)
 {
 	struct inet6_skb_parm *opt = IP6CB(skb);
 	struct net *net = dev_net(skb->dev);
 	struct ipv6_sr_hdr *hdr;
-	struct inet6_dev *idev;
 	struct in6_addr *addr;
 	int accept_seg6;
 
 	hdr = (struct ipv6_sr_hdr *)skb_transport_header(skb);
 
-	idev = __in6_dev_get(skb->dev);
-
 	accept_seg6 = net->ipv6.devconf_all->seg6_enabled;
-	if (accept_seg6 > idev->cnf.seg6_enabled)
+	if (idev && accept_seg6 > idev->cnf.seg6_enabled)
 		accept_seg6 = idev->cnf.seg6_enabled;
 
 	if (!accept_seg6) {
@@ -711,7 +708,7 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
 	switch (hdr->type) {
 	case IPV6_SRCRT_TYPE_4:
 		/* segment routing */
-		return ipv6_srh_rcv(skb);
+		return ipv6_srh_rcv(skb, idev);
 	case IPV6_SRCRT_TYPE_3:
 		/* rpl segment routing */
 		return ipv6_rpl_srh_rcv(skb);
Signature · 1 line
2.40.1.606.ga4b1b128d6-goog
Reviewed-by on v1 2/3
#9 lore raw

Re: [PATCH net 2/3] ipv6: exthdrs: avoid potential NULL deref in ipv6_srh_rcv()

Quoted 6 lines · Eric Dumazet

There is some chance __in6_dev_get() returns NULL, we should not crash if that happens.

ipv6_srh_rcv() caller (ipv6_rthdr_rcv()) correctly deals with a NULL idev, we can use the same idea.

Quoted 7 lines

Same problem was later added in ipv6_rpl_srh_rcv(), this is handled in a separate patch to ease stable backports.

Fixes 1ababeba4a21 ("ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)")
Cc David Lebrun <[email protected]>
Cc Alexander Aring <[email protected]>
#10 lore raw

PATCH 3/3 ipv6: exthdrs: avoid potential NULL deref in ipv6_rpl_srh_rcv()

In reply to Eric Dumazet

There is some chance __in6_dev_get() returns NULL, we should not crash if that happens.

ipv6_rpl_srh_rcv() caller (ipv6_rthdr_rcv()) correctly deals with a NULL idev, we can use the same idea.

Fixes 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
Cc David Lebrun <[email protected]>
Cc Alexander Aring <[email protected]>
---
 net/ipv6/exthdrs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
net/ipv6/exthdrs.c +3 -6
index 4f874f70b3fb1f6b372b937fcfe6ebd1a56b921d..cf86d07227d0c4fe7081a45a61124f8aaae4ec3a 100644
@@ -483,12 +483,11 @@ static int ipv6_srh_rcv(struct sk_buff *skb, struct inet6_dev *idev)
 	return -1;
 }
 
-static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
+static int ipv6_rpl_srh_rcv(struct sk_buff *skb, struct inet6_dev *idev)
 {
 	struct ipv6_rpl_sr_hdr *hdr, *ohdr, *chdr;
 	struct inet6_skb_parm *opt = IP6CB(skb);
 	struct net *net = dev_net(skb->dev);
-	struct inet6_dev *idev;
 	struct ipv6hdr *oldhdr;
 	unsigned char *buf;
 	int accept_rpl_seg;
@@ -496,10 +495,8 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 	u64 n = 0;
 	u32 r;
 
-	idev = __in6_dev_get(skb->dev);
-
 	accept_rpl_seg = net->ipv6.devconf_all->rpl_seg_enabled;
-	if (accept_rpl_seg > idev->cnf.rpl_seg_enabled)
+	if (idev && accept_rpl_seg > idev->cnf.rpl_seg_enabled)
 		accept_rpl_seg = idev->cnf.rpl_seg_enabled;
 
 	if (!accept_rpl_seg) {
@@ -711,7 +708,7 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
 		return ipv6_srh_rcv(skb, idev);
 	case IPV6_SRCRT_TYPE_3:
 		/* rpl segment routing */
-		return ipv6_rpl_srh_rcv(skb);
+		return ipv6_rpl_srh_rcv(skb, idev);
 	default:
 		break;
 	}
Signature · 1 line
2.40.1.606.ga4b1b128d6-goog
Reviewed-by on v1 3/3
#11 lore raw

Re: [PATCH net 3/3] ipv6: exthdrs: avoid potential NULL deref in ipv6_rpl_srh_rcv()

Quoted 10 lines · Eric Dumazet

There is some chance __in6_dev_get() returns NULL, we should not crash if that happens.

ipv6_rpl_srh_rcv() caller (ipv6_rthdr_rcv()) correctly deals with a NULL idev, we can use the same idea.

Fixes 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
Cc David Lebrun <[email protected]>
Cc Alexander Aring <[email protected]>
#12 lore raw
In reply to Eric Dumazet

Hi,

Quoted 3 lines · Eric Dumazet

While looking at a related CVE, I found three problems worth fixing in ipv6_rpl_srh_rcv() and ipv6_srh_rcv().

thanks, for looking into it. I got some reproducers for the CVE (I hope we are talking about the same one), I believe it has something to do with what Jakub already pointed out. It's about IPV6_RPL_SRH_WORST_SWAP_SIZE [0] is not correct, if the last address in the segment address array is completely different than all other segment addresses the source header will grow a lot, about (number of segment addresses * sizeof(struct in6_addr)). Maybe there can be more intelligent ways to find the right number here... however I tried to change it without success to fix the problem. :-/

- Alex

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/exthdrs.c?h=v6.4-rc2#n572

#13 lore raw
Quoted 8 lines · Alexander Aring

Hi,

Quoted 3 lines · Eric Dumazet

While looking at a related CVE, I found three problems worth fixing in ipv6_rpl_srh_rcv() and ipv6_srh_rcv().

Quoted 9 lines

thanks, for looking into it. I got some reproducers for the CVE (I hope we are talking about the same one), I believe it has something to do with what Jakub already pointed out. It's about IPV6_RPL_SRH_WORST_SWAP_SIZE [0] is not correct, if the last address in the segment address array is completely different than all other segment addresses the source header will grow a lot, about (number of segment addresses * sizeof(struct in6_addr)). Maybe there can be more intelligent ways to find the right number here... however I tried to change it without success to fix the problem. :-/

Hmmm... this patch series fixes other generic issues.

I have not claimed to solve this CVE yet.