All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum
@ 2016-03-16 16:35 Jiri Benc
  2016-03-16 17:09 ` Tom Herbert
  2016-03-19  2:19 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jiri Benc @ 2016-03-16 16:35 UTC (permalink / raw)
  To: netdev; +Cc: Tom Herbert

The vxlan header is pulled at this point, don't include it again in the
calculation.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
This was previously part of the VXLAN-GPE patchset but it's not really
related (especially not after the discussion that RCO should not be allowed
together with GPE). I'm sending it separately.
---
 drivers/net/vxlan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 800106a7246c..1eb8347f440c 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1143,7 +1143,7 @@ static int vxlan_igmp_leave(struct vxlan_dev *vxlan)
 static bool vxlan_remcsum(struct vxlanhdr *unparsed,
 			  struct sk_buff *skb, u32 vxflags)
 {
-	size_t start, offset, plen;
+	size_t start, offset;
 
 	if (!(unparsed->vx_flags & VXLAN_HF_RCO) || skb->remcsum_offload)
 		goto out;
@@ -1151,9 +1151,7 @@ static bool vxlan_remcsum(struct vxlanhdr *unparsed,
 	start = vxlan_rco_start(unparsed->vx_vni);
 	offset = start + vxlan_rco_offset(unparsed->vx_vni);
 
-	plen = sizeof(struct vxlanhdr) + offset + sizeof(u16);
-
-	if (!pskb_may_pull(skb, plen))
+	if (!pskb_may_pull(skb, offset + sizeof(u16)))
 		return false;
 
 	skb_remcsum_process(skb, (void *)(vxlan_hdr(skb) + 1), start, offset,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum
  2016-03-16 16:35 [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum Jiri Benc
@ 2016-03-16 17:09 ` Tom Herbert
  2016-03-16 17:13   ` Jiri Benc
  2016-03-19  2:19 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Herbert @ 2016-03-16 17:09 UTC (permalink / raw)
  To: Jiri Benc; +Cc: Linux Kernel Network Developers

On Wed, Mar 16, 2016 at 9:35 AM, Jiri Benc <jbenc@redhat.com> wrote:
> The vxlan header is pulled at this point, don't include it again in the
> calculation.
>
Hmm, I think I missing something obvious. Where was the pull of the
vxlan header done?

Thanks,
Tom

> Signed-off-by: Jiri Benc <jbenc@redhat.com>
> ---
> This was previously part of the VXLAN-GPE patchset but it's not really
> related (especially not after the discussion that RCO should not be allowed
> together with GPE). I'm sending it separately.
> ---
>  drivers/net/vxlan.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 800106a7246c..1eb8347f440c 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -1143,7 +1143,7 @@ static int vxlan_igmp_leave(struct vxlan_dev *vxlan)
>  static bool vxlan_remcsum(struct vxlanhdr *unparsed,
>                           struct sk_buff *skb, u32 vxflags)
>  {
> -       size_t start, offset, plen;
> +       size_t start, offset;
>
>         if (!(unparsed->vx_flags & VXLAN_HF_RCO) || skb->remcsum_offload)
>                 goto out;
> @@ -1151,9 +1151,7 @@ static bool vxlan_remcsum(struct vxlanhdr *unparsed,
>         start = vxlan_rco_start(unparsed->vx_vni);
>         offset = start + vxlan_rco_offset(unparsed->vx_vni);
>
> -       plen = sizeof(struct vxlanhdr) + offset + sizeof(u16);
> -
> -       if (!pskb_may_pull(skb, plen))
> +       if (!pskb_may_pull(skb, offset + sizeof(u16)))
>                 return false;
>
>         skb_remcsum_process(skb, (void *)(vxlan_hdr(skb) + 1), start, offset,
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum
  2016-03-16 17:09 ` Tom Herbert
@ 2016-03-16 17:13   ` Jiri Benc
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Benc @ 2016-03-16 17:13 UTC (permalink / raw)
  To: Tom Herbert; +Cc: Linux Kernel Network Developers

On Wed, 16 Mar 2016 10:09:38 -0700, Tom Herbert wrote:
> On Wed, Mar 16, 2016 at 9:35 AM, Jiri Benc <jbenc@redhat.com> wrote:
> > The vxlan header is pulled at this point, don't include it again in the
> > calculation.
> >
> Hmm, I think I missing something obvious. Where was the pull of the
> vxlan header done?

In iptunnel_pull_header. Sorry, should have mentioned it.

 Jiri

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum
  2016-03-16 16:35 [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum Jiri Benc
  2016-03-16 17:09 ` Tom Herbert
@ 2016-03-19  2:19 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-03-19  2:19 UTC (permalink / raw)
  To: jbenc; +Cc: netdev, tom

From: Jiri Benc <jbenc@redhat.com>
Date: Wed, 16 Mar 2016 17:35:47 +0100

> The vxlan header is pulled at this point, don't include it again in the
> calculation.
> 
> Signed-off-by: Jiri Benc <jbenc@redhat.com>

Please update the commit log message to explain where that pull
happens.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-19  2:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 16:35 [PATCH net-next] vxlan: fix too large pskb_may_pull with remote checksum Jiri Benc
2016-03-16 17:09 ` Tom Herbert
2016-03-16 17:13   ` Jiri Benc
2016-03-19  2:19 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.