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
  • include
  • linux
  • device
  • class.h
Find file BlameHistoryPermalink
  • Greg Kroah-Hartman's avatar
    driver core: class: properly reference count class_dev_iter() · ddaf098e
    Greg Kroah-Hartman authored May 16, 2023
    
    
    When class_dev_iter is initialized, the reference count for the subsys
    private structure is incremented, but never decremented, causing a
    memory leak over time.  To resolve this, save off a pointer to the
    internal structure into the class_dev_iter structure and then when the
    iterator is finished, drop the reference count.
    
    Reported-and-tested-by: default avatar <syzbot+e7afd76ad060fa0d2605@syzkaller.appspotmail.com>
    Fixes: 7b884b7f
    
     ("driver core: class.c: convert to only use class_to_subsys")
    Reported-by: default avatarMirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
    Cc: Alan Stern <stern@rowland.harvard.edu>
    Acked-by: default avatarRafael J. Wysocki <rafael@kernel.org>
    Tested-by: default avatarMirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
    Link: https://lore.kernel.org/r/2023051610-stove-condense-9a77@gregkh
    
    
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ddaf098e
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7