From: Richard Haines <hidden> Date: 2017-06-05 15:44:40
When using CALIPSO with IPPROTO_UDP it is possible to trigger a GPF as the
IP header may have moved.
Also update the payload length after adding the CALIPSO option.
Signed-off-by: Richard Haines <redacted>
---
net/ipv6/calipso.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -1319,7 +1319,7 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,structipv6hdr*ip6_hdr;structipv6_opt_hdr*hop;unsignedcharbuf[CALIPSO_MAX_BUFFER];-intlen_delta,new_end,pad;+intlen_delta,new_end,pad,payload;unsignedintstart,end;ip6_hdr=ipv6_hdr(skb);
@@ -1346,6 +1346,8 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,if(ret_val<0)returnret_val;+ip6_hdr=ipv6_hdr(skb);/* Reset as skb_cow() may have moved it */+if(len_delta){if(len_delta>0)skb_push(skb,len_delta);
@@ -1355,6 +1357,8 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,sizeof(*ip6_hdr)+start);skb_reset_network_header(skb);ip6_hdr=ipv6_hdr(skb);+payload=ntohs(ip6_hdr->payload_len);+ip6_hdr->payload_len=htons(payload+len_delta);}hop=(structipv6_opt_hdr*)(ip6_hdr+1);
From: Paul Moore <paul@paul-moore.com> Date: 2017-06-05 15:55:34
On Mon, Jun 5, 2017 at 11:44 AM, Richard Haines
[off-list ref] wrote:
When using CALIPSO with IPPROTO_UDP it is possible to trigger a GPF as the
IP header may have moved.
Also update the payload length after adding the CALIPSO option.
Signed-off-by: Richard Haines <redacted>
---
net/ipv6/calipso.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Acked-by: Paul Moore <paul@paul-moore.com>
Thanks Richard. DaveM, I assume you'll be pulling this into your tree?
@@ -1319,7 +1319,7 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,structipv6hdr*ip6_hdr;structipv6_opt_hdr*hop;unsignedcharbuf[CALIPSO_MAX_BUFFER];-intlen_delta,new_end,pad;+intlen_delta,new_end,pad,payload;unsignedintstart,end;ip6_hdr=ipv6_hdr(skb);
@@ -1346,6 +1346,8 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,if(ret_val<0)returnret_val;+ip6_hdr=ipv6_hdr(skb);/* Reset as skb_cow() may have moved it */+if(len_delta){if(len_delta>0)skb_push(skb,len_delta);
@@ -1355,6 +1357,8 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,sizeof(*ip6_hdr)+start);skb_reset_network_header(skb);ip6_hdr=ipv6_hdr(skb);+payload=ntohs(ip6_hdr->payload_len);+ip6_hdr->payload_len=htons(payload+len_delta);}hop=(structipv6_opt_hdr*)(ip6_hdr+1);--
From: David Miller <davem@davemloft.net> Date: 2017-06-05 16:00:23
From: Paul Moore <paul@paul-moore.com>
Date: Mon, 5 Jun 2017 11:55:34 -0400
On Mon, Jun 5, 2017 at 11:44 AM, Richard Haines
[off-list ref] wrote:
quoted
When using CALIPSO with IPPROTO_UDP it is possible to trigger a GPF as the
IP header may have moved.
Also update the payload length after adding the CALIPSO option.
Signed-off-by: Richard Haines <redacted>
---
net/ipv6/calipso.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Acked-by: Paul Moore <paul@paul-moore.com>
Thanks Richard. DaveM, I assume you'll be pulling this into your tree?
From: David Miller <davem@davemloft.net> Date: 2017-06-06 19:19:32
From: Richard Haines <redacted>
Date: Mon, 5 Jun 2017 16:44:40 +0100
When using CALIPSO with IPPROTO_UDP it is possible to trigger a GPF as the
IP header may have moved.
Also update the payload length after adding the CALIPSO option.
Signed-off-by: Richard Haines <redacted>
Applied and queued up for -stable, thank you Richard.