[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150825180947.0e47ce32@griffin>
Date: Tue, 25 Aug 2015 18:09:47 +0200
From: Jiri Benc <jbenc@...hat.com>
To: Cong Wang <cwang@...pensource.com>
Cc: netdev <netdev@...r.kernel.org>, Thomas Graf <tgraf@...g.ch>
Subject: Re: use after free again...
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@...hat.com>
when you submit it.
Thanks a lot,
Jiri
--
Jiri Benc
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists