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
  • devlink
  • core.c
Find file BlameHistoryPermalink
  • Jakub Kicinski's avatar
    devlink: keep the instance mutex alive until references are gone · 93e71edf
    Jakub Kicinski authored Jan 10, 2023
    
    
    The reference needs to keep the instance memory around, but also
    the instance lock must remain valid. Users will take the lock,
    check registration status and release the lock. mutex_destroy()
    etc. belong in the same place as the freeing of the memory.
    
    Unfortunately lockdep_unregister_key() sleeps so we need
    to switch the an rcu_work.
    
    Note that the problem is a bit hard to repro, because
    devlink_pernet_pre_exit() iterates over registered instances.
    AFAIU the instances must get devlink_free()d concurrently with
    the namespace getting deleted for the problem to occur.
    
    Reported-by: default avatar <syzbot+d94d214ea473e218fc89@syzkaller.appspotmail.com>
    Reported-by: default avatar <syzbot+9f0dd863b87113935acf@syzkaller.appspotmail.com>
    Fixes: 9053637e
    
     ("devlink: remove the registration guarantee of references")
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Link: https://lore.kernel.org/r/20230111042908.988199-1-kuba@kernel.org
    
    
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    93e71edf
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7