Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236408

Re: [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment()

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment()
Date 2015-09-30 16:50 +0200
Message-ID <qeqRH-7Z1-3@gated-at.bofh.it> (permalink)
References <qebSG-3fs-5@gated-at.bofh.it> <qebSG-3fs-15@gated-at.bofh.it>
Organization Cogent Embedded

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment() Joe Stringer <joestringer@nicira.com> - 2015-09-30 00:50 +0200
  Re: [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment() "Rustad, Mark D" <mark.d.rustad@intel.com> - 2015-09-30 00:50 +0200
    Re: [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment() Joe Stringer <joestringer@nicira.com> - 2015-09-30 01:20 +0200
  Re: [PATCH net 3/7] openvswitch: Fix skb leak in ovs_fragment() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-09-30 16:50 +0200

csiph-web