Netdev List
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: Cong Wang <cwang@twopensource.com>
Cc: netdev <netdev@vger.kernel.org>, Thomas Graf <tgraf@suug.ch>
Subject: Re: use after free again...
Date: Tue, 25 Aug 2015 18:09:47 +0200	[thread overview]
Message-ID: <20150825180947.0e47ce32@griffin> (raw)
In-Reply-To: <CAHA+R7Mr03t5NQMhdeY0ygHM5+nzMecoQL7TFOMNmR1+OgCQ7g@mail.gmail.com>

On Mon, 24 Aug 2015 23:02:02 -0700, Cong Wang wrote:
> Hi, Jiri,
> 
> In your commit 61adedf3e3f1d3f032c5a6a299978d91eff6d555 ("route: move
> lwtunnel state to dst_entry"), how the hell could the following piece
> be correct? :-/

It's not.

> I cooked a _quick_ patch to fix it. I can send it formally if it looks
> good to you, if not, feel free to send a better fix before me.
> 
> diff --git a/net/core/dst.c b/net/core/dst.c
> index 50dcdbb..477035e 100644
> --- a/net/core/dst.c
> +++ b/net/core/dst.c
> @@ -262,11 +262,12 @@ again:
>         if (dst->dev)
>                 dev_put(dst->dev);
> 
> +       lwtstate_put(dst->lwtstate);
> +
>         if (dst->flags & DST_METADATA)
>                 kfree(dst);
>         else
>                 kmem_cache_free(dst->ops->kmem_cachep, dst);
> -       lwtstate_put(dst->lwtstate);
> 
>         dst = child;
>         if (dst) {

Looks good. You can add my
Acked-by: Jiri Benc <jbenc@redhat.com>
when you submit it.

Thanks a lot,

 Jiri

-- 
Jiri Benc

      reply	other threads:[~2015-08-25 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25  6:02 use after free again Cong Wang
2015-08-25 16:09 ` Jiri Benc [this message]

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=20150825180947.0e47ce32@griffin \
    --to=jbenc@redhat.com \
    --cc=cwang@twopensource.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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