netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Joe Stringer <joestringer@nicira.com>,
	netdev@vger.kernel.org, pshelar@nicira.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment()
Date: Wed, 30 Sep 2015 17:42:17 +0300	[thread overview]
Message-ID: <560BF4C9.7080509@cogentembedded.com> (raw)
In-Reply-To: <1443566380-22640-4-git-send-email-joestringer@nicira.com>

Hello.

On 09/30/2015 01:39 AM, Joe Stringer wrote:

> If ovs_fragment() was unable to fragment the skb due to an L2 header
> that exceeds the supported length, skbs would be leaked. Fix the bug.
>
> Fixes: 7f8a436 "openvswitch: Add conntrack action"
> Signed-off-by: Joe Stringer <joestringer@nicira.com>
> ---
>   net/openvswitch/actions.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index e23a61c..e1afbd1 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
[...]
> @@ -728,8 +727,14 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru,
>   		WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.",
>   			  ovs_vport_name(vport), ntohs(ethertype), mru,
>   			  vport->dev->mtu);
> -		kfree_skb(skb);
> +		goto out;
>   	}
> +
> +	skb = NULL;

    I'd just return here.

> +
> +out:
> +	if (skb)
> +		kfree_skb(skb);

    kfree_skb() checks for NULL.

[...]

MBR, Sergei

  parent reply	other threads:[~2015-09-30 14:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 22:39 [PATCH net 0/7] OVS conntrack fixes for net Joe Stringer
2015-09-29 22:39 ` [PATCH net 1/7] openvswitch: Make LABELS name more consistent Joe Stringer
2015-10-01  0:31   ` Pravin Shelar
2015-10-01  1:21     ` Joe Stringer
2015-09-29 22:39 ` [PATCH net 2/7] openvswitch: Fix typos in CT headers Joe Stringer
2015-10-01  0:31   ` Pravin Shelar
2015-09-29 22:39 ` [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment() Joe Stringer
2015-09-29 22:48   ` Rustad, Mark D
2015-09-29 23:12     ` Joe Stringer
2015-09-30 14:42   ` Sergei Shtylyov [this message]
2015-09-29 22:39 ` [PATCH net 4/7] openvswitch: Ensure flow is valid before executing ct Joe Stringer
2015-10-01  0:31   ` Pravin Shelar
2015-09-29 22:39 ` [PATCH net 5/7] openvswitch: Reject ct_state unsupported bits Joe Stringer
2015-10-01  0:31   ` Pravin Shelar
2015-10-01  1:20     ` Joe Stringer
2015-10-01  2:32       ` Pravin Shelar
2015-09-29 22:39 ` [PATCH net 6/7] openvswitch: Extend ct_state match field to 32 bits Joe Stringer
2015-10-01  0:31   ` Pravin Shelar
2015-09-29 22:39 ` [PATCH net 7/7] openvswitch: Change CT_ATTR_FLAGS to CT_ATTR_COMMIT Joe Stringer
2015-10-01  0:32   ` Pravin Shelar

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=560BF4C9.7080509@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=joestringer@nicira.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.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).