Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • net
  • core
  • dev.c
Find file BlameHistoryPermalink
  • Cong Wang's avatar
    tun: call dev_get_valid_name() before register_netdevice() · 4e3f69b8
    Cong Wang authored Oct 13, 2017
    BugLink: http://bugs.launchpad.net/bugs/1744636
    
    [ Upstream commit 0ad646c8 ]
    
    register_netdevice() could fail early when we have an invalid
    dev name, in which case ->ndo_uninit() is not called. For tun
    device, this is a problem because a timer etc. are already
    initialized and it expects ->ndo_uninit() to clean them up.
    
    We could move these initializations into a ->ndo_init() so
    that register_netdevice() knows better, however this is still
    complicated due to the logic in tun_detach().
    
    Therefore, I choose to just call dev_get_valid_name() before
    register_netdevice(), which is quicker and much easier to audit.
    And for this specific case, it is already enough.
    
    Fixes: 96442e42
    
     ("tuntap: choose the txq based on rxq")
    Reported-by: default avatarDmitry Alexeev <avekceeb@gmail.com>
    Cc: Jason Wang <jasowang@redhat.com>
    Cc: "Michael S. Tsirkin" <mst@redhat.com>
    Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
    Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
    4e3f69b8
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7