On Tue, Oct 8, 2019 at 12:31 PM Jakub Kicinski
<jakub.kicin...@netronome.com> wrote:
>
> On Mon,  7 Oct 2019 12:21:05 -0700, Eric Dumazet wrote:
> > syzbot reported a warning [1] that triggered after recent Jiri patch.
> >
> > This exposes a bug that we hit already in the past (see commit
> > ff244c6b29b1 ("tun: handle register_netdevice() failures properly")
> > for details)
> >
> > tun uses priv->destructor without an ndo_init() method.
> >
> > register_netdevice() can return an error, but will
> > not call priv->destructor() in some cases. Jiri recent
> > patch added one more.
> >
> > A long term fix would be to transfer the initialization
> > of what we destroy in ->destructor() in the ndo_init()
> >
> > This looks a bit risky given the complexity of tun driver.
> >
> > A simpler fix is to detect after the failed register_netdevice()
> > if the tun_free_netdev() function was called already.
> >
> > [...]
> >
> > Fixes: ff92741270bf ("net: introduce name_node struct to be used in 
> > hashlist")
> > Signed-off-by: Eric Dumazet <eduma...@google.com>
> > Cc: Jiri Pirko <j...@mellanox.com>
> > Reported-by: syzbot <syzkal...@googlegroups.com>
>
> Looks good, obviously. Presumably we could remove the workaround added
> by commit 0ad646c81b21 ("tun: call dev_get_valid_name() before
> register_netdevice()") at this point? What are your thoughts on that?

This is indeed something that could be done now, maybe by an independent revert.

Reply via email to