[ovs-dev] [PATCH net] net: openvswitch: free vport unless register_netdevice() succeeds

Jakub Kicinski jakub.kicinski at netronome.com
Tue Oct 22 21:53:16 UTC 2019

On Mon, 21 Oct 2019 12:01:57 +0200, Stefano Brivio wrote:
> From: Hillf Danton <hdanton at sina.com>
> syzbot found the following crash on:
> The function in net core, register_netdevice(), may fail with vport's
> destruction callback either invoked or not. After commit 309b66970ee2,

I've added the correct commit quote here, please heed checkpatch'es

> the duty to destroy vport is offloaded from the driver OTOH, which ends
> up in the memory leak reported.
> It is fixed by releasing vport unless device is registered successfully.
> To do that, the callback assignment is defered until device is registered.
> Reported-by: syzbot+13210896153522fe1ee5 at syzkaller.appspotmail.com
> Fixes: 309b66970ee2 ("net: openvswitch: do not free vport if register_netdevice() is failed.")
> Cc: Taehee Yoo <ap420073 at gmail.com>
> Cc: Greg Rose <gvrose8192 at gmail.com>
> Cc: Eric Dumazet <eric.dumazet at gmail.com>
> Cc: Marcelo Ricardo Leitner <marcelo.leitner at gmail.com>
> Cc: Ying Xue <ying.xue at windriver.com>
> Cc: Andrey Konovalov <andreyknvl at google.com>
> Signed-off-by: Hillf Danton <hdanton at sina.com>
> Acked-by: Pravin B Shelar <pshelar at ovn.org>
> [sbrivio: this was sent to dev at openvswitch.org and never made its way
>  to netdev -- resending original patch]
> Signed-off-by: Stefano Brivio <sbrivio at redhat.com>
> ---
> This patch was sent to dev at openvswitch.org and appeared on netdev
> only as Pravin replied to it, giving his Acked-by. I contacted the
> original author one month ago requesting to resend this to netdev,
> but didn't get an answer, so I'm now resending the original patch.

Applied and queued for 4.14+, thanks!

More information about the dev mailing list