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
  • kernel
  • bpf
  • arraymap.c
Find file BlameHistoryPermalink
  • Hou Tao's avatar
    bpf: Acquire map uref in .init_seq_private for array map iterator · f76fa6b3
    Hou Tao authored Aug 10, 2022
    bpf_iter_attach_map() acquires a map uref, and the uref may be released
    before or in the middle of iterating map elements. For example, the uref
    could be released in bpf_iter_detach_map() as part of
    bpf_link_release(), or could be released in bpf_map_put_with_uref() as
    part of bpf_map_release().
    
    Alternative fix is acquiring an extra bpf_link reference just like
    a pinned map iterator does, but it introduces unnecessary dependency
    on bpf_link instead of bpf_map.
    
    So choose another fix: acquiring an extra map uref in .init_seq_private
    for array map iterator.
    
    Fixes: d3cc2ab5
    
     ("bpf: Implement bpf iterator for array maps")
    Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
    Acked-by: default avatarYonghong Song <yhs@fb.com>
    Link: https://lore.kernel.org/r/20220810080538.1845898-2-houtao@huaweicloud.com
    
    
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    f76fa6b3
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7